Browse Source

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

Signed-off-by: r4sas <r4sas@i2pmail.org>
pull/1938/head
R4SAS 2 years ago
parent
commit
a0795d8534
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 2
      libi2pd_client/ClientContext.cpp
  2. 5
      libi2pd_client/I2PTunnel.cpp

2
libi2pd_client/ClientContext.cpp

@ -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, "");

5
libi2pd_client/I2PTunnel.cpp

@ -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 ()

Loading…
Cancel
Save