httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject mod_reqtimeout and mod_proxy: how to distinguish incoming from backend connections
Date Tue, 09 Mar 2010 21:20:59 GMT
Hi,

mod_proxy calls ap_run_pre_connection() on the backend connection, 
which causes mod_reqtimeout to be inserted as filter. This is of 
course wrong, because mod_reqtimeout will mess up mod_proxy's socket 
timeouts.

After digging in the code I have found two potential solutions:

- The scoreboard handle conn->sbh is always NULL in mod_proxy's 
backend connection. Mod_reqtimeout could use this to determine if it 
should do something.

- mod_reqtimeout could hook into ap_run_process_connection with 
APR_HOOK_LAST or APR_HOOK_REALLY_LAST-1, i.e. right before 
ap_process_http_connection(). The hook function would then set a flag 
to activate mod_reqtimeout and then return DECLINED. This should lead 
to mod_reqtimeout only dealing with connections handled by 
ap_process_http_connection.


Both approaches are rather hack-ish but I think the second one is a 
lot better than the first. It would also prevent mod_reqtimeout from 
influencing protocol handlers like mod_echo and mod_ftp.

Does anyone have other ideas or comments?


BTW, can someone create a mod_reqtimeout entry in bugzilla?

Cheers,
Stefan

Mime
View raw message