From: wessels <> Date: Wed, 3 Dec 1997 16:00:16 +0000 (+0000) Subject: remove storeAbort() calls after storeAppendEntry() because now X-Git-Tag: SQUID_3_0_PRE1~4400 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b50179a6c2ee07fc0ad66a72a99276344fc10a70;p=thirdparty%2Fsquid.git remove storeAbort() calls after storeAppendEntry() because now storeAppendEntry() calls storeComplete() which sets store_status to STORE_COMPLETE. --- diff --git a/src/errorpage.cc b/src/errorpage.cc index 074b6b6778..ae9984c4f0 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1,6 +1,6 @@ /* - * $Id: errorpage.cc,v 1.109 1997/12/03 08:26:34 wessels Exp $ + * $Id: errorpage.cc,v 1.110 1997/12/03 09:00:16 wessels Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -114,14 +114,14 @@ errorAppendEntry(StoreEntry * entry, ErrorState * err) MemObject *mem = entry->mem_obj; int len; assert(entry->store_status == STORE_PENDING); -#if WE_SHOULD_PROBABLY_REQUIRE_THIS + assert(mem != NULL); assert(mem->inmem_hi == 0); -#endif buf = errorBuildBuf(err, &len); storeAppend(entry, buf, len); - if (mem) - mem->reply->code = err->http_status; + mem->reply->code = err->http_status; storeComplete(entry); + storeNegativeCache(entry); + storeReleaseRequest(entry); errorStateFree(err); } diff --git a/src/ftp.cc b/src/ftp.cc index ffc50e6052..ef576d85df 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.176 1997/12/02 00:17:35 wessels Exp $ + * $Id: ftp.cc,v 1.177 1997/12/03 09:00:17 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -263,8 +263,9 @@ ftpTimeout(int fd, void *data) err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT); err->request = requestLink(ftpState->request); errorAppendEntry(entry, err); + } else { + storeAbort(entry, 0); } - storeAbort(entry, 0); } if (ftpState->data.fd >= 0) { comm_close(ftpState->data.fd); @@ -722,8 +723,9 @@ ftpReadData(int fd, void *data) err->xerrno = errno; err->request = requestLink(ftpState->request); errorAppendEntry(entry, err); + } else { + storeAbort(entry, 0); } - storeAbort(entry, 0); ftpDataTransferDone(ftpState); } } else if (len == 0 && mem->inmem_hi == 0) { @@ -731,7 +733,6 @@ ftpReadData(int fd, void *data) err->xerrno = errno; err->request = requestLink(ftpState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); ftpDataTransferDone(ftpState); } else if (len == 0) { ftpReadComplete(ftpState); @@ -899,7 +900,6 @@ ftpStart(request_t * request, StoreEntry * entry) err->xerrno = errno; err->request = requestLink(ftpState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); return; } ftpState->ctrl.fd = fd; @@ -926,7 +926,6 @@ ftpConnectDone(int fd, int status, void *data) err->dnsserver_msg = xstrdup(dns_error_message); err->request = requestLink(request); errorAppendEntry(ftpState->entry, err); - storeAbort(ftpState->entry, 0); comm_close(fd); } else if (status != COMM_OK) { err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE); @@ -935,7 +934,6 @@ ftpConnectDone(int fd, int status, void *data) err->port = request->port; err->request = requestLink(request); errorAppendEntry(ftpState->entry, err); - storeAbort(ftpState->entry, 0); comm_close(fd); } else { ftpState->state = BEGIN; @@ -1427,7 +1425,6 @@ ftpPasvCallback(int fd, int status, void *data) err->port = ftpState->data.port; err->request = requestLink(request); errorAppendEntry(ftpState->entry, err); - storeAbort(ftpState->entry, 0); comm_close(fd); return; } @@ -1671,7 +1668,6 @@ ftpFail(FtpStateData * ftpState) else err->ftp.reply = ftpState->ctrl.last_reply; errorAppendEntry(ftpState->entry, err); - storeAbort(ftpState->entry, 0); comm_close(ftpState->ctrl.fd); } diff --git a/src/gopher.cc b/src/gopher.cc index 277cd9eb18..e83eb20874 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,6 +1,6 @@ /* - * $Id: gopher.cc,v 1.114 1997/11/18 01:02:38 wessels Exp $ + * $Id: gopher.cc,v 1.115 1997/12/03 09:00:18 wessels Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -651,8 +651,9 @@ gopherTimeout(int fd, void *data) err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT); err->url = xstrdup(gopherState->request); errorAppendEntry(entry, err); + } else { + storeAbort(entry, 0); } - storeAbort(entry, 0); comm_close(fd); } @@ -698,7 +699,6 @@ gopherReadReply(int fd, void *data) err->xerrno = errno; err->url = xstrdup(storeUrl(entry)); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } } else if (len == 0 && entry->mem_obj->inmem_hi == 0) { @@ -707,7 +707,6 @@ gopherReadReply(int fd, void *data) err->xerrno = errno; err->url = xstrdup(gopherState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } else if (len == 0) { /* Connection closed; retrieval done. */ @@ -750,8 +749,6 @@ gopherSendComplete(int fd, char *buf, size_t size, int errflag, void *data) err->port = gopherState->port; err->url = xstrdup(storeUrl(entry)); errorAppendEntry(entry, err); - - storeAbort(entry, 0); comm_close(fd); if (buf) put_free_4k_page(buf); /* Allocated by gopherSendRequest. */ @@ -837,7 +834,6 @@ gopherStart(StoreEntry * entry) err = errorCon(ERR_INVALID_URL, HTTP_BAD_REQUEST); err->url = xstrdup(storeUrl(entry)); errorAppendEntry(entry, err); - storeAbort(entry, 0); gopherStateFree(-1, gopherState); return; } @@ -854,7 +850,6 @@ gopherStart(StoreEntry * entry) err->xerrno = errno; err->url = xstrdup(storeUrl(entry)); errorAppendEntry(entry, err); - storeAbort(entry, 0); gopherStateFree(-1, gopherState); return; } @@ -901,7 +896,6 @@ gopherConnectDone(int fd, int status, void *data) err->dnsserver_msg = xstrdup(dns_error_message); err->url = xstrdup(storeUrl(entry)); errorAppendEntry(entry, err); - storeAbort(gopherState->entry, 0); comm_close(fd); } else if (status != COMM_OK) { ErrorState *err; @@ -911,7 +905,6 @@ gopherConnectDone(int fd, int status, void *data) err->port = gopherState->port; err->url = xstrdup(storeUrl(entry)); errorAppendEntry(entry, err); - storeAbort(gopherState->entry, 0); comm_close(fd); } else { commSetSelect(fd, COMM_SELECT_WRITE, gopherSendRequest, gopherState, 0); diff --git a/src/http.cc b/src/http.cc index 4d55c9177b..3dcc8a0745 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.226 1997/12/02 00:17:37 wessels Exp $ + * $Id: http.cc,v 1.227 1997/12/03 09:00:18 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -256,8 +256,9 @@ httpTimeout(int fd, void *data) err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT); err->request = requestLink(httpState->orig_request); errorAppendEntry(entry, err); + } else { + storeAbort(entry, 0); } - storeAbort(entry, 0); comm_close(fd); } @@ -639,8 +640,9 @@ httpReadReply(int fd, void *data) 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", @@ -654,7 +656,6 @@ httpReadReply(int fd, void *data) err->xerrno = errno; err->request = requestLink(httpState->orig_request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } } else if (len == 0) { @@ -701,7 +702,6 @@ httpSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) err->xerrno = errno; err->request = requestLink(httpState->orig_request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); return; } else { @@ -956,7 +956,6 @@ httpSocketOpen(StoreEntry * entry, request_t * request) err->xerrno = errno; err->request = requestLink(request); errorAppendEntry(entry, err); - storeAbort(entry, 0); } return fd; } @@ -1074,7 +1073,6 @@ httpConnectDone(int fd, int status, void *data) err->dnsserver_msg = xstrdup(dns_error_message); err->request = requestLink(httpState->orig_request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } else if (status != COMM_OK) { err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE); @@ -1083,7 +1081,6 @@ httpConnectDone(int fd, int status, void *data) err->port = request->port; err->request = requestLink(httpState->orig_request); errorAppendEntry(entry, err); - storeAbort(entry, 0); if (httpState->peer) peerCheckConnectStart(httpState->peer); comm_close(fd); diff --git a/src/wais.cc b/src/wais.cc index 523a0fcbb5..5b417538ae 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -1,6 +1,6 @@ /* - * $Id: wais.cc,v 1.98 1997/11/14 17:21:24 wessels Exp $ + * $Id: wais.cc,v 1.99 1997/12/03 09:00:20 wessels Exp $ * * DEBUG: section 24 WAIS Relay * AUTHOR: Harvest Derived @@ -146,7 +146,6 @@ waisTimeout(int fd, void *data) err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT); err->request = urlParse(METHOD_CONNECT, waisState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } @@ -167,7 +166,6 @@ waisReadReply(int fd, void *data) err = errorCon(ERR_CLIENT_ABORT, HTTP_INTERNAL_SERVER_ERROR); err->request = urlParse(METHOD_CONNECT, waisState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); return; } @@ -199,7 +197,6 @@ waisReadReply(int fd, void *data) err->xerrno = errno; err->request = urlParse(METHOD_CONNECT, waisState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } } else if (len == 0 && entry->mem_obj->inmem_hi == 0) { @@ -208,7 +205,6 @@ waisReadReply(int fd, void *data) err->xerrno = errno; err->request = urlParse(METHOD_CONNECT, waisState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } else if (len == 0) { /* Connection closed; retrieval done. */ @@ -243,7 +239,6 @@ waisSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) err->port = waisState->relayport; err->request = urlParse(METHOD_CONNECT, waisState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); comm_close(fd); } else { /* Schedule read reply. */ @@ -294,8 +289,6 @@ waisStart(request_t * request, StoreEntry * entry) err = errorCon(ERR_NO_RELAY, HTTP_INTERNAL_SERVER_ERROR); err->request = urlParse(METHOD_CONNECT, waisState->request); errorAppendEntry(entry, err); - - storeAbort(entry, 0); return; } fd = comm_open(SOCK_STREAM, @@ -310,7 +303,6 @@ waisStart(request_t * request, StoreEntry * entry) err = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR); err->request = urlParse(METHOD_CONNECT, waisState->request); errorAppendEntry(entry, err); - storeAbort(entry, 0); return; } waisState = xcalloc(1, sizeof(WaisStateData)); @@ -345,7 +337,6 @@ waisConnectDone(int fd, int status, void *data) err->dnsserver_msg = xstrdup(dns_error_message); err->request = urlParse(METHOD_CONNECT, request); errorAppendEntry(waisState->entry, err); - storeAbort(waisState->entry, 0); comm_close(fd); } else if (status != COMM_OK) { err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE); @@ -354,7 +345,6 @@ waisConnectDone(int fd, int status, void *data) err->port = waisState->relayport; err->request = urlParse(METHOD_CONNECT, request); errorAppendEntry(waisState->entry, err); - storeAbort(waisState->entry, 0); comm_close(fd); } else { commSetSelect(fd, COMM_SELECT_WRITE, waisSendRequest, waisState, 0);