httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Plüm, Rüdiger, VF-Group" <ruediger.pl...@vodafone.com>
Subject RE: Changing Connection header use in forward proxy
Date Thu, 05 Aug 2010 11:03:17 GMT
 

> -----Original Message-----
> From: Rainer Jung 
> Sent: Donnerstag, 5. August 2010 11:51
> To: dev@httpd.apache.org
> Subject: Changing Connection header use in forward proxy
> 
> It seems the forward proxy by default sets "Connection: Keep-Alive" 
> although it later closes the connection when it detects 
> is_address_reusable == 1 in the worker.
> 
> Doesn't it make sense to issue "Connection close" instead?
> 
> Since this happens in the code where we have a connection and 
> a request, 
> but no worker struct available, is it safe to apply this whenever 
> proxyreq is PROXYREQ_PROXY? Or can one somehow configure a 
> non-default 
> forward worker with an explicit URL to e.g. a frequently used origin 
> server which would then be expected to reuse connections? I 
> don't expect 
> that to be posible, but I'm not sure.

I haven't tried so far, but IMHO it should be possible to setup
pooled connections for frequently used targets of a forward proxy
by adding

<Proxy http://www.frequentlyused.com/>
   # Set an arbitrary parameter to trigger the creation of a worker
   ProxySet keepalive=on
</Proxy>

If I am correct with this assumption the we should not proceed the way
you proposed.

How about the following untested patch instead?

Index: modules/proxy/proxy_util.c
===================================================================
--- modules/proxy/proxy_util.c  (revision 982130)
+++ modules/proxy/proxy_util.c  (working copy)
@@ -1568,6 +1568,7 @@
                 *balancer = NULL;
                 *worker = conf->forward;
                 access_status = OK;
+                apr_table_set(r->subprocess_env, "proxy-nokeepalive", "1");
             }
         }
         else if (r->proxyreq == PROXYREQ_REVERSE) {
@@ -1578,6 +1579,7 @@
                 *balancer = NULL;
                 *worker = conf->reverse;
                 access_status = OK;
+                apr_table_set(r->subprocess_env, "proxy-nokeepalive", "1");
             }
         }
     }

Regards

Rüdiger


Mime
View raw message