@@ -146,7 +146,7 @@ bool CConnectManager::Connect ( const char* szHost, unsigned short usPort, const
146
146
m_pServerItem = new CServerListItem ( m_Address, m_usPort );
147
147
m_pServerItem->m_iTimeoutLength = 2000 ;
148
148
m_bIsDetectingVersion = true ;
149
- OpenServerFirewall ( m_Address, 80 , true );
149
+ OpenServerFirewall ( m_Address, CServerBrowser::GetSingletonPtr ()-> FindServerHttpPort (m_strHost, m_usPort) , true );
150
150
151
151
// Display the status box
152
152
SString strBuffer ( _ (" Connecting to %s:%u ..." ), m_strHost.c_str (), m_usPort );
@@ -466,21 +466,29 @@ void CConnectManager::OnServerExists ( void )
466
466
//
467
467
void CConnectManager::OpenServerFirewall ( in_addr Address, ushort usHttpPort, bool bHighPriority )
468
468
{
469
- if ( usHttpPort == 0 )
470
- usHttpPort = 80 ;
471
-
472
469
uint uiTimeOut;
473
470
if ( bHighPriority )
474
471
{
475
472
// Clear previously queued requests if this is high priority
476
473
g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadMode::CONNECT_TCP_SEND )->Reset ();
474
+ g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadMode::CONNECT_TCP_SEND )->SetMaxConnections (2 );
477
475
uiTimeOut = 2000 ;
478
476
}
479
477
else
480
478
{
481
479
uiTimeOut = 1000 ;
482
480
}
483
481
484
- SString strDummyUrl ( " http://%s:%d/mta_client_firewall_probe/" , inet_ntoa ( Address ), usHttpPort );
485
- g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadMode::CONNECT_TCP_SEND )->QueueFile ( strDummyUrl, NULL , " " , 0 , true , NULL , NULL , false , 1 , uiTimeOut );
482
+ if ( usHttpPort )
483
+ {
484
+ // Send to server http port if known
485
+ SString strDummyUrl ( " http://%s:%d/mta_client_firewall_probe/" , inet_ntoa ( Address ), usHttpPort );
486
+ g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadMode::CONNECT_TCP_SEND )->QueueFile ( strDummyUrl, NULL , " " , 0 , true , NULL , NULL , false , 1 , uiTimeOut );
487
+ }
488
+ if ( usHttpPort == 0 || bHighPriority )
489
+ {
490
+ // Send to standard http port
491
+ SString strDummyUrl ( " http://%s/mta_client_firewall_probe/" , inet_ntoa ( Address ) );
492
+ g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadMode::CONNECT_TCP_SEND )->QueueFile ( strDummyUrl, NULL , " " , 0 , true , NULL , NULL , false , 1 , uiTimeOut );
493
+ }
486
494
}
0 commit comments