]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
We can't pass in &r->remaining because we change that value on output to
authorJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 11 Oct 2001 01:40:32 +0000 (01:40 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 11 Oct 2001 01:40:32 +0000 (01:40 +0000)
be how many bytes we read.  This trounces on the r->remaining value, so
we must use a local variable and subtract that from r->remaining after we
read.
Reviewed by: Aaron Bannert

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

modules/http/http_protocol.c

index 0cce7655384dc14a2fa4fee520ea64ad021e6436..efdf838fc28eb6df522b7e85732cf26e25156238 100644 (file)
@@ -1366,8 +1366,9 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, apr_size_t bu
 
     do {
         if (APR_BRIGADE_EMPTY(bb)) {
+            len_read = r->remaining;
             if (ap_get_brigade(r->input_filters, bb, AP_MODE_BLOCKING,
-                               &r->remaining) != APR_SUCCESS) {
+                               &len_read) != APR_SUCCESS) {
                 /* if we actually fail here, we want to just return and
                  * stop trying to read data from the client.
                  */
@@ -1375,6 +1376,7 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, apr_size_t bu
                 apr_brigade_destroy(bb);
                 return -1;
             }
+            r->remaining -= len_read;
         }
     } while (APR_BRIGADE_EMPTY(bb));