Skip to content

Commit be207c9

Browse files
committed
Added request method to CNetHTTPDownloadManager::QueueFile
1 parent 85951d2 commit be207c9

15 files changed

+21
-22
lines changed

Client/cefweb/CWebCore.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ bool CWebCore::UpdateListsFromMaster ()
491491
OutputDebugLine ( "Updating white- and blacklist..." );
492492
#endif
493493
g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString("%s?type=getrev", BROWSER_UPDATE_URL),
494-
NULL, 0, NULL, 0, false, this, &CWebCore::StaticFetchRevisionFinished, false, 3 );
494+
NULL, NULL, 0, false, this, &CWebCore::StaticFetchRevisionFinished, false, 3 );
495495

496496
pLastUpdateNode->SetTagContent ( SString ( "%d", (long long)currentTime ) );
497497
m_pXmlConfig->Write ();
@@ -686,15 +686,15 @@ void CWebCore::StaticFetchRevisionFinished ( const SHttpDownloadResult& result )
686686
if ( iWhiteListRevision > pWebCore->m_iWhitelistRevision )
687687
{
688688
g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString("%s?type=fetchwhite", BROWSER_UPDATE_URL ),
689-
NULL, 0, NULL, 0, false, pWebCore, &CWebCore::StaticFetchWhitelistFinished, false, 3 );
689+
NULL, NULL, 0, false, pWebCore, &CWebCore::StaticFetchWhitelistFinished, false, 3 );
690690

691691
pWebCore->m_iWhitelistRevision = iWhiteListRevision;
692692
}
693693
int iBlackListRevision = atoi ( strBlackRevision );
694694
if ( iBlackListRevision > pWebCore->m_iBlacklistRevision )
695695
{
696696
g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString("%s?type=fetchblack", BROWSER_UPDATE_URL),
697-
NULL, 0, NULL, 0, false, pWebCore, &CWebCore::StaticFetchBlacklistFinished, false, 3 );
697+
NULL, NULL, 0, false, pWebCore, &CWebCore::StaticFetchBlacklistFinished, false, 3 );
698698

699699
pWebCore->m_iBlacklistRevision = iBlackListRevision;
700700
}

Client/core/CConnectManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,5 +482,5 @@ void CConnectManager::OpenServerFirewall( in_addr Address, ushort usHttpPort, bo
482482
}
483483

484484
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, "", 0, true, NULL, NULL, false, 1, uiTimeOut );
485+
g_pCore->GetNetwork()->GetHTTPDownloadManager( EDownloadMode::CONNECT_TCP_SEND )->QueueFile( strDummyUrl, NULL, "", 0, true, NULL, NULL, false, 1, uiTimeOut );
486486
}

Client/core/CVersionUpdater.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,7 +3263,7 @@ int CVersionUpdater::DoSendDownloadRequestToNextServer ( void )
32633263
m_JobInfo.downloadStatus = EDownloadStatus::Running;
32643264
m_JobInfo.iDownloadResultCode = 0;
32653265
GetHTTP()->Reset();
3266-
GetHTTP()->QueueFile( strQueryURL, m_JobInfo.strResumableSaveLocation, 0, NULL, 0, false, this, StaticDownloadFinished, false, 10, 10000, false, true );
3266+
GetHTTP()->QueueFile( strQueryURL, m_JobInfo.strResumableSaveLocation, NULL, 0, false, this, StaticDownloadFinished, false, 10, 10000, false, true );
32673267
m_strLastQueryURL = strQueryURL;
32683268
OutputDebugLine( SString ( "[Updater] DoSendDownloadRequestToNextServer %d/%d %s", m_JobInfo.iCurrent, m_JobInfo.serverList.size (), strQueryURL.c_str () ) );
32693269
return RES_OK;
@@ -3416,7 +3416,7 @@ int CVersionUpdater::DoSendPostToNextServer ( void )
34163416
// Send data. Doesn't check if it was received.
34173417
//
34183418
GetHTTP()->Reset();
3419-
GetHTTP()->QueueFile( strQueryURL, NULL, 0, &m_JobInfo.postContent.at ( 0 ), m_JobInfo.postContent.size (), m_JobInfo.bPostContentBinary );
3419+
GetHTTP()->QueueFile( strQueryURL, NULL, &m_JobInfo.postContent.at ( 0 ), m_JobInfo.postContent.size (), m_JobInfo.bPostContentBinary );
34203420

34213421
return RES_OK;
34223422
}

Client/core/Serverbrowser/CServerBrowser.RemoteMasterServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void CRemoteMasterServer::Refresh ( void )
128128
m_strStage = "waitingreply";
129129
m_llLastRefreshTime = GetTickCount64_ ();
130130
AddRef(); // Keep alive
131-
GetHTTP()->QueueFile( m_strURL, NULL, 0, NULL, 0, false, this, &CRemoteMasterServer::StaticDownloadFinished, false, 1 );
131+
GetHTTP()->QueueFile( m_strURL, NULL, NULL, 0, false, this, &CRemoteMasterServer::StaticDownloadFinished, false, 1 );
132132
}
133133

134134

Client/mods/deathmatch/logic/CRemoteCalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void CRemoteCall::MakeCall()
198198
bool bAnyHost = (g_pCore->GetWebCore()->GetDomainState(g_pCore->GetWebCore()->GetDomainFromURL(m_strURL)) == eURLState::WEBPAGE_ALLOWED);
199199
EDownloadModeType downloadMode = g_pClientGame->GetRemoteCalls()->GetDownloadModeForQueueName(m_strQueueName, bAnyHost);
200200
CNetHTTPDownloadManagerInterface* pDownloadManager = g_pNet->GetHTTPDownloadManager(downloadMode);
201-
pDownloadManager->QueueFile(m_strURL, NULL, 0, m_strData.c_str(), m_strData.length(), m_bPostBinary, this, DownloadFinishedCallback, false, m_uiConnectionAttempts, m_uiConnectTimeoutMs);
201+
pDownloadManager->QueueFile(m_strURL, NULL, m_strData.c_str(), m_strData.length(), m_bPostBinary, this, DownloadFinishedCallback, false, m_uiConnectionAttempts, m_uiConnectTimeoutMs);
202202
}
203203

204204
void CRemoteCall::DownloadFinishedCallback(const SHttpDownloadResult& result)

Client/mods/deathmatch/logic/CResourceFileDownloadManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ bool CResourceFileDownloadManager::BeginResourceFileDownload( CDownloadableResou
230230

231231
SString* pstrContext = MakeDownloadContextString( pResourceFile );
232232
SString strFilename = pResourceFile->GetName();
233-
double dDownloadSize = pResourceFile->GetDownloadSize();
234-
bool bUniqueDownload = pHTTP->QueueFile( strHTTPDownloadURLFull, strFilename, dDownloadSize, NULL, 0, false, pstrContext, StaticDownloadFinished, g_pClientGame->IsLocalGame(), serverInfo.uiConnectionAttempts, serverInfo.uiConnectTimeoutMs, true );
233+
bool bUniqueDownload = pHTTP->QueueFile( strHTTPDownloadURLFull, strFilename, NULL, 0, false, pstrContext, StaticDownloadFinished, g_pClientGame->IsLocalGame(), serverInfo.uiConnectionAttempts, serverInfo.uiConnectTimeoutMs, true );
235234
if ( !bUniqueDownload )
236235
{
237236
// TODO - If piggybacking on another matching download, then adjust progress bar

Client/mods/deathmatch/logic/CSingularFileDownload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ CSingularFileDownload::CSingularFileDownload ( CResource* pResource, const char
3333
if ( !DoesClientAndServerChecksumMatch () )
3434
{
3535
CNetHTTPDownloadManagerInterface* pHTTP = g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadMode::RESOURCE_SINGULAR_FILES );
36-
pHTTP->QueueFile ( strHTTPURL.c_str(), szName, 0, NULL, 0, false, this, DownloadFinishedCallBack, false, 10, 10000, true );
36+
pHTTP->QueueFile ( strHTTPURL.c_str(), szName, NULL, 0, false, this, DownloadFinishedCallBack, false, 10, 10000, true );
3737
m_bComplete = false;
3838
g_pClientGame->SetTransferringSingularFiles ( true );
3939
}

Client/sdk/net/CNetHTTPDownloadManagerInterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class CNetHTTPDownloadManagerInterface
4444
virtual bool ProcessQueuedFiles ( void ) = 0;
4545

4646
// Queue a file to download
47-
// szPostHeaders is a new line separated list of HTTP headers. Examples at https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
48-
virtual bool QueueFile ( const char* szURL, const char* szOutputFile, double dSize = 0, const char* szPostData = NULL, unsigned int uiPostSize = 0, bool bPostBinary = false, void * objectPtr = NULL, PFN_DOWNLOAD_FINISHED_CALLBACK pfnDownloadFinishedCallback = NULL, bool bIsLocal = false, uint uiConnectionAttempts = 10, uint uiConnectTimeoutMs = 10000, bool bCheckContents = false, bool bResumeFile = false, const char* szPostHeaders = NULL ) = 0;
47+
// szRequestHeaders is a new line separated list of HTTP headers. Examples at https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
48+
virtual bool QueueFile ( const char* szURL, const char* szOutputFile, const char* szPostData = NULL, unsigned int uiPostSize = 0, bool bPostBinary = false, void * objectPtr = NULL, PFN_DOWNLOAD_FINISHED_CALLBACK pfnDownloadFinishedCallback = NULL, bool bIsLocal = false, uint uiConnectionAttempts = 10, uint uiConnectTimeoutMs = 10000, bool bCheckContents = false, bool bResumeFile = false, const char* szRequestHeaders = nullptr, const char* szRequestMethod = nullptr ) = 0;
4949

5050
// Limit number of concurrent http client connections
5151
virtual void SetMaxConnections ( int iMaxConnections ) = 0;

Client/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
#define _ASE_VERSION QUOTE_DEFINE(MTASA_VERSION_MAJOR) "." QUOTE_DEFINE(MTASA_VERSION_MINOR)
7777
#define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk)
78-
#define _CLIENT_NET_MODULE_VERSION 0x0A4 // (0x000 - 0xfff) Lvl9 wizards only
78+
#define _CLIENT_NET_MODULE_VERSION 0x0A5 // (0x000 - 0xfff) Lvl9 wizards only
7979
#define _NETCODE_VERSION 0x1DA // (0x000 - 0xfff) Increment when net messages change (pre-release)
8080
#define MTA_DM_BITSTREAM_VERSION 0x06A // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).
8181

Server/mods/deathmatch/logic/CRemoteCalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void CRemoteCall::MakeCall()
194194
{
195195
EDownloadModeType downloadMode = g_pGame->GetRemoteCalls()->GetDownloadModeForQueueName( m_strQueueName );
196196
CNetHTTPDownloadManagerInterface * downloadManager = g_pNetServer->GetHTTPDownloadManager( downloadMode );
197-
downloadManager->QueueFile ( m_strURL, NULL, 0, m_strData.c_str (), m_strData.length (), m_bPostBinary, this, DownloadFinishedCallback, false, m_uiConnectionAttempts, m_uiConnectTimeoutMs );
197+
downloadManager->QueueFile ( m_strURL, NULL, m_strData.c_str (), m_strData.length (), m_bPostBinary, this, DownloadFinishedCallback, false, m_uiConnectionAttempts, m_uiConnectTimeoutMs );
198198
}
199199

200200
void CRemoteCall::DownloadFinishedCallback(const SHttpDownloadResult& result)

0 commit comments

Comments
 (0)