Stefan Fritsch wrote:
> On Wednesday 16 November 2011, Steffen wrote:
>> What I noticed, it is connecting to a port by a formerly used
>> proxied  connection (port 7080 instead of 81);
>>
>> Summary log:
>>
>> [proxy:debug] [pid 8680:tid 2668] proxy_util.c(2140): proxy: HTTP:
>> has  acquired connection for (*)
>> [proxy:debug] [pid 8680:tid 2668] proxy_util.c(2193): proxy:
>> connecting  http://127.0.0.1:81/sysadmin to 127.0.0.1:81
>> [proxy:debug] [pid 8680:tid 2668] proxy_util.c(2319): proxy:
>> connected  /sysadmin to 127.0.0.1:7080
> 
> 
> After a cursory glance at the code, I have a suspicion about the 
> reason. It seems to me that this check in proxy_util.c
> 
>     /*
>      * Make sure that we pick the the correct and valid worker.
>      * 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, where we compare the
>      * the hostnames associated between the two.
>      *
>      * TODO: Handle this much better...
>      */
>     if (!conn->hostname || !worker->s->is_address_reusable ||
>          worker->s->disablereuse ||
>          (r->connection->keepalives &&
>          (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == 
> PROXYREQ_REVERSE) &&
>          (strcasecmp(conn->hostname, uri->hostname) != 0) ) ) {
> 
> 
> 
> should also compare conn->port and uri->port, i.e. the 
> 
> 
>          (strcasecmp(conn->hostname, uri->hostname) != 0)
> 
> 
> should be 
> 
> 
>          (strcasecmp(conn->hostname, uri->hostname) != 0 ||
>           conn->port != uri->port)
> 
> 
> Can anyone more familiar with the code verify this? Steffen, maybe you 
> can try the change and see if it helps?


It should. There was a change in behaviour. Previously 
worker->s->is_address_reusable
was always 0 for the worker used with this configuration. This is no longer 
true.
Hence we see this issue now.

Regards

Rüdiger


Reply via email to