You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Joe Orton <je...@york.ac.uk> on 1999/05/29 17:02:29 UTC

100-continue support

I couldn't get Expect: 100-continue support to work properly in 1.3.6:

If I send:

PUT /foobar HTTP/1.1
Host: localhost
Content-Length: 5
Expect: 100-continue

then Apache waits for the body, then gives a 405. HTTP/1.1 draft-06
says it shouldn't wait, just send the 405 straight away.

I poked around a bit, but don't really understand how
ap_discard_request_body is supposed to work in this case. Changing it
to do:
 
   if( r->expecting_100 )
      return OK;

before anything else makes it works properly, I think (patch attached).

Regards,

joe

-- 
Joe Orton
jeo101@york.ac.uk ... joe@orton.demon.co.uk
http://www.orton.demon.co.uk/

--- http_protocol.c~	Wed Mar 10 17:42:42 1999
+++ http_protocol.c	Sat May 29 14:49:09 1999
@@ -1858,13 +1858,13 @@
 {
     int rv;
 
+    /* If the client is waiting for 100 Continue, don't send it,
+     * and the body is never sent, hence is discarded. */
+    if (r->expecting_100)
+        return OK;
+
     if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_PASS)))
         return rv;
-
-    /* If we are discarding the request body, then we must already know
-     * the final status code, therefore disable the sending of 100 continue.
-     */
-    r->expecting_100 = 0;
 
     if (ap_should_client_block(r)) {
         char dumpbuf[HUGE_STRING_LEN];