Re: [PATCH, RFC]: Streaming ICAP Client Support leaking sockets

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 21 Jan 2004 23:56:29 +0100 (CET)

On Fri, 19 Dec 2003, Patrick McHardy wrote:

> we had troubles with your Streaming ICAP Client Support patch, when the
> ICAP connection was rejected it leaked a socket per request. After some
> debugging I found calling comm_close in icapReqmodPreCacheSendRequest
> for socket with status != COMM_OK cured the problem, but I know too
> little about squid internals to decide if the fix is correct.

Many thanks for spotting this logic error in error handling during
connection setup, causing a leak if the ICAP server refuses the
connection or is not reachable.

The fix as such is correct or alternatively you can move the state->fd
assignment up before this. And as you note the exact same problem also
applies to icapRespModPreCacheSendRequest.

Regards
Henrik
Received on Wed Jan 21 2004 - 15:56:35 MST

This archive was generated by hypermail pre-2.1.9 : Sat Jan 31 2004 - 12:00:10 MST