diff options
author | Aaron Bannert <aaron@apache.org> | 2001-10-16 03:04:08 +0200 |
---|---|---|
committer | Aaron Bannert <aaron@apache.org> | 2001-10-16 03:04:08 +0200 |
commit | bb447fc0c516e4bb27261931f388b6cc39c9cb6b (patch) | |
tree | 598a78f5aa461b503460fc3fa2001b3b85ee60e7 /modules | |
parent | disabling mod_example ap_hook_{http_method,default_port} (diff) | |
download | apache2-bb447fc0c516e4bb27261931f388b6cc39c9cb6b.tar.xz apache2-bb447fc0c516e4bb27261931f388b6cc39c9cb6b.zip |
Cautiously avoiding the scoping issue that was discussed on the list,
I thought these other changes needed to go in; Namely that we don't
need to check if the brigade is empty twice in the loop, just once.
Added a comment for good measure.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91478 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/http/http_protocol.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index cf1ab764b6..cb088e5b65 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1370,22 +1370,21 @@ AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, apr_size_t bu &core_module); apr_bucket_brigade *bb = req_cfg->bb; - do { + /* read until we get a non-empty brigade */ + while (APR_BRIGADE_EMPTY(bb)) { apr_off_t len_read; - if (APR_BRIGADE_EMPTY(bb)) { - len_read = r->remaining; - if (ap_get_brigade(r->input_filters, bb, AP_MODE_BLOCKING, - &len_read) != APR_SUCCESS) { - /* if we actually fail here, we want to just return and - * stop trying to read data from the client. - */ - r->connection->keepalive = -1; - apr_brigade_destroy(bb); - return -1; - } - r->remaining -= len_read; + len_read = r->remaining; + if (ap_get_brigade(r->input_filters, bb, AP_MODE_BLOCKING, + &len_read) != APR_SUCCESS) { + /* if we actually fail here, we want to just return and + * stop trying to read data from the client. + */ + r->connection->keepalive = -1; + apr_brigade_destroy(bb); + return -1; } - } while (APR_BRIGADE_EMPTY(bb)); + r->remaining -= len_read; + } b = APR_BRIGADE_FIRST(bb); if (APR_BUCKET_IS_EOS(b)) { /* reached eos on previous invocation */ |