we also have to send pings to slave servers which have the same port as the default llcon port (since the router has not translated the port number to a new one)

This commit is contained in:
Volker Fischer 2012-06-17 18:04:43 +00:00
parent fa30a903a3
commit 458310e4a2

View file

@ -241,14 +241,9 @@ void CServerListManager::OnTimerPingServerInList()
const int iCurServerListSize = ServerList.size(); const int iCurServerListSize = ServerList.size();
// Send ping to list entries except of the very first one (which is the central // send ping to list entries except of the very first one (which is the central
// server entry) and the predefined servers. Also, do not send the ping to // server entry) and the predefined servers
// servers which use the local port number since no port translation has
// been done and therefore the probability is high that a port forwarding was
// installed by the user of this server.
for ( int iIdx = 1 + iNumPredefinedServers; iIdx < iCurServerListSize; iIdx++ ) for ( int iIdx = 1 + iNumPredefinedServers; iIdx < iCurServerListSize; iIdx++ )
{
if ( ServerList[iIdx].HostAddr.iPort != ServerList[iIdx].iLocalPortNumber )
{ {
// send ping message to keep NAT port open at slave server // send ping message to keep NAT port open at slave server
pConnLessProtocol->CreateCLPingMes ( pConnLessProtocol->CreateCLPingMes (
@ -256,7 +251,6 @@ void CServerListManager::OnTimerPingServerInList()
0 /* dummy */ ); 0 /* dummy */ );
} }
} }
}
void CServerListManager::OnTimerPollList() void CServerListManager::OnTimerPollList()
{ {
@ -437,7 +431,7 @@ void CServerListManager::SlaveServerRegisterServer ( const bool bIsRegister )
SELECT_SERVER_ADDRESS ( bUseDefaultCentralServerAddress, SELECT_SERVER_ADDRESS ( bUseDefaultCentralServerAddress,
strCentralServerAddress ); strCentralServerAddress );
// For the slave server, the slave server properties are store in the // For the slave server, the slave server properties are stored in the
// very first item in the server list (which is actually no server list // very first item in the server list (which is actually no server list
// but just one item long for the slave server). // but just one item long for the slave server).
// Note that we always have to parse the server address again since if // Note that we always have to parse the server address again since if