httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r921378 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_reqtimeout.c
Date Fri, 12 Mar 2010 05:57:08 GMT
On 10.03.2010 16:00, sf@apache.org wrote:
> Author: sf
> Date: Wed Mar 10 15:00:50 2010
> New Revision: 921378
> 
> URL: http://svn.apache.org/viewvc?rev=921378&view=rev
> Log:
> Move initialization to process_connection hook, right before
> ap_process_http_request.  This ensures that we are not inserted for other
> protocol handlers (like mod_ftp) and mod_proxy's backend connections.
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
> 

> Modified: httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_reqtimeout.c?rev=921378&r1=921377&r2=921378&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
> +++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Wed Mar 10 15:00:50 2010

>      if (ccfg->in_keep_alive) {
>          /* For this read, the normal keep-alive timeout must be used */
> @@ -114,6 +105,24 @@ static apr_status_t reqtimeout_filter(ap
>          return ap_get_brigade(f->next, bb, mode, block, readbytes);
>      }
>  
> +    if (!ccfg->socket) {
> +        core_net_rec *net_rec;
> +        ap_filter_t *core_in = f->next;
> +
> +        while (core_in && core_in->frec != ap_core_input_filter_handle)
> +            core_in = core_in->next;
> +
> +        if (!core_in) {
> +            ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, f->c,
> +                          "mod_reqtimeout: Can't get socket "
> +                          "handle from core_input_filter");
> +            ap_remove_input_filter(f);
> +            return ap_get_brigade(f->next, bb, mode, block, readbytes);
> +        }
> +        net_rec = core_in->ctx;
> +        ccfg->socket = net_rec->client_socket;
> +    }
> +

Hm, this looks kind of ugly. Why not leaving things in
r->connection->conn_config and run through both hooks (pre_connection and
process_connection). The first one stores the socket, the second one applies
the filter if ever reached.

Regards

RĂ¼diger



Mime
View raw message