--- modules/http/http_filters.c (revision 1522486) +++ modules/http/http_filters.c (working copy) @@ -353,6 +353,9 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu } if (rv != APR_SUCCESS) { + if (rv == APR_EOF) { + return APR_INCOMPLETE; + } return rv; } @@ -410,6 +413,10 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu } if (rv != APR_SUCCESS) { + if (rv == APR_EOF && ctx->remaining > 0 && + ctx->state != BODY_NONE) { + return APR_INCOMPLETE; + } return rv; } @@ -474,6 +481,9 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu } if (rv != APR_SUCCESS) { + if (rv == APR_EOF) { + return APR_INCOMPLETE; + } return rv; } --- modules/http/chunk_filter.c (revision 1522486) +++ modules/http/chunk_filter.c (working copy) @@ -72,15 +72,17 @@ apr_status_t ap_http_chunk_filter(ap_filter_t *f, eos = e; break; } - if (AP_BUCKET_IS_ERROR(e) - && (((ap_bucket_error *)(e->data))->status - == HTTP_BAD_GATEWAY)) { - /* - * We had a broken backend. Memorize this in the filter - * context. - */ - f->ctx = &bad_gateway_seen; - continue; + if (AP_BUCKET_IS_ERROR(e)) { + switch (((ap_bucket_error *)(e->data))->status) { + case HTTP_BAD_GATEWAY: + case HTTP_GATEWAY_TIME_OUT: + /* + * We had a broken backend. Memorize this in the filter + * context. + */ + f->ctx = &bad_gateway_seen; + continue; + } } if (APR_BUCKET_IS_FLUSH(e)) { flush = e;