]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Don't call storeAppend with len == 0 and the immediately followed by storeComplete.
authorwessels <>
Fri, 24 Oct 1997 05:22:15 +0000 (05:22 +0000)
committerwessels <>
Fri, 24 Oct 1997 05:22:15 +0000 (05:22 +0000)
the storeComplete should be enough to invoke the client callbacks.

Also, we must CLEAR the fd timeouts/defer stuff because just flopping them
over to the pconn handlers won't take effect if we are shutdown pending.

src/http.cc

index a4c4d4c4b27bad336983c5352b1d08c431410c8e..2e3952a12a5a080ad7c547cd9501969967a859fa 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.196 1997/10/23 20:42:18 wessels Exp $
+ * $Id: http.cc,v 1.197 1997/10/23 23:22:15 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -300,6 +300,7 @@ httpParseReplyHeaders(const char *buf, struct _http_reply *reply)
     time_t delta;
     size_t l;
 
+    assert(reply != NULL);
     reply->code = 600;
     ReplyHeaderStats.parsed++;
     xstrncpy(headers, buf, 4096);
@@ -665,7 +666,7 @@ httpReadReply(int fd, void *data)
        httpState->eof = 1;
        if (httpState->reply_hdr_state < 2)
            httpProcessReplyHeader(httpState, buf, len);
-       storeAppend(entry, buf, len);   /* invoke handlers! */
+       /* storeAppend(entry, buf, len);        /* invoke handlers! */
        storeComplete(entry);   /* deallocates mem_obj->request */
        comm_close(fd);
     } else {
@@ -673,7 +674,10 @@ httpReadReply(int fd, void *data)
            httpProcessReplyHeader(httpState, buf, len);
        storeAppend(entry, buf, len);
        if (httpPconnTransferDone(httpState)) {
+           /* yes we have to clear all these! */
            commSetDefer(fd, NULL, NULL);
+           commSetTimeout(fd, -1, NULL, NULL);
+           commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
            comm_remove_close_handler(fd, httpStateFree, httpState);
            storeComplete(entry);       /* deallocates mem_obj->request */
            pconnPush(fd, request->host, request->port);