]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
when write returns an error on a half-closed socket, ALWAYS close the
authorwessels <>
Wed, 29 Jul 1998 08:57:35 +0000 (08:57 +0000)
committerwessels <>
Wed, 29 Jul 1998 08:57:35 +0000 (08:57 +0000)
descriptor and don't check ignoreErrno().

src/comm.cc

index 092bf864cad07d4ff7fbbc12e550b4dcbc3c5909..ab32b03f1b181f09707168ecc546c37e8963b30d 100644 (file)
@@ -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,