ASF Bugzilla – Attachment 30850 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 (2.4.x)
2.4.x-http_filter_incomplete.patch (text/plain), 3.00 KB, created by
Yann Ylavic
on 2013-09-16 13:09:13 UTC
(
hide
)
Description:
Detect incomplete body in HTTP input filter and return APR_ECONNABORTED (2.4.x)
Filename:
MIME Type:
Creator:
Yann Ylavic
Created:
2013-09-16 13:09:13 UTC
Size:
3.00 KB
patch
obsolete
>Index: modules/http/http_filters.c >=================================================================== >--- modules/http/http_filters.c (revision 1523611) >+++ modules/http/http_filters.c (working copy) >@@ -87,6 +87,23 @@ static apr_status_t bail_out_on_error(http_ctx_t * > apr_bucket_brigade *bb = ctx->bb; > > apr_brigade_cleanup(bb); >+ >+ if (f->r->proxyreq == PROXYREQ_RESPONSE) { >+ switch (http_error) { >+ case HTTP_REQUEST_TIME_OUT: >+ return APR_ECONNABORTED; >+ >+ case HTTP_REQUEST_ENTITY_TOO_LARGE: >+ return APR_ENOSPC; >+ >+ case HTTP_NOT_IMPLEMENTED: >+ return APR_ENOTIMPL; >+ >+ default: >+ return APR_EGENERAL; >+ } >+ } >+ > e = ap_bucket_error_create(http_error, > NULL, f->r->pool, > f->c->bucket_alloc); >@@ -396,7 +413,7 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > (ctx->remaining < 0) ? "(overflow)" : ""); > ctx->remaining = 0; /* Reset it in case we have to > * come back here later */ >- if (APR_STATUS_IS_TIMEUP(rv)) { >+ if (rv != APR_SUCCESS) { > http_error = HTTP_REQUEST_TIME_OUT; > } > return bail_out_on_error(ctx, f, http_error); >@@ -447,6 +464,9 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > return APR_EAGAIN; > } > /* If we get an error, then leave */ >+ if (rv == APR_EOF) { >+ return APR_ECONNABORTED; >+ } > if (rv != APR_SUCCESS) { > return rv; > } >@@ -502,7 +522,7 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > (ctx->remaining < 0) ? "(overflow)" : ""); > ctx->remaining = 0; /* Reset it in case we have to > * come back here later */ >- if (APR_STATUS_IS_TIMEUP(rv)) { >+ if (rv != APR_SUCCESS) { > http_error = HTTP_REQUEST_TIME_OUT; > } > return bail_out_on_error(ctx, f, http_error); >@@ -532,6 +552,10 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > > rv = ap_get_brigade(f->next, b, mode, block, readbytes); > >+ if (rv == APR_EOF && ctx->state != BODY_NONE && >+ ctx->remaining > 0) { >+ return APR_ECONNABORTED; >+ } > if (rv != APR_SUCCESS) { > return rv; > } >@@ -547,8 +571,10 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bu > ctx->remaining -= totalread; > if (ctx->remaining > 0) { > e = APR_BRIGADE_LAST(b); >- if (APR_BUCKET_IS_EOS(e)) >- return APR_EOF; >+ if (APR_BUCKET_IS_EOS(e)) { >+ apr_bucket_delete(e); >+ return APR_ECONNABORTED; >+ } > } > } >
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