]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
Fix compilation with MinGW -std=c++11 option.
[wxWidgets.git] / src / common / http.cpp
index f041115be962b2399dc08e69636c1043b72bd2b2..556618aca517d6c48253be620a457cbb19c6cea5 100644 (file)
@@ -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(); }