Ensure wxWebRequest is in idle state before starting it

Check that current state is State_Idle in wxWebRequest itself only once
instead of doing it in 2 (out of 3) wxWebRequestImpl implementations.

Also assert if this is not the case instead of silently doing nothing
which would surely be more difficult to debug.
This commit is contained in:
Vadim Zeitlin
2021-01-09 21:00:38 +01:00
parent af13bdde80
commit 5d236edeed
5 changed files with 7 additions and 6 deletions

View File

@@ -237,9 +237,6 @@ void wxWebRequestWinHTTP::SetFailed(DWORD errorCode)
void wxWebRequestWinHTTP::Start()
{
if ( GetState() != wxWebRequest::State_Idle ) // Completed requests can not be restarted
return;
// Parse the URL
wxURI uri(m_url);
bool isSecure = uri.GetScheme().IsSameAs("HTTPS", false);