X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c84ef5b9f71ea2a62daa6d70840a8d654fc0103d..1d40540f065ef2e83dacd2892d518cf7f46cd2c5:/src/common/http.cpp diff --git a/src/common/http.cpp b/src/common/http.cpp index f041115be9..556618aca5 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -388,8 +388,11 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) SaveState(); // we may use non blocking sockets only if we can dispatch events from them - SetFlags( wxIsMainThread() && wxApp::IsMainLoopRunning() ? wxSOCKET_NONE - : wxSOCKET_BLOCK ); + int flags = wxIsMainThread() && wxApp::IsMainLoopRunning() ? wxSOCKET_NONE + : wxSOCKET_BLOCK; + // and we must use wxSOCKET_WAITALL to ensure that all data is sent + flags |= wxSOCKET_WAITALL; + SetFlags(flags); Notify(false); wxString buf; @@ -474,7 +477,13 @@ public: size_t m_httpsize; unsigned long m_read_bytes; - wxHTTPStream(wxHTTP *http) : wxSocketInputStream(*http), m_http(http) {} + wxHTTPStream(wxHTTP *http) : wxSocketInputStream(*http) + { + m_http = http; + m_httpsize = 0; + m_read_bytes = 0; + } + size_t GetSize() const { return m_httpsize; } virtual ~wxHTTPStream(void) { m_http->Abort(); }