ASF Bugzilla – Attachment 30858 Details for
Bug 55475
mod_proxy breaks HTTP chunked transfer coding
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Detect incomplete body in HTTP input filter and return APR_ECONNABORTED (trunk)
trunk-http_filter_incomplete.patch (text/plain), 3.52 KB, created by
Yann Ylavic
on 2013-09-18 11:26:51 UTC
(
hide
)
Description:
Detect incomplete body in HTTP input filter and return APR_ECONNABORTED (trunk)
Filename:
MIME Type:
Creator:
Yann Ylavic
Created:
2013-09-18 11:26:51 UTC
Size:
3.52 KB
patch
obsolete
>Index: modules/http/http_filters.c >=================================================================== >--- modules/http/http_filters.c (revision 1524321) >+++ modules/http/http_filters.c (working copy) >@@ -352,6 +352,10 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > return APR_EAGAIN; > } > >+ if (rv == APR_EOF) { >+ return APR_ECONNABORTED; >+ } >+ > if (rv != APR_SUCCESS) { > return rv; > } >@@ -377,8 +381,8 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > > 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); >@@ -409,6 +413,11 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > return APR_EAGAIN; > } > >+ if (rv == APR_EOF && ctx->state != BODY_NONE >+ && ctx->remaining > 0) { >+ return APR_ECONNABORTED; >+ } >+ > if (rv != APR_SUCCESS) { > return rv; > } >@@ -425,7 +434,8 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > if (ctx->remaining > 0) { > e = APR_BRIGADE_LAST(b); > if (APR_BUCKET_IS_EOS(e)) { >- return APR_EOF; >+ apr_bucket_delete(e); >+ return APR_ECONNABORTED; > } > } > else if (ctx->state == BODY_CHUNK_DATA) { >@@ -1610,9 +1620,12 @@ apr_status_t ap_http_outerror_filter(ap_filter_t * > * Start of error handling state tree. Just one condition > * right now :) > */ >- if (((ap_bucket_error *)(e->data))->status == HTTP_BAD_GATEWAY) { >+ switch (((ap_bucket_error *)(e->data))->status) { >+ case HTTP_BAD_GATEWAY: >+ case HTTP_GATEWAY_TIME_OUT: > /* stream aborted and we have not ended it yet */ > r->connection->keepalive = AP_CONN_CLOSE; >+ break; > } > continue; > } >Index: modules/http/chunk_filter.c >=================================================================== >--- modules/http/chunk_filter.c (revision 1524321) >+++ 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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55475
:
30757
|
30830
|
30831
|
30832
|
30837
|
30839
|
30846
|
30847
|
30848
|
30849
|
30850
|
30852
|
30853
|
30855
|
30856
|
30857
| 30858 |
30893