From 7541cc30736bbf8cdacd9d317b4cff8edc17b010 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sat, 6 Oct 2001 00:47:06 +0000 Subject: [PATCH] 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 --- server/core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/core.c b/server/core.c index 10139a7721d..aa4b5a87646 100644 --- a/server/core.c +++ b/server/core.c @@ -2853,12 +2853,14 @@ 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); + e = APR_BRIGADE_FIRST(ctx->b); + if ((rv = apr_bucket_read(e, &str, &len, mode) != APR_SUCCESS)) { + return rv; + } - if (len < *readbytes) - *readbytes = len; + /* We can only return at most what the user asked for. */ + if (len < *readbytes) { + *readbytes = len; } apr_brigade_partition(ctx->b, *readbytes, &e); -- 2.47.3