From 9ecaffd447844f57dbc0b9bed0ce549508e9050c Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 7 Mar 2026 18:37:09 -0500 Subject: [PATCH] made GetName const --- libi2pd_client/HTTPProxy.h | 14 ++++++++------ libi2pd_client/I2PService.h | 4 ++-- libi2pd_client/I2PTunnel.h | 10 +++++----- libi2pd_client/SOCKS.h | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/libi2pd_client/HTTPProxy.h b/libi2pd_client/HTTPProxy.h index 507a87e2..06ebe9e5 100644 --- a/libi2pd_client/HTTPProxy.h +++ b/libi2pd_client/HTTPProxy.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013-2024, The PurpleI2P Project +* Copyright (c) 2013-2026, The PurpleI2P Project * * This file is part of Purple i2pd project and licensed under BSD3 * @@ -9,13 +9,15 @@ #ifndef HTTP_PROXY_H__ #define HTTP_PROXY_H__ -namespace i2p { -namespace proxy { +namespace i2p +{ +namespace proxy +{ class HTTPProxy: public i2p::client::TCPIPAcceptor { public: - HTTPProxy(const std::string& name, const std::string& address, uint16_t port, const std::string & outproxy, + HTTPProxy(const std::string& name, const std::string& address, uint16_t port, const std::string & outproxy, bool addresshelper, bool senduseragent, std::shared_ptr localDestination); HTTPProxy(const std::string& name, const std::string& address, uint16_t port, std::shared_ptr localDestination = nullptr) : HTTPProxy(name, address, port, "", true, false, localDestination) {} ; @@ -28,8 +30,8 @@ namespace proxy { protected: // Implements TCPIPAcceptor - std::shared_ptr CreateHandler(std::shared_ptr socket); - const char* GetName() { return m_Name.c_str (); } + std::shared_ptr CreateHandler(std::shared_ptr socket) override; + const char* GetName() const override { return m_Name.c_str (); } private: diff --git a/libi2pd_client/I2PService.h b/libi2pd_client/I2PService.h index 80d0ba8c..5e21cfaa 100644 --- a/libi2pd_client/I2PService.h +++ b/libi2pd_client/I2PService.h @@ -68,7 +68,7 @@ namespace client virtual void Start () = 0; virtual void Stop () = 0; - virtual const char* GetName() { return "Generic I2P Service"; } + virtual const char* GetName() const { return "Generic I2P Service"; } private: @@ -243,7 +243,7 @@ namespace client } const typename Protocol::endpoint& GetLocalEndpoint () const { return m_LocalEndpoint; }; - const char* GetName() override { return "Generic TCP/IP accepting daemon"; } + const char* GetName() const override { return "Generic TCP/IP accepting daemon"; } protected: diff --git a/libi2pd_client/I2PTunnel.h b/libi2pd_client/I2PTunnel.h index 90d37e76..a4606169 100644 --- a/libi2pd_client/I2PTunnel.h +++ b/libi2pd_client/I2PTunnel.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013-2025, The PurpleI2P Project +* Copyright (c) 2013-2026, The PurpleI2P Project * * This file is part of Purple i2pd project and licensed under BSD3 * @@ -70,14 +70,14 @@ namespace client std::shared_ptr GetStream () const { return m_Stream; }; std::shared_ptr > GetSSL () const { return m_SSL; }; uint8_t * GetStreamBuffer () { return m_StreamBuffer; }; - + private: void HandleConnect (const boost::system::error_code& ecode); void HandleHandshake (const boost::system::error_code& ecode); void HandleReceive (const boost::system::error_code& ecode, std::size_t bytes_transferred); void HandleWrite (const boost::system::error_code& ecode); - + private: uint8_t m_Buffer[I2P_TUNNEL_CONNECTION_BUFFER_SIZE], m_StreamBuffer[I2P_TUNNEL_CONNECTION_STREAM_BUFFER_SIZE]; @@ -164,7 +164,7 @@ namespace client void Start (); void Stop (); - const char* GetName() { return m_Name.c_str (); } + const char* GetName() const override { return m_Name.c_str (); } void SetKeepAliveInterval (uint32_t keepAliveInterval); private: @@ -208,7 +208,7 @@ namespace client uint16_t GetLocalPort () const { return m_PortDestination->GetLocalPort (); }; const boost::asio::ip::tcp::endpoint& GetEndpoint () const { return m_Endpoint; } - const char* GetName() { return m_Name.c_str (); } + const char* GetName() const override { return m_Name.c_str (); } private: diff --git a/libi2pd_client/SOCKS.h b/libi2pd_client/SOCKS.h index 2f5b9231..cdf523fc 100644 --- a/libi2pd_client/SOCKS.h +++ b/libi2pd_client/SOCKS.h @@ -35,7 +35,7 @@ namespace proxy // Implements TCPIPAcceptor std::shared_ptr CreateHandler(std::shared_ptr socket) override; - const char* GetName() { return m_Name.c_str (); } + const char* GetName()const override { return m_Name.c_str (); } private: