From: wessels <> Date: Fri, 24 Oct 1997 05:22:15 +0000 (+0000) Subject: Don't call storeAppend with len == 0 and the immediately followed by storeComplete. X-Git-Tag: SQUID_3_0_PRE1~4719 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b29969a4281986d9ee8039ab341808883a43afa;p=thirdparty%2Fsquid.git Don't call storeAppend with len == 0 and the immediately followed by storeComplete. 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. --- diff --git a/src/http.cc b/src/http.cc index a4c4d4c4b2..2e3952a12a 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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);