On Mon, 2007-06-18 at 13:57 +0200, Plüm, Rüdiger, VF-Group wrote:
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Jean-Frederic  
> > Gesendet: Montag, 18. Juni 2007 12:06
> > An: [email protected]
> > Betreff: Re: ProxyTimeout does not work as documented
> > 
> > 
> > On Sat, 2007-06-16 at 17:40 +0200, Ruediger Pluem wrote:
> > > 
> > > 
> > > Digging somewhat deeper to actually do this I found the following
> > > obstacle (hopefully I am wrong):
> > > 
> > > 1. The right place to fix this is in ap_proxy_connect_backend
> > >   (around line 2215 in proxy_util.c).
> > 
> > The Timeout is the Default value already See  
> > c->base_server->timeout in
> > core_pre_connection(). 
> 
> This happens afterwards in ap_proxy_connection_create and not for 
> mod_proxy_ajp as
> mod_proxy_ajp does not call ap_proxy_connection_create. This was fixed by
> your patch in r546128.
> 
> > 
> > > 
> > > 2. We do not have a proxy_server_conf parameter in 
> > ap_proxy_connect_backend
> > >    like in ap_proxy_connect_to_backend.
> > > 
> > > 3. ap_proxy_connect_backend is part of a public API (mod_proxy.h).
> > > 
> > > 4. Fixing the prototype of ap_proxy_connect_backend to add 
> > a proxy_server_conf
> > >    parameter thus requires a major bump. Thus this would 
> > not be backportable :-(.
> > > 
> > > I am not quite sure if we can do
> > > 
> > >     void *sconf = s->module_config;
> > >     proxy_server_conf *conf = (proxy_server_conf *)
> > >         ap_get_module_config(sconf, &proxy_module);
> > 
> > See modules/proxy/mod_proxy_balancer.c
> 
> Thanks for the pointer, but I stick to my opinion that this is ugly
> there. But possibly we can go for the ugly way in 2.2.x and for the
> API change in trunk.
> 

The "ugly" hack works. Should I apply the attached patch?

Cheers

Jean-Frederic
Index: modules/proxy/proxy_util.c
===================================================================
--- modules/proxy/proxy_util.c	(revision 546396)
+++ modules/proxy/proxy_util.c	(working copy)
@@ -2167,6 +2167,9 @@
     int loglevel;
     apr_sockaddr_t *backend_addr = conn->addr;
     apr_socket_t *newsock;
+    void *sconf = s->module_config;
+    proxy_server_conf *conf =
+        (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module);
 
     if (conn->sock) {
         /*
@@ -2215,6 +2218,9 @@
         if (worker->timeout_set == 1) {
             apr_socket_timeout_set(newsock, worker->timeout);
         }
+        else if (conf->timeout_set == 1) {
+            apr_socket_timeout_set(newsock, conf->timeout);
+        }
         else {
              apr_socket_timeout_set(newsock, s->timeout);
         }

Reply via email to