Commit 9475baf5 authored by Ryan Bloom's avatar Ryan Bloom
Browse files

Handle the -1 case in ap_http_filter. -1 means that we have to read

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
parent 38baf0b0
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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;