You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ics.uci.edu> on 1997/11/14 00:41:38 UTC
[PATCH] protocol/1399: failing to read body
[repost, since it seems to have been missed in STATUS]
This is what I mean by adding discard_request_body(r) to die().
Can somebody test it on the user's problem?
.....Roy
Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_request.c,v
retrieving revision 1.92
diff -u -r1.92 http_request.c
--- http_request.c 1997/11/08 21:39:11 1.92
+++ http_request.c 1997/11/12 15:28:59
@@ -887,6 +887,17 @@
}
/*
+ * If we want to keep the connection, be sure that the request body
+ * (if any) has been read.
+ */
+ if ((r->status != HTTP_NOT_MODIFIED) && (r->status != HTTP_NO_CONTENT)
+ && !status_drops_connection(r->status)
+ && r->connection && (r->connection->keepalive != -1)) {
+
+ (void) discard_request_body(r);
+ }
+
+ /*
* Two types of custom redirects --- plain text, and URLs. Plain text has
* a leading '"', so the URL code, here, is triggered on its absence
*/
Re: [PATCH] protocol/1399: failing to read body
Posted by Marc Slemko <ma...@worldgate.com>.
Nyet.
if (r->read_length || is_HTTP_ERROR(r->status))
return 0;
makes should_client_block return 0 because we are returning a 401, so the
body is never read.
On Thu, 13 Nov 1997, Roy T. Fielding wrote:
> [repost, since it seems to have been missed in STATUS]
>
> This is what I mean by adding discard_request_body(r) to die().
> Can somebody test it on the user's problem?
>
> .....Roy
>
> Index: http_request.c
> ===================================================================
> RCS file: /export/home/cvs/apachen/src/main/http_request.c,v
> retrieving revision 1.92
> diff -u -r1.92 http_request.c
> --- http_request.c 1997/11/08 21:39:11 1.92
> +++ http_request.c 1997/11/12 15:28:59
> @@ -887,6 +887,17 @@
> }
>
> /*
> + * If we want to keep the connection, be sure that the request body
> + * (if any) has been read.
> + */
> + if ((r->status != HTTP_NOT_MODIFIED) && (r->status != HTTP_NO_CONTENT)
> + && !status_drops_connection(r->status)
> + && r->connection && (r->connection->keepalive != -1)) {
> +
> + (void) discard_request_body(r);
> + }
> +
> + /*
> * Two types of custom redirects --- plain text, and URLs. Plain text has
> * a leading '"', so the URL code, here, is triggered on its absence
> */
>