]> granicus.if.org Git - apache/commitdiff
Handle the -1 case in ap_http_filter. -1 means that we have to read
authorRyan Bloom <rbb@apache.org>
Thu, 9 Aug 2001 04:21:26 +0000 (04:21 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 9 Aug 2001 04:21:26 +0000 (04:21 +0000)
all data from the socket until the socket is closed.  This has been
used to proxy www.google.com successfully, but it doesn't return anything
when used with www.yahoo.com.  Still debugging that problem.

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

modules/http/http_protocol.c

index 2f9fbd394e348ca98c2867dfd7122114887f56c5..59782cbed48490eda74d034cbcacd66e33f61500 100644 (file)
@@ -646,6 +646,20 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode
         }
     }
 
+    if (*readbytes == -1) {
+        apr_bucket *e;
+        apr_off_t total;
+        APR_BRIGADE_FOREACH(e, ctx->b) {
+            const char *str;
+            apr_size_t len;
+            apr_bucket_read(e, &str, &len, APR_BLOCK_READ);
+        }
+        apr_brigade_length(b, 1, &total);
+        *readbytes = total;
+        e = apr_bucket_eos_create();
+        APR_BRIGADE_INSERT_TAIL(b, e);
+        return APR_SUCCESS;
+    }
     /* readbytes == 0 is "read a single line". otherwise, read a block. */
     if (*readbytes) {
         apr_off_t total;