* Fix EOS handling in ap_get_client_block.
Submitted by: jerenkrantz
Reviewed by: trawick, fielding
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@101265
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.48
+ *) Modify ap_get_client_block() to note if it has seen EOS.
+ [Justin Erenkrantz]
+
*) Fix a bug, where mod_deflate sometimes unconditionally compressed the
content if the Accept-Encoding header contained only other tokens than
"gzip" (such as "deflate"). PR 21523. [Joe Orton, André Malo]
APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2003/09/17 10:39:43 $]
+Last modified at [$Date: 2003/09/17 10:47:38 $]
Release:
modules/ssl/ssl_engine_io.c r1.111
+1: jorton
- * Fix EOS handling in ap_get_client_block.
- modules/http/http_protocol.c: r1.471
- See Message-ID: <3EC0B430.4010008@stason.org>
- +1: jerenkrantz, trawick, fielding
-
CURRENT RELEASE NOTES:
* Backwards compatibility is expected of future Apache 2.0 releases,
apr_status_t rv;
apr_bucket_brigade *bb;
+ if (r->remaining < 0 || (!r->read_chunked && r->remaining == 0)) {
+ return 0;
+ }
+
bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
if (bb == NULL) {
r->connection->keepalive = AP_CONN_CLOSE;
* returning data when requested.
*/
AP_DEBUG_ASSERT(!APR_BRIGADE_EMPTY(bb));
-
+
+ /* Check to see if EOS in the brigade.
+ *
+ * If so, we have to leave a nugget for the *next* ap_get_client_block
+ * call to return 0.
+ */
+ if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
+ if (r->read_chunked) {
+ r->remaining = -1;
+ }
+ else {
+ r->remaining = 0;
+ }
+ }
+
rv = apr_brigade_flatten(bb, buffer, &bufsiz);
if (rv != APR_SUCCESS) {
apr_brigade_destroy(bb);