]> granicus.if.org Git - apache/commitdiff
Stopped the HTTP proxy from trying to read entity bodies when there
authorGraham Leggett <minfrin@apache.org>
Tue, 24 Apr 2001 08:38:43 +0000 (08:38 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 24 Apr 2001 08:38:43 +0000 (08:38 +0000)
wasn't one (response was 1xx, 204, 205 or 304).
PR:
Obtained from:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88928 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_http.c

index 988133f8b3c1f95183fb8a5de0c4e872ad92e000..f6d3213a288eeacf208b8ce5a063ff5bd7e1110a 100644 (file)
@@ -741,8 +741,13 @@ PROXY_DECLARE (int) ap_proxy_http_handler(request_rec *r, proxy_server_conf *con
         APR_BRIGADE_INSERT_TAIL(bb, e);
     }
 
-    /* send body */
-    if (!r->header_only) {
+    /* send body - but only if a body is expected */
+    if ((!r->header_only) &&                   /* not HEAD request */
+        (r->status > 199) &&                   /* not any 1xx response */
+        (r->status != HTTP_NO_CONTENT) &&      /* not 204 */
+        (r->status != HTTP_RESET_CONTENT) &&   /* not 205 */
+        (r->status != HTTP_NOT_MODIFIED)) {    /* not 304 */
+
        const char *buf;
        apr_size_t readbytes;