You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/03/15 21:46:27 UTC
svn commit: r923429 - /httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
Author: sf
Date: Mon Mar 15 20:46:26 2010
New Revision: 923429
URL: http://svn.apache.org/viewvc?rev=923429&view=rev
Log:
get the socket with ap_get_module_config instead of walking the filter chain
Modified:
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=923429&r1=923428&r2=923429&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Mon Mar 15 20:46:26 2010
@@ -151,21 +151,7 @@ static apr_status_t reqtimeout_filter(ap
}
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;
+ ccfg->socket = ap_get_module_config(f->c->conn_config, &core_module);
}
rv = check_time_left(ccfg, &time_left);
Re: svn commit: r923429 -
/httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Tue, 16 Mar 2010, Ruediger Pluem wrote:
> On 15.03.2010 21:46, sf@apache.org wrote:
>> Author: sf
>> Date: Mon Mar 15 20:46:26 2010
>> New Revision: 923429
>>
>> URL: http://svn.apache.org/viewvc?rev=923429&view=rev
>> Log:
>> get the socket with ap_get_module_config instead of walking the filter chain
>>
>> Modified:
>> 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=923429&r1=923428&r2=923429&view=diff
>> ==============================================================================
>> --- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
>> +++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Mon Mar 15 20:46:26 2010
>> @@ -151,21 +151,7 @@ static apr_status_t reqtimeout_filter(ap
>> }
>>
>> 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;
>> + ccfg->socket = ap_get_module_config(f->c->conn_config, &core_module);
>
> Not quite sure if this data structure is part of the API. If not the core could
> change it anytime and the above assignment could fail then.
Other modules do the same, so mod_reqtimeout does not create an additional
problem IMHO:
$ grep -rl ap_get_module_config.*conn_config.*core_module modules
modules/proxy/mod_proxy_connect.c
modules/proxy/mod_proxy_fdpass.c
modules/filters/mod_reqtimeout.c
modules/http/http_core.c
modules/echo/mod_echo.c
modules/experimental/mod_noloris.c
Re: svn commit: r923429 - /httpd/httpd/trunk/modules/filters/mod_reqtimeout.c
Posted by Ruediger Pluem <rp...@apache.org>.
On 15.03.2010 21:46, sf@apache.org wrote:
> Author: sf
> Date: Mon Mar 15 20:46:26 2010
> New Revision: 923429
>
> URL: http://svn.apache.org/viewvc?rev=923429&view=rev
> Log:
> get the socket with ap_get_module_config instead of walking the filter chain
>
> Modified:
> 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=923429&r1=923428&r2=923429&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/filters/mod_reqtimeout.c (original)
> +++ httpd/httpd/trunk/modules/filters/mod_reqtimeout.c Mon Mar 15 20:46:26 2010
> @@ -151,21 +151,7 @@ static apr_status_t reqtimeout_filter(ap
> }
>
> 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;
> + ccfg->socket = ap_get_module_config(f->c->conn_config, &core_module);
Not quite sure if this data structure is part of the API. If not the core could
change it anytime and the above assignment could fail then.
Regards
RĂ¼diger