Skip to content

Commit

Permalink
Improved client fetchRemote reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Dec 12, 2017
1 parent 7d5d6f2 commit 5489947
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Client/mods/deathmatch/logic/CRemoteCalls.cpp
Expand Up @@ -215,8 +215,12 @@ CRemoteCall::~CRemoteCall ()

void CRemoteCall::MakeCall()
{
// GetDomainFromURL requires protocol://, but curl does not (defaults to http)
SString strDomain = g_pCore->GetWebCore()->GetDomainFromURL(m_strURL);
if (strDomain.empty())
strDomain = g_pCore->GetWebCore()->GetDomainFromURL("http://" + m_strURL);
// Bypass net module IP check if we are allowed to access the URL
bool bAnyHost = (g_pCore->GetWebCore()->GetDomainState(g_pCore->GetWebCore()->GetDomainFromURL(m_strURL)) == eURLState::WEBPAGE_ALLOWED);
bool bAnyHost = (g_pCore->GetWebCore()->GetDomainState(strDomain) == eURLState::WEBPAGE_ALLOWED);
EDownloadModeType downloadMode = g_pClientGame->GetRemoteCalls()->GetDownloadModeForQueueName(m_strQueueName, bAnyHost);
CNetHTTPDownloadManagerInterface* pDownloadManager = g_pNet->GetHTTPDownloadManager(downloadMode);
pDownloadManager->QueueFile(m_strURL, NULL, this, DownloadFinishedCallback, false, m_options, false, false);
Expand Down

0 comments on commit 5489947

Please sign in to comment.