jvandal / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

POST not working for daemon mode when client expects 100-continue. #121

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If using curl to submit POST data, or Opera web browser and request content was 
over 10kb, the 
client will ask that a 100-continue status response be generated by server 
before actually 
sending any data.

Problem is that if WSGI application is run in daemon mode, this situation was 
causing request 
content to be truncated and the WSGI application would see no input.

Further details in:

  http://groups.google.com/group/modwsgi/browse_frm/thread/5aa9a30a36502246

The incorrect behaviour in this case is caused by mod_wsgi code fiddling with 
temporary request 
status, setting it to 0. This was causing a test in Apache HTTP input filter to 
fail and instead of 
returning the 100-continue response header, it was pushing an EOS bucket into 
input stream.

Fix is to reset request status to HTTP_OK after handshake sequence with daemon 
process that 
determines if daemon process will be restarted.

Index: mod_wsgi.c
===========================================================
========
--- mod_wsgi.c  (revision 1140)
+++ mod_wsgi.c  (working copy)
@@ -9417,6 +9417,14 @@
         }
     }

+    /*
+     * Need to reset request status value to HTTP_OK else it
+     * screws up HTTP input filter when processing a POST
+     * request with 100-continue requirement.
+     */
+
+    r->status = HTTP_OK;
+
     /* Transfer any request content which was provided. */

     seen_eos = 0;

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 3 Jan 2009 at 10:35

GoogleCodeExporter commented 8 years ago
This has been fixed in mod_wsgi version 2.X (2.4) branch at revision r1149 and 
in mod_wsgi main development 
trunk (3.0) at revision 1151.

Original comment by Graham.Dumpleton@gmail.com on 3 Jan 2009 at 10:43

GoogleCodeExporter commented 8 years ago

Original comment by Graham.Dumpleton@gmail.com on 16 Mar 2009 at 10:38

GoogleCodeExporter commented 8 years ago
Version 2.4 of mod_wsgi now released.

Original comment by Graham.Dumpleton@gmail.com on 11 Apr 2009 at 10:25