From a52f353321110c798b0f5016e497201a2074c9a0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 16 Jan 2021 14:40:08 +0100 Subject: [PATCH] Set state to Active slightly earlier in wxWebRequestWinHTTP This is more consistent with the other backends, which all change the state before actually launching the asynchronous request. --- src/msw/webrequest_winhttp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index 65c3a5ef18..2a46cdf2d4 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -381,6 +381,8 @@ void wxWebRequestWinHTTP::SendRequest() if ( m_dataSize ) m_dataWritten = 0; + SetState(wxWebRequest::State_Active); + // Send request if ( !::WinHttpSendRequest ( @@ -394,8 +396,6 @@ void wxWebRequestWinHTTP::SendRequest() SetFailedWithLastError(); return; } - - SetState(wxWebRequest::State_Active); } void wxWebRequestWinHTTP::DoCancel()