Commit f7148b07 authored by Justin Erenkrantz's avatar Justin Erenkrantz
Browse files

We should only be doing one socket read under any circumstances

(blocking or not).

apr_brigade_partition would do reading multiple times and that's
not really what we want (so I think).

This may speed up POST requests that were waiting for all of the
data to arrive before returning anything in blocking mode.

Reviewed by:	Greg Stein, Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91322 13f79535-47bb-0310-9956-ffa450edef68
parent 0364363a
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -2853,11 +2853,13 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mod
        apr_bucket *e;
        apr_bucket_brigade *newbb;

        if (mode == APR_NONBLOCK_READ) {
        e = APR_BRIGADE_FIRST(ctx->b);
            rv = apr_bucket_read(e, &str, &len, mode);
        if ((rv = apr_bucket_read(e, &str, &len, mode) != APR_SUCCESS)) {
            return rv;
        }

            if (len < *readbytes)
        /* We can only return at most what the user asked for. */
        if (len < *readbytes) {
            *readbytes = len;
        }