Whenever wxWebRequestSync::Execute is called, if the data storage is set to be a file, the file is buffered, and the writes are never flushed before control goes back to the application, leading to getting (potentially) incomplete data when then reading the file.
The file is flushed and its whole contents appear when reading.
Reading through WinHTTP, cURL, and URLSession backends, it doesn't seem like any of them handle this properly. Afaics they should call m_response->Finalize() like wxWebRequestImpl::SetState() (and from wxWebRequestImpl::HandleResult()) does whenever the state is one of the three "end" states. (State_Completed, State_Failed, and State_Cancelled).
Finalize() is private to the wxWebResponseImpl though...
It seems correct that none of these implementations call SetState(), as it handles things for async mode (notably ProcessStateEvent() deleting the file, assuming the event handler used it if it wanted).
It seems Finalize() should just be made public (rather than private and marking wxWebRequestImpl a friend), and called by each of these implementations' Execute().
I'm happy to submit a PR if that sounds reasonable, but I wanted to get check first.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()