set server tunnel inport in ClientContext from port (#1936)

Signed-off-by: r4sas <r4sas@i2pmail.org>
This commit is contained in:
r4sas 2023-06-12 05:12:07 +03:00
parent 03cc6e0524
commit a0795d8534
No known key found for this signature in database
GPG Key ID: 66F6C87B98EBCFE2
2 changed files with 3 additions and 4 deletions

View File

@ -723,7 +723,7 @@ namespace client
uint16_t port = section.second.get<uint16_t> (I2P_SERVER_TUNNEL_PORT); uint16_t port = section.second.get<uint16_t> (I2P_SERVER_TUNNEL_PORT);
std::string keys = section.second.get<std::string> (I2P_SERVER_TUNNEL_KEYS); std::string keys = section.second.get<std::string> (I2P_SERVER_TUNNEL_KEYS);
// optional params // optional params
uint16_t inPort = section.second.get<uint16_t> (I2P_SERVER_TUNNEL_INPORT, 0); uint16_t inPort = section.second.get<uint16_t> (I2P_SERVER_TUNNEL_INPORT, port);
std::string accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_ACCESS_LIST, ""); std::string accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_ACCESS_LIST, "");
if(accessList == "") if(accessList == "")
accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_WHITE_LIST, ""); accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_WHITE_LIST, "");

View File

@ -708,10 +708,9 @@ namespace client
uint16_t port, std::shared_ptr<ClientDestination> localDestination, uint16_t inport, bool gzip): uint16_t port, std::shared_ptr<ClientDestination> localDestination, uint16_t inport, bool gzip):
I2PService (localDestination), m_IsUniqueLocal(true), m_Name (name), m_Address (address), m_Port (port), m_IsAccessList (false) I2PService (localDestination), m_IsUniqueLocal(true), m_Name (name), m_Address (address), m_Port (port), m_IsAccessList (false)
{ {
uint16_t inPort = (inport ? inport : port); m_PortDestination = localDestination->GetStreamingDestination (inport);
m_PortDestination = localDestination->GetStreamingDestination (inPort);
if (!m_PortDestination) // default destination if (!m_PortDestination) // default destination
m_PortDestination = localDestination->CreateStreamingDestination (inPort, gzip); m_PortDestination = localDestination->CreateStreamingDestination (inport, gzip);
} }
void I2PServerTunnel::Start () void I2PServerTunnel::Start ()