ASF Bugzilla – Attachment 35129 Details for
Bug 61284
proxy_wstunnel can't send BAD_GATEWAY after removing HTTP filters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Restore output filters before sending an error response (2.4.x)
httpd-2.4.x-wstunnel-server_error.patch (text/plain), 2.01 KB, created by
Yann Ylavic
on 2017-07-13 19:56:47 UTC
(
hide
)
Description:
Restore output filters before sending an error response (2.4.x)
Filename:
MIME Type:
Creator:
Yann Ylavic
Created:
2017-07-13 19:56:47 UTC
Size:
2.01 KB
patch
obsolete
>Index: modules/proxy/mod_proxy_wstunnel.c >=================================================================== >--- modules/proxy/mod_proxy_wstunnel.c (revision 1801866) >+++ modules/proxy/mod_proxy_wstunnel.c (working copy) >@@ -117,6 +117,8 @@ static int proxy_wstunnel_request(apr_pool_t *p, r > apr_socket_t *client_socket = ap_get_conn_socket(c); > int done = 0, replied = 0; > const char *upgrade_method = *worker->s->upgrade ? worker->s->upgrade : "WebSocket"; >+ ap_filter_t *saved_output_filters, *saved_proto_output_filters; >+ int status = OK; > > header_brigade = apr_brigade_create(p, backconn->bucket_alloc); > >@@ -169,6 +171,8 @@ static int proxy_wstunnel_request(apr_pool_t *p, r > pollfd.desc.s = client_socket; > apr_pollset_add(pollset, &pollfd); > >+ saved_output_filters = r->output_filters; >+ saved_proto_output_filters = r->proto_output_filters; > ap_remove_input_filter_byhandle(c->input_filters, "reqtimeout"); > > r->output_filters = c->output_filters; >@@ -187,7 +191,13 @@ static int proxy_wstunnel_request(apr_pool_t *p, r > continue; > } > ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(02444) "error apr_poll()"); >- return HTTP_INTERNAL_SERVER_ERROR; >+ if (!replied) { >+ status = HTTP_INTERNAL_SERVER_ERROR; >+ } >+ else { >+ status = DONE; >+ } >+ break; > } > ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(02445) > "woke from poll(), i=%d", pollcnt); >@@ -260,13 +270,13 @@ static int proxy_wstunnel_request(apr_pool_t *p, r > "finished with poll() - cleaning up"); > > if (!replied) { >- return HTTP_BAD_GATEWAY; >+ r->output_filters = saved_output_filters; >+ r->proto_output_filters = saved_proto_output_filters; >+ if (status == OK) { >+ status = HTTP_BAD_GATEWAY; >+ } > } >- else { >- return OK; >- } >- >- return OK; >+ return status; > } > > /*
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 61284
: 35129 |
35130
|
35131