-*- coding: utf-8 -*-
Changes with Apache 2.2.7
+ *) core: Fix broken chunk filtering that causes all non blocking reads to be
+ converted into blocking reads. PR 19954, 41056.
+ [Jean-Frederic Clere, Jim Jagielski]
+
*) mod_rewrite: Add the novary flag to RewriteCond.
- [Ruediger Pluem]
+ [Ruediger Pluem]
*) core: Change etag generation to produce identical results on
32-bit and 64-bit platforms. PR 40064. [Joe Orton]
(NWGNUsubstitute need also be copied over from trunk, is missing in your patch)
+1: jim, rpluem, fuankg
- * core: Fix broken chunk filtering that causes all non blocking reads to be
- converted into blocking reads
- PR 19954 / 41056
- Trunk version of patch:
- http://svn.apache.org/viewcvs.cgi?rev=480135&view=rev
- http://svn.apache.org/viewcvs.cgi?rev=480193&view=rev
- http://svn.apache.org/viewcvs.cgi?rev=504559&view=rev
- http://svn.apache.org/viewcvs.cgi?rev=602349&view=rev
- http://svn.apache.org/viewcvs.cgi?rev=503863&view=rev (CHANGES)
- http://svn.apache.org/viewcvs.cgi?rev=602657&view=rev (style chg)
- Backport version for 2.2.x of patch:
- Trunk version of patch works
- +1: rpluem, jim, jerenkrantz
- jerenkrantz says: Feel free to apply with or withour r602657. =)
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
enum {
BODY_NONE,
BODY_LENGTH,
- BODY_CHUNK
+ BODY_CHUNK,
+ BODY_CHUNK_PART
} state;
int eos_sent;
} http_ctx_t;
bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
- APR_BLOCK_READ, 0);
+ block, 0);
+
+ /* for timeout */
+ if (block == APR_NONBLOCK_READ &&
+ ( (rv == APR_SUCCESS && APR_BRIGADE_EMPTY(bb)) ||
+ (APR_STATUS_IS_EAGAIN(rv)) )) {
+ ctx->state = BODY_CHUNK_PART;
+ return APR_EAGAIN;
+ }
if (rv == APR_SUCCESS) {
/* We have to check the length of the brigade we got back.
ctx->eos_sent = 1;
return APR_SUCCESS;
case BODY_CHUNK:
+ case BODY_CHUNK_PART:
{
char line[30];
apr_bucket_brigade *bb;
bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
/* We need to read the CRLF after the chunk. */
- rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
- APR_BLOCK_READ, 0);
- apr_brigade_cleanup(bb);
+ if (ctx->state == BODY_CHUNK) {
+ rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
+ block, 0);
+ apr_brigade_cleanup(bb);
+ if (block == APR_NONBLOCK_READ &&
+ (APR_STATUS_IS_EAGAIN(rv))) {
+ return APR_EAGAIN;
+ }
+ } else {
+ rv = APR_SUCCESS;
+ }
if (rv == APR_SUCCESS) {
/* Read the real chunk line. */
rv = ap_get_brigade(f->next, bb, AP_MODE_GETLINE,
- APR_BLOCK_READ, 0);
+ block, 0);
+ /* Test timeout */
+ if (block == APR_NONBLOCK_READ &&
+ ( (rv == APR_SUCCESS && APR_BRIGADE_EMPTY(bb)) ||
+ (APR_STATUS_IS_EAGAIN(rv)) )) {
+ ctx->state = BODY_CHUNK_PART;
+ return APR_EAGAIN;
+ }
+ ctx->state = BODY_CHUNK;
if (rv == APR_SUCCESS) {
rv = apr_brigade_flatten(bb, line, &len);
if (rv == APR_SUCCESS) {