Check wxWebSessionCURL::StartRequest really starts

This commit is contained in:
New Pagodi
2021-02-07 20:48:12 -06:00
parent 48cba4f88e
commit b0b53e8db3

View File

@@ -999,15 +999,23 @@ bool wxWebSessionCURL::StartRequest(wxWebRequestCURL & request)
{
// Add request easy handle to multi handle
CURL* curl = request.GetHandle();
curl_multi_add_handle(m_handle, curl);
int code = curl_multi_add_handle(m_handle, curl);
request.SetState(wxWebRequest::State_Active);
if ( code == CURLM_OK )
{
request.SetState(wxWebRequest::State_Active);
// Report a timeout to curl to initiate this transfer.
int runningHandles;
curl_multi_socket_action(m_handle, CURL_SOCKET_TIMEOUT, 0, &runningHandles);
// Report a timeout to curl to initiate this transfer.
int runningHandles;
curl_multi_socket_action(m_handle, CURL_SOCKET_TIMEOUT, 0,
&runningHandles);
return true;
return true;
}
else
{
return false;
}
}
void wxWebSessionCURL::CancelRequest(wxWebRequestCURL* request)