Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

testing for connections with keep-alive property from modules

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


Kevin.Walters at morganstanley

Jun 23, 2009, 6:51 AM

Post #1 of 2 (227 views)
Permalink
testing for connections with keep-alive property from modules

Hi,

What's the recommended way to check for a connection having the
property of being kept alive?

I was expecting to see tests like c->keepalive == AP_CONN_KEEPALIVE
but i see that mod_proxy.c is testing c->keepalives which is the
incrementing counter of requests processed on that connection. Are
those two tests equivalent and interchangeable?

E.g. from 2.2.10's mod_proxy_http.c

if ((r->proxyreq == PROXYREQ_REVERSE) && (!c->keepalives)
&& (apr_table_get(r->subprocess_env, "proxy-initial-not-pooled"))) {
backend->close = 1;
}


regards

|<evin

--
Kevin J Walters Morgan Stanley
kjw[at]ms.com 25 Cabot Square
Tel: 020 7425 7886 Canary Wharf
Fax: 020 7677 8504 London E14 4QA


poirier at pobox

Jun 23, 2009, 8:20 AM

Post #2 of 2 (206 views)
Permalink
Re: testing for connections with keep-alive property from modules [In reply to]

Kevin J Walters <Kevin.Walters[at]morganstanley.com> writes:

> What's the recommended way to check for a connection having the
> property of being kept alive?
>
> I was expecting to see tests like c->keepalive == AP_CONN_KEEPALIVE
> but i see that mod_proxy.c is testing c->keepalives which is the
> incrementing counter of requests processed on that connection. Are
> those two tests equivalent and interchangeable?
>
> E.g. from 2.2.10's mod_proxy_http.c
>
> if ((r->proxyreq == PROXYREQ_REVERSE) && (!c->keepalives)
> && (apr_table_get(r->subprocess_env, "proxy-initial-not-pooled"))) {
> backend->close = 1;
> }

c->keepalives will tell you how many requests the connection has
handled, not whether it's going to be kept alive past the current
request. For that you need to look at c->keepalive.

--
Dan Poirier <poirier[at]pobox.com>

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.