From: hno <> Date: Mon, 3 Sep 2007 09:13:52 +0000 (+0000) Subject: Bug #2068: assertion failed: comm.cc:2286: "fdc_table[fd].active" X-Git-Tag: SQUID_3_0_RC1~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a31a78fb4261594b6a5eceb5dd0d51e6b5719fe2;p=thirdparty%2Fsquid.git Bug #2068: assertion failed: comm.cc:2286: "fdc_table[fd].active" A recent change opened for a race condition on PUT/POST requests. --- diff --git a/src/client_side.cc b/src/client_side.cc index 9b6b1cc9be..7012871171 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.764 2007/08/30 15:57:16 hno Exp $ + * $Id: client_side.cc,v 1.765 2007/09/03 03:13:52 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2454,6 +2454,10 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno, conn->handleReadData(buf, size); + /* The above may close the connection under our feets */ + if (!conn->isOpen()) + return; + } else if (size == 0) { debugs(33, 5, "clientReadRequest: FD " << fd << " closed?"); @@ -2484,6 +2488,8 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno, fd_note(conn->fd, "Reading next request"); if (! clientParseRequest(conn, do_next_read)) { + if (!conn->isOpen()) + return; /* * If the client here is half closed and we failed * to parse a request, close the connection. @@ -2491,7 +2497,6 @@ clientReadRequest(int fd, char *buf, size_t size, comm_err_t flag, int xerrno, * succeeds _if_ the buffer is empty which it won't * be if we have an incomplete request. */ - if (conn->getConcurrentRequestCount() == 0 && commIsHalfClosed(fd)) { debugs(33, 5, "clientReadRequest: FD " << fd << ": half-closed connection, no completed request parsed, connection closing."); comm_close(fd);