Re: persistent connections and tcp_outgoing_address

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Sat, 24 Feb 2007 15:17:20 +0100

lör 2007-02-24 klockan 15:14 +0100 skrev Francisco Gimeno:

> The reason is simple: we use the tcp_outgoing_address to identify set of
> clients and give them different bandwidth with a Packeteer PacketShaper.

Ok.

> I have look the code, and I think I have found some interesting functions.
> Basically, pconnPush that seems to put an idle connection in a hashtable. I
> don't understand the function as it calls a lot of other functions. It seems
> that an open connection is inserted in the hashtable when idle.

Correct.

> Ok, that seems right for me. What I can't find is the code deciding if we have
> to reuse a pconn or to create a new one.

Thats the pconnPop call in forward.c.

> I thought it should be "near" the outgoingAddress, indeed in the
> fwdConnectStart(void *data) function... Finally I got this call:
>
> if (fd == -1)
> fd = pconnPop(name, port, domain, NULL, 0);

Ok, you found it.

> What should be the effect of changing the NULL by
> &fwdState->request->client_addr ?

The arguments in pconnPush/Pop must match. So if you change one you must
change both. Other than that it should work..

> I don't know what's checking in each if?...

httpstate->peer checks is a cache_peer was used.

> originserver seems to be related
> to an option in cache_peer. I think I should modify the last call, with
> pconnPush(fd, request->host, request->port,
> httpState->orig_request->host, client_addr, client_port);

I would modify both to be on the safe side. One day maybe you want to
use a cache_peer...

Regards
Henrik

Received on Sat Feb 24 2007 - 07:17:27 MST

This archive was generated by hypermail pre-2.1.9 : Thu Mar 01 2007 - 12:00:02 MST