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

From: Patrick McHardy <kaber@dont-contact.us>
Date: Fri, 19 Dec 2003 11:51:44 +0100

Hi Henrik,

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. It would
be nice if you could have a look at it. In case the fix is correct, a
comm_close might also be required in icapRespModPreCacheSendRequest.

Best regards,
Patrick

--- squid-2.5.STABLE4/src/icap.c.orig Fri Dec 19 10:58:26 2003
+++ squid-2.5.STABLE4/src/icap.c Fri Dec 19 10:58:35 2003
@@ -789,6 +789,7 @@
     IcapService *service = reqIcapService(state->request, ICAP_SERVICE_REQMOD_PRECACHE);
 
     if (status != COMM_OK) {
+ comm_close(fd);
         icapReqmodPreCacheFailed(state);
         return;
     }
Received on Fri Dec 19 2003 - 06:36:55 MST

This archive was generated by hypermail pre-2.1.9 : Wed Dec 24 2003 - 12:00:29 MST