@@ -116,9 +116,6 @@ bool CConnectManager::Connect ( const char* szHost, unsigned short usPort, const
116116 if ( !CCore::GetSingleton ().CheckDiskSpace () )
117117 return false ;
118118
119- // Test: Fix some timeouts by trying a tcp connection
120- pNet->GetHTTPDownloadManager ( EDownloadMode::CORE_UPDATER )->QueueFile ( m_strHost.c_str (), NULL , 0 , " " , 0 , true , NULL , NULL , false , 1 , 2000 );
121-
122119 // Set our packet handler
123120 pNet->RegisterPacketHandler ( CConnectManager::StaticProcessPacket );
124121
@@ -133,6 +130,7 @@ bool CConnectManager::Connect ( const char* szHost, unsigned short usPort, const
133130
134131 m_bIsConnecting = true ;
135132 m_tConnectStarted = time ( NULL );
133+ m_bHasSentTcpRequest = false ;
136134
137135 // Load server password
138136 if ( m_strPassword.empty () )
@@ -250,6 +248,17 @@ void CConnectManager::DoPulse ( void )
250248 }
251249 }
252250
251+ if ( !m_bHasSentTcpRequest )
252+ {
253+ if ( time ( NULL ) >= m_tConnectStarted + 2 )
254+ {
255+ // Handle possible IP rejection by proving we exist with a TCP connection
256+ g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadMode::CORE_UPDATER )->QueueFile ( m_strHost.c_str (), NULL , 0 , " " , 0 , true , NULL , NULL , false , 1 , 2000 );
257+ m_bHasSentTcpRequest = true ;
258+ AddReportLog ( 9401 , SString ( " ConnectManager sent TCP connection request to %s" , m_strHost.c_str () ) );
259+ }
260+ }
261+
253262 // Time to timeout the connection?
254263 if ( time ( NULL ) >= m_tConnectStarted + 8 )
255264 {
0 commit comments