squid-2.HEAD: fwdComplete/Fail before comm_close

From: Alexander V. Lukyanov <lav_at_netis.ru>
Date: Tue, 5 Aug 2008 10:11:14 +0400

Hello!

Some time ago I had core dumps just after these messages:
        Short response from ...
        httpReadReply: Excess data from ...

I beleave this patch fixes these problems.

Index: http.c
===================================================================
RCS file: /squid/squid/src/http.c,v
retrieving revision 1.446
diff -u -p -r1.446 http.c
--- http.c 25 Jun 2008 22:11:20 -0000 1.446
+++ http.c 5 Aug 2008 06:05:29 -0000
@@ -755,6 +757,7 @@ httpAppendBody(HttpStateData * httpState
     /* Is it a incomplete reply? */
     if (httpState->chunk_size > 0) {
         debug(11, 2) ("Short response from '%s' on port %d. Expecting %" PRINTF_OFF_T " octets more\n", storeUrl(entry), comm_local_port(fd), httpState->chunk_size);
+ fwdFail(httpState->fwd, errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, httpState->fwd->request));
         comm_close(fd);
         return;
     }
@@ -774,6 +777,7 @@ httpAppendBody(HttpStateData * httpState
             ("httpReadReply: Excess data from \"%s %s\"\n",
             RequestMethods[orig_request->method].str,
             storeUrl(entry));
+ fwdComplete(httpState->fwd);
         comm_close(fd);
         return;
     }
Received on Tue Aug 05 2008 - 06:28:42 MDT

This archive was generated by hypermail 2.2.0 : Sat Aug 09 2008 - 12:00:03 MDT