Skip to content

Commit

Permalink
Keep mod_req clear. Simply scan thru input filters and
Browse files Browse the repository at this point in the history
remove it within the ws submodule. Nasty, but it keeps
mod_req untouched (for now ;) )

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1458447 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jimjag committed Mar 19, 2013
1 parent fec376f commit ac78744
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
11 changes: 0 additions & 11 deletions modules/filters/mod_reqtimeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,6 @@ static apr_status_t reqtimeout_filter(ap_filter_t *f,
apr_interval_time_t saved_sock_timeout = UNSET;
reqtimeout_con_cfg *ccfg = f->ctx;

/* connections can remove the filter even if configured */
if (apr_table_get(f->c->notes, "remove-reqtimeout")) {
ap_remove_input_filter(f);
return ap_get_brigade(f->next, bb, mode, block, readbytes);
}

/* connections can bypass the filter even if configured */
if (apr_table_get(f->c->notes, "bypass-reqtimeout")) {
return ap_get_brigade(f->next, bb, mode, block, readbytes);
}

if (ccfg->in_keep_alive) {
/* For this read, the normal keep-alive timeout must be used */
ccfg->in_keep_alive = 0;
Expand Down
27 changes: 25 additions & 2 deletions modules/proxy/mod_proxy_wstunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,29 @@ static int proxy_wstunnel_transfer(request_rec *r, conn_rec *c_i, conn_rec *c_o,
return rv;
}

/* Search thru the input filters and remove the reqtimeout one */
static void remove_reqtimeout(ap_filter_t *next)
{
ap_filter_t *reqto = NULL;
ap_filter_rec_t *filter;

filter = ap_get_input_filter_handle("reqtimeout");
if (!filter) {
return;
}

while (next) {
if (next->frec == filter) {
reqto = next;
break;
}
next = next->next;
}
if (reqto) {
ap_remove_input_filter(reqto);
}
}

/*
* process the request and write the response.
*/
Expand Down Expand Up @@ -166,8 +189,6 @@ static int ap_proxy_wstunnel_request(apr_pool_t *p, request_rec *r,

header_brigade = apr_brigade_create(p, backconn->bucket_alloc);

apr_table_setn(c->notes, "bypass-reqtimeout", "1");

ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "sending request");

rv = ap_proxy_create_hdrbrgd(p, header_brigade, r, conn,
Expand Down Expand Up @@ -217,6 +238,8 @@ static int ap_proxy_wstunnel_request(apr_pool_t *p, request_rec *r,
r->input_filters = c->input_filters;
r->proto_input_filters = c->input_filters;

remove_reqtimeout(r->input_filters);

while (1) { /* Infinite loop until error (one side closes the connection) */
if ((rv = apr_pollset_poll(pollset, -1, &pollcnt, &signalled))
!= APR_SUCCESS) {
Expand Down

0 comments on commit ac78744

Please sign in to comment.