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
