From: rousskov <> Date: Sat, 18 Aug 2007 02:28:49 +0000 (+0000) Subject: Bug #2044 fix: Detect aborted client connections. X-Git-Tag: SQUID_3_0_PRE7~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee6f0213e0da2a463c8a9a04c842fa6de3a64d22;p=thirdparty%2Fsquid.git Bug #2044 fix: Detect aborted client connections. Call clientAfterReadingRequests even if we parsed the request. Otherwise, we will not set up a read handler to detect aborted connections. Do not call clientAfterReadingRequests() after comm_close() because the former uses the file descriptor to look things up. --- diff --git a/src/client_side.cc b/src/client_side.cc index 2f8dc6a5c8..0c0d84dac8 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.759 2007/08/13 18:25:14 hno Exp $ + * $Id: client_side.cc,v 1.760 2007/08/17 20:28:49 rousskov Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2503,10 +2503,11 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno, if (conn->getConcurrentRequestCount() == 0 && commIsHalfClosed(fd)) { debugs(33, 5, "clientReadRequest: FD " << fd << ": half-closed connection, no completed request parsed, connection closing."); comm_close(fd); + return; } - - clientAfterReadingRequests(fd, conn, do_next_read); } + + clientAfterReadingRequests(fd, conn, do_next_read); } // called when new request data has been read from the socket