diff options
| author | Jim Jagielski <jim@apache.org> | 2005-11-29 15:05:16 +0000 |
|---|---|---|
| committer | Jim Jagielski <jim@apache.org> | 2005-11-29 15:05:16 +0000 |
| commit | 35f692c8fad03366fc5ffdc676f36c5ce8b05e69 (patch) | |
| tree | 3427abe740c9317caa183b0d602ac18b1176a022 /modules | |
| parent | a2a903da53a6abd6616dfd10f5d55470e2e07dc3 (diff) | |
| download | httpd-35f692c8fad03366fc5ffdc676f36c5ce8b05e69.tar.gz | |
Fix case where a shared keepalive connection results in
different workers from being accessed. Try to be wise and
fast about the tests before we do the expensive string
comparison.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@349723 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/proxy/proxy_util.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 96a743eadc..8d49f82f2c 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1824,12 +1824,22 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, uri->fragment ? "#" : "", uri->fragment ? uri->fragment : "", NULL); } - if (!worker->is_address_reusable) { + /* + * If a single keepalive connection triggers different workers, + * then we have a problem (we don't select the correct one). + * Do an expensive check in this case. + * + * TODO: Handle this much better... + */ + if (!worker->is_address_reusable || + (r->connection->keepalives && + (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == PROXYREQ_REVERSE) && + (strcasecmp(conn->hostname, uri->hostname) != 0) ) ) { if (proxyname) { - conn->hostname = proxyname; + conn->hostname = apr_pstrdup(conn->pool, proxyname); conn->port = proxyport; } else { - conn->hostname = uri->hostname; + conn->hostname = apr_pstrdup(conn->pool, uri->hostname); conn->port = uri->port; } } |
