Skip to content

Commit a0795d8

Browse files
committed
set server tunnel inport in ClientContext from port (PurpleI2P#1936)
Signed-off-by: r4sas <[email protected]>
1 parent 03cc6e0 commit a0795d8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

libi2pd_client/ClientContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ namespace client
723723
uint16_t port = section.second.get<uint16_t> (I2P_SERVER_TUNNEL_PORT);
724724
std::string keys = section.second.get<std::string> (I2P_SERVER_TUNNEL_KEYS);
725725
// optional params
726-
uint16_t inPort = section.second.get<uint16_t> (I2P_SERVER_TUNNEL_INPORT, 0);
726+
uint16_t inPort = section.second.get<uint16_t> (I2P_SERVER_TUNNEL_INPORT, port);
727727
std::string accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_ACCESS_LIST, "");
728728
if(accessList == "")
729729
accessList = section.second.get<std::string> (I2P_SERVER_TUNNEL_WHITE_LIST, "");

libi2pd_client/I2PTunnel.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,9 @@ namespace client
708708
uint16_t port, std::shared_ptr<ClientDestination> localDestination, uint16_t inport, bool gzip):
709709
I2PService (localDestination), m_IsUniqueLocal(true), m_Name (name), m_Address (address), m_Port (port), m_IsAccessList (false)
710710
{
711-
uint16_t inPort = (inport ? inport : port);
712-
m_PortDestination = localDestination->GetStreamingDestination (inPort);
711+
m_PortDestination = localDestination->GetStreamingDestination (inport);
713712
if (!m_PortDestination) // default destination
714-
m_PortDestination = localDestination->CreateStreamingDestination (inPort, gzip);
713+
m_PortDestination = localDestination->CreateStreamingDestination (inport, gzip);
715714
}
716715

717716
void I2PServerTunnel::Start ()

0 commit comments

Comments
 (0)