]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1952: assertion failed: forward.cc:268: "entry->store_status == STORE_PENDING"
authorhno <>
Tue, 20 Jun 2006 04:49:59 +0000 (04:49 +0000)
committerhno <>
Tue, 20 Jun 2006 04:49:59 +0000 (04:49 +0000)
was caused by missing handler for aborted requests.

patch by Gonzalo Arana

src/forward.cc
src/forward.h

index 8cb013696f87b5cdb255043171f5945a9b215a10..f3f9fcd68aa42eb033d8ee7cde2c6f95f7edad3f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.145 2006/05/29 00:15:02 robertc Exp $
+ * $Id: forward.cc,v 1.146 2006/06/19 22:49:59 hno Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -70,6 +70,19 @@ static Logfile *logfile = NULL;
 static PconnPool *fwdPconnPool = new PconnPool("server-side");
 CBDATA_CLASS_INIT(FwdState);
 
+void
+FwdState::abort(void* d)
+{
+    FwdState* fwd = (FwdState*)d;
+
+    if (fwd->server_fd >= 0) {
+        comm_close(fwd->server_fd);
+        fwd->server_fd = -1;
+    }
+
+    fwd->self = NULL;
+}
+
 /**** PUBLIC INTERFACE ********************************************************/
 
 FwdState::FwdState(int fd, StoreEntry * e, HttpRequest * r)
@@ -86,6 +99,8 @@ FwdState::FwdState(int fd, StoreEntry * e, HttpRequest * r)
     EBIT_SET(e->flags, ENTRY_FWD_HDR_WAIT);
 
     self = this;       // refcounted
+
+    storeRegisterAbort(e, FwdState::abort, this);
 }
 
 FwdState::~FwdState()
@@ -122,6 +137,8 @@ FwdState::~FwdState()
     if (err)
         errorStateFree(err);
 
+    storeUnregisterAbort(entry);
+
     entry->unlock();
 
     entry = NULL;
index 64b349623a7138817f0c41359c73ac68a8fa214d..cfc0543a09c79f0bcd43bdbc6b36a8d3d4c06064 100644 (file)
@@ -68,6 +68,7 @@ public:
     HttpRequest *request;
     int server_fd;
     FwdServer *servers;
+    static void abort(void*);
 
 private:
     CBDATA_CLASS2(FwdState);