Skip to content

Commit

Permalink
Use port as default value for inPort
Browse files Browse the repository at this point in the history
  • Loading branch information
Vort committed Jun 12, 2023
1 parent 3af1f4b commit 0ad2564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libi2pd_client/ClientContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ namespace client
int port = section.second.get<int> (I2P_SERVER_TUNNEL_PORT);
std::string keys = section.second.get<std::string> (I2P_SERVER_TUNNEL_KEYS);
// optional params
int inPort = section.second.get (I2P_SERVER_TUNNEL_INPORT, 0);
int inPort = section.second.get<int> (I2P_SERVER_TUNNEL_INPORT, port);
std::string accessList = section.second.get (I2P_SERVER_TUNNEL_ACCESS_LIST, "");
if(accessList == "")
accessList=section.second.get (I2P_SERVER_TUNNEL_WHITE_LIST, "");
Expand Down
5 changes: 2 additions & 3 deletions libi2pd_client/I2PTunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,9 @@ namespace client
int port, std::shared_ptr<ClientDestination> localDestination, int inport, bool gzip):
I2PService (localDestination), m_IsUniqueLocal(true), m_Name (name), m_Address (address), m_Port (port), m_IsAccessList (false)
{
int inPort = (inport ? inport : port);
m_PortDestination = localDestination->GetStreamingDestination (inPort);
m_PortDestination = localDestination->GetStreamingDestination (inport);
if (!m_PortDestination) // default destination
m_PortDestination = localDestination->CreateStreamingDestination (inPort, gzip);
m_PortDestination = localDestination->CreateStreamingDestination (inport, gzip);
}

void I2PServerTunnel::Start ()
Expand Down

0 comments on commit 0ad2564

Please sign in to comment.