Fix end state of cancelled requests in Mac implementation

Don't set the state to State_Failed if the request was cancelled.
This commit is contained in:
Vadim Zeitlin
2021-01-15 00:53:21 +01:00
parent 70e7861a7d
commit 4e1bece87e

View File

@@ -84,7 +84,10 @@
wxLogTrace(wxTRACE_WEBREQUEST, "Request %p: didCompleteWithError, error=%s",
request, wxCFStringRefFromGet([error description]).AsString());
request->SetState(wxWebRequest::State_Failed, wxCFStringRefFromGet(error.localizedDescription).AsString());
if ( error.code == NSURLErrorCancelled )
request->SetState(wxWebRequest::State_Cancelled);
else
request->SetState(wxWebRequest::State_Failed, wxCFStringRefFromGet(error.localizedDescription).AsString());
}
else
{