]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxSOCKET_WAITALL in wxHTTP to ensure that all data is sent.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 30 Aug 2012 20:22:40 +0000 (20:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 30 Aug 2012 20:22:40 +0000 (20:22 +0000)
POST-ing sufficiently big amounts of data in wxHTTP didn't work because it
couldn't be sent all at once to the server. Use wxSOCKET_WAITALL to ensure
that we do send all of the data.

Closes #14598.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/http.cpp

index 3d6053886ddd1ccff9b7af4524fcd9cc5ae892d0..44482c80e6f16c33fdfa1024ad6746eb968a89e8 100644 (file)
@@ -531,6 +531,7 @@ All:
 
 - Add wxDir::Close() method (Silverstorm82).
 - Fix compilation of wxHash{Map,Set} with g++ 4.7 (Nathan Ridge).
+- Fix posting large amounts of data in wxHTTP (Platonides).
 - Added Nepali translation (Him Prasad Gautam).
 
 All (GUI):
index f041115be962b2399dc08e69636c1043b72bd2b2..f70b6fe9da41c3e874985d8e8315e1039c08fa61 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;