]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Try httpRestart of httpReadReply read() returns < 0, not just == 0.
authorwessels <>
Mon, 30 Mar 1998 11:11:13 +0000 (11:11 +0000)
committerwessels <>
Mon, 30 Mar 1998 11:11:13 +0000 (11:11 +0000)
src/http.cc

index b3d6fdbe479cf6ef2bc3087bc58e2133ec1486a0..13c16dfa31a9c777b99c98163e4b860cf74828b4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.258 1998/03/27 22:44:22 wessels Exp $
+ * $Id: http.cc,v 1.259 1998/03/30 04:11:13 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -456,21 +456,22 @@ httpReadReply(int fd, void *data)
        IOStats.Http.read_hist[bin]++;
     }
     if (len < 0) {
+       debug(50, 2) ("httpReadReply: FD %d: read failure: %s.\n",
+           fd, xstrerror());
        if (ignoreErrno(errno)) {
            commSetSelect(fd, COMM_SELECT_READ, httpReadReply, httpState, 0);
+       } else if (entry->mem_obj->inmem_hi == 0 && httpTryRestart(httpState)) {
+           httpRestart(httpState);
+       } else if (clen == 0) {
+           err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR);
+           err->xerrno = errno;
+           err->request = requestLink(httpState->orig_request);
+           errorAppendEntry(entry, err);
+          comm_close(fd);
        } else {
-           if (clen == 0) {
-               err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR);
-               err->xerrno = errno;
-               err->request = requestLink(httpState->orig_request);
-               errorAppendEntry(entry, err);
-           } else {
-               storeAbort(entry, 0);
-           }
+           storeAbort(entry, 0);
            comm_close(fd);
        }
-       debug(50, 2) ("httpReadReply: FD %d: read failure: %s.\n",
-           fd, xstrerror());
     } else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
        if (httpTryRestart(httpState)) {
            httpRestart(httpState);