Skip to content

Commit f4bf57d

Browse files
committed
HTTPmanager cleanup
1 parent b0c42f4 commit f4bf57d

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

  • GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP

‎GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPManager.cpp‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,20 @@ void HTTPManager::Tick()
7979
int msgq = 0;
8080
CURLMsg* m = curl_multi_info_read(m_pCurl, &msgq);
8181
std::vector<HTTPRequest*> vecItemsToRemove = std::vector<HTTPRequest*>();
82-
if (m && (m->msg == CURLMSG_DONE))
82+
if (m != nullptr && m->msg == CURLMSG_DONE)
8383
{
84-
CURL* e = m->easy_handle;
84+
CURL* pCurlHandle = m->easy_handle;
8585

86-
// find the associated request
87-
for (HTTPRequest* pRequest : m_vecRequestsInFlight)
86+
if (pCurlHandle != nullptr)
8887
{
89-
HTTPRequest* pPlatformRequest = static_cast<HTTPRequest*>(pRequest);
90-
if (pPlatformRequest->EasyHandleMatches(e))
88+
// find the associated request
89+
for (HTTPRequest* pRequest : m_vecRequestsInFlight)
9190
{
92-
pPlatformRequest->Threaded_SetComplete(m->data.result);
93-
vecItemsToRemove.push_back(pRequest);
91+
if (pRequest->EasyHandleMatches(pCurlHandle))
92+
{
93+
pRequest->Threaded_SetComplete(m->data.result);
94+
vecItemsToRemove.push_back(pRequest);
95+
}
9496
}
9597
}
9698
}

0 commit comments

Comments
 (0)