-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) core: Detect incomplete body in HTTP input filter and return
+ APR_INCOMPLETE. PR 55475 [Yann Ylavic <ylavic dev gmail com>]
+
*) mod_cgid: Use the servers Timeout for each read from a CGI script,
allow override with new CGIDRequestTimeout directive. PR43494
[Eric Covener, Toshikuni Fukaya <toshikuni-fukaya cybozu co jp>]
eos = e;
break;
}
- if (AP_BUCKET_IS_ERROR(e)
- && (((ap_bucket_error *)(e->data))->status
- == HTTP_BAD_GATEWAY)) {
+ if (AP_BUCKET_IS_ERROR(e) &&
+ (((ap_bucket_error *)(e->data))->status == HTTP_BAD_GATEWAY ||
+ ((ap_bucket_error *)(e->data))->status == HTTP_GATEWAY_TIME_OUT)) {
/*
* We had a broken backend. Memorize this in the filter
* context.
return APR_EAGAIN;
}
+ if (rv == APR_EOF) {
+ return APR_INCOMPLETE;
+ }
+
if (rv != APR_SUCCESS) {
return rv;
}
apr_bucket_delete(e);
e = APR_BRIGADE_FIRST(b);
- again = 1; /* come around again */
}
+ again = 1; /* come around again */
if (ctx->state == BODY_CHUNK_TRAILER) {
ap_get_mime_headers(f->r);
return APR_EAGAIN;
}
+ if (rv == APR_EOF && ctx->state != BODY_NONE
+ && ctx->remaining > 0) {
+ return APR_INCOMPLETE;
+ }
+
if (rv != APR_SUCCESS) {
return rv;
}
if (ctx->remaining > 0) {
e = APR_BRIGADE_LAST(b);
if (APR_BUCKET_IS_EOS(e)) {
- return APR_EOF;
+ apr_bucket_delete(e);
+ return APR_INCOMPLETE;
}
}
else if (ctx->state == BODY_CHUNK_DATA) {
* Start of error handling state tree. Just one condition
* right now :)
*/
- if (((ap_bucket_error *)(e->data))->status == HTTP_BAD_GATEWAY) {
+ if (((ap_bucket_error *)(e->data))->status == HTTP_BAD_GATEWAY ||
+ ((ap_bucket_error *)(e->data))->status == HTTP_GATEWAY_TIME_OUT) {
/* stream aborted and we have not ended it yet */
r->connection->keepalive = AP_CONN_CLOSE;
}