]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
remove storeAbort() calls after storeAppendEntry() because now
authorwessels <>
Wed, 3 Dec 1997 16:00:16 +0000 (16:00 +0000)
committerwessels <>
Wed, 3 Dec 1997 16:00:16 +0000 (16:00 +0000)
storeAppendEntry() calls storeComplete() which sets store_status
to STORE_COMPLETE.

src/errorpage.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/wais.cc

index 074b6b67789f82c456299889fd4e9f5656b1e411..ae9984c4f0878d3cd7f006094beaaebe2995c987 100644 (file)
@@ -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);
 }
 
index ffc50e60527902f1becbf29d528b7415b855c824..ef576d85dff90ecdb0b4f952f93bae06099e7726 100644 (file)
@@ -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);
 }
 
index 277cd9eb18f102735605fd0a3ac60b8960915166..e83eb20874bc5c809d0ce4105f47f32722c95972 100644 (file)
@@ -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);
index 4d55c9177bde894a0e8eb667df333df18de5dd30..3dcc8a074534861124287c0f141568e1474c290e 100644 (file)
@@ -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);
index 523a0fcbb5b3d1ad2a4159fcbba5131e3f7519f4..5b417538ae023c4d687c7e251bf6c86ef1cf3389 100644 (file)
@@ -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);