]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
server-side handlers check for ENTRY_ABORTED and close their FD
authorwessels <>
Tue, 12 Jan 1999 22:47:51 +0000 (22:47 +0000)
committerwessels <>
Tue, 12 Jan 1999 22:47:51 +0000 (22:47 +0000)
pump.c needs FwdState to set fwdFail()

src/ftp.cc
src/gopher.cc
src/http.cc
src/protos.h
src/store.cc
src/wais.cc

index 46b30bf0bb029ef89b9aa842b5e79030f46c8e7d..db4a30f3fe97b5617fa1bde0e649e4712306dbd4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.261 1999/01/11 20:28:02 wessels Exp $
+ * $Id: ftp.cc,v 1.262 1999/01/12 15:47:51 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -836,6 +836,10 @@ ftpDataRead(int fd, void *data)
     delay_id delay_id = delayMostBytesAllowed(mem);
 #endif
     assert(fd == ftpState->data.fd);
+    if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+        comm_close(fd);
+        return;
+    }
     errno = 0;
     read_sz = ftpState->data.size - ftpState->data.offset;
 #if DELAY_POOLS
@@ -2210,8 +2214,7 @@ static void
 ftpPutStart(FtpStateData * ftpState)
 {
     debug(9, 3) ("ftpPutStart\n");
-    pumpStart(ftpState->data.fd, ftpState->entry,
-       ftpState->request, ftpPutTransferDone, ftpState);
+    pumpStart(ftpState->data.fd, ftpState->fwd, ftpPutTransferDone, ftpState);
 }
 
 static void
index 30b26dca8f001b175b2925278275a4fb1643d713..f26048716c8b31a7a6d83e5fdf0e4ccebb9a95c1 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: gopher.cc,v 1.142 1999/01/08 21:12:13 wessels Exp $
+ * $Id: gopher.cc,v 1.143 1999/01/12 15:47:52 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -599,6 +599,10 @@ gopherReadReply(int fd, void *data)
 #if DELAY_POOLS
     delay_id delay_id = delayMostBytesAllowed(entry->mem_obj);
 #endif
+    if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+        comm_close(fd);
+        return;
+    }
     errno = 0;
     buf = memAllocate(MEM_4K_BUF);
     read_sz = 4096 - 1;                /* leave room for termination */
index 88c9fee7cb38d814d95dd72273d55dcb84fa4938..86361d5612048cc5885a0737145992c158ede339 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.336 1999/01/11 16:50:32 wessels Exp $
+ * $Id: http.cc,v 1.337 1999/01/12 15:47:53 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -430,6 +430,10 @@ httpReadReply(int fd, void *data)
 #if DELAY_POOLS
     delay_id delay_id = delayMostBytesAllowed(entry->mem_obj);
 #endif
+    if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+       comm_close(fd);
+       return;
+    }
     /* check if we want to defer reading */
     errno = 0;
     read_sz = SQUID_TCP_SO_RCVBUF;
@@ -920,5 +924,5 @@ httpSendRequestEntry(int fd, char *bufnotused, size_t size, int errflag, void *d
        comm_close(fd);
        return;
     }
-    pumpStart(fd, entry, httpState->orig_request, httpSendComplete, httpState);
+    pumpStart(fd, httpState->fwd, httpSendComplete, httpState);
 }
index a259d182e2a9a9450cfb2217249101d0f3cbeac8..df649b2f5f792fdd379ddf3e8a33ec17fbf79ea4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.300 1999/01/11 22:54:20 wessels Exp $
+ * $Id: protos.h,v 1.301 1999/01/12 15:47:54 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -966,7 +966,7 @@ extern void PrintRusage(void);
 extern void dumpMallocStats(void);
 
 extern void pumpInit(int fd, request_t * r, char *uri);
-extern void pumpStart(int, StoreEntry *, request_t *, CWCB * callback, void *);
+extern void pumpStart(int, FwdState *, CWCB * callback, void *);
 extern int pumpMethod(method_t method);
 extern int pumpRestart(request_t *);
 
index 294ba834ce597bad6a1fd189b5efff2c20581e0b..a9fe594f9a7f1c982efdb78b46b68906f882b8a0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.477 1999/01/11 21:55:43 wessels Exp $
+ * $Id: store.cc,v 1.478 1999/01/12 15:47:56 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -399,6 +399,7 @@ storeAppend(StoreEntry * e, const char *buf, int len)
     MemObject *mem = e->mem_obj;
     assert(mem != NULL);
     assert(len >= 0);
+    assert(e->store_status == STORE_PENDING);
     if (len) {
        debug(20, 5) ("storeAppend: appending %d bytes for '%s'\n",
            len,
@@ -597,6 +598,7 @@ storeAbort(StoreEntry * e, int cbflag)
     storeSetMemStatus(e, NOT_IN_MEMORY);
     /* No DISK swap for negative cached object */
     e->swap_status = SWAPOUT_NONE;
+    e->store_status = STORE_OK;
     /*
      * We assign an object length here.  The only other place we assign
      * the object length is in storeComplete()
index 6b85ea028833909fc6f31bdb859710345c5c7096..d86ff290b481f829ba6aef9690bbc33599e3c8e0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.124 1998/12/05 00:54:48 wessels Exp $
+ * $Id: wais.cc,v 1.125 1999/01/12 15:47:57 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -91,6 +91,10 @@ waisReadReply(int fd, void *data)
 #if DELAY_POOLS
     delay_id delay_id = delayMostBytesAllowed(entry->mem_obj);
 #endif
+    if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+        comm_close(fd);
+        return;
+    }
     errno = 0;
     read_sz = 4096;
 #if DELAY_POOLS