From: wessels <> Date: Wed, 29 Jul 1998 08:57:35 +0000 (+0000) Subject: when write returns an error on a half-closed socket, ALWAYS close the X-Git-Tag: SQUID_3_0_PRE1~2965 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8d6569c17c239f5c0c9f56e5c8e4508d398aad0;p=thirdparty%2Fsquid.git when write returns an error on a half-closed socket, ALWAYS close the descriptor and don't check ignoreErrno(). --- diff --git a/src/comm.cc b/src/comm.cc index 092bf864ca..ab32b03f1b 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.280 1998/07/25 00:18:08 wessels Exp $ + * $Id: comm.cc,v 1.281 1998/07/29 02:57:35 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -777,7 +777,11 @@ commHandleWrite(int fd, void *data) CommWriteStateCallbackAndFree(fd, nleft ? COMM_ERROR : COMM_OK); } else if (len < 0) { /* An error */ - if (ignoreErrno(errno)) { + if (fd_table[fd].flags.socket_eof) { + debug(50, 2) ("commHandleWrite: FD %d: write failure: %s.\n", + fd, xstrerror()); + CommWriteStateCallbackAndFree(fd, COMM_ERROR); + } else if (ignoreErrno(errno)) { debug(50, 10) ("commHandleWrite: FD %d: write failure: %s.\n", fd, xstrerror()); commSetSelect(fd,