]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed up *Timeout() functions. We might get fooTimeout() called
authorwessels <>
Thu, 21 Jan 1999 02:27:08 +0000 (02:27 +0000)
committerwessels <>
Thu, 21 Jan 1999 02:27:08 +0000 (02:27 +0000)
when the entry has been ENTRY_ABORTED because the abort callback
comes in an event, not immediately.  Also, fooTimeout() now uses
fwdFail instead of building its own error page.

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

index c902d00d943630af25459a386ebcb5eb9567372d..785e74ee11482f4e2b6c81c8be005c9b39eb8501 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.270 1999/01/20 03:02:48 wessels Exp $
+ * $Id: ftp.cc,v 1.271 1999/01/20 19:27:08 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -318,15 +318,13 @@ ftpTimeout(int fd, void *data)
 {
     FtpStateData *ftpState = data;
     StoreEntry *entry = ftpState->entry;
-    ErrorState *err;
     debug(9, 4) ("ftpTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
-    if (entry->store_status == STORE_PENDING) {
-       if (entry->mem_obj->inmem_hi == 0) {
-           err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT);
-           err->request = requestLink(ftpState->request);
-           errorAppendEntry(entry, err);
-       }
-    }
+    if (entry->store_status == STORE_PENDING) { 
+        if (entry->mem_obj->inmem_hi == 0) {
+            fwdFail(ftpState->fwd,
+                errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+        }   
+    }   
     if (ftpState->data.fd > -1) {
        comm_close(ftpState->data.fd);
        ftpState->data.fd = -1;
index 2d7da885a23e1e3e1e1e982b067ec9033b67ebab..888b6179aa7d140c1930cacdac4e087a3d7a4004 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: gopher.cc,v 1.147 1999/01/19 02:24:26 wessels Exp $
+ * $Id: gopher.cc,v 1.148 1999/01/20 19:27:11 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -575,13 +575,13 @@ gopherTimeout(int fd, void *data)
 {
     GopherStateData *gopherState = data;
     StoreEntry *entry = gopherState->entry;
-    ErrorState *err;
     debug(10, 4) ("gopherTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
-    if (entry->mem_obj->inmem_hi == 0) {
-       err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT);
-       err->url = xstrdup(gopherState->request);
-       errorAppendEntry(entry, err);
-    }
+    if (entry->store_status == STORE_PENDING) { 
+        if (entry->mem_obj->inmem_hi == 0) {
+            fwdFail(gopherState->fwdState,
+                errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+        }   
+    }   
     comm_close(fd);
 }
 
index 2156ad6bfd8d65a70ed350ca40201afe46e1c756..60b1768916d23c88afdcc31f888adb0056707e59 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.343 1999/01/19 23:17:58 wessels Exp $
+ * $Id: http.cc,v 1.344 1999/01/20 19:27:10 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -90,10 +90,11 @@ httpTimeout(int fd, void *data)
     HttpStateData *httpState = data;
     StoreEntry *entry = httpState->entry;
     debug(11, 4) ("httpTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
-    assert(entry->store_status == STORE_PENDING);
-    if (entry->mem_obj->inmem_hi == 0) {
-       fwdFail(httpState->fwd,
-           errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+    if (entry->store_status == STORE_PENDING) {
+       if (entry->mem_obj->inmem_hi == 0) {
+           fwdFail(httpState->fwd,
+               errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+       }
     }
     comm_close(fd);
 }
index fd50dded45a6bcf069a4bdc198cd0c7317d4f276..68a683dbf9320d3df0eae49bfa41cfdc3b248b87 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.129 1999/01/19 02:24:36 wessels Exp $
+ * $Id: wais.cc,v 1.130 1999/01/20 19:27:12 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -67,12 +67,14 @@ static void
 waisTimeout(int fd, void *data)
 {
     WaisStateData *waisState = data;
-    ErrorState *err;
     StoreEntry *entry = waisState->entry;
     debug(24, 4) ("waisTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
-    err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT);
-    err->request = requestLink(waisState->request);
-    errorAppendEntry(entry, err);
+    if (entry->store_status == STORE_PENDING) { 
+        if (entry->mem_obj->inmem_hi == 0) {
+            fwdFail(waisState->fwd,
+                errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+        }   
+    }   
     comm_close(fd);
 }