From: hno <> Date: Tue, 20 Jun 2006 04:49:59 +0000 (+0000) Subject: Bug #1952: assertion failed: forward.cc:268: "entry->store_status == STORE_PENDING" X-Git-Tag: SQUID_3_0_PRE4~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=429871db826f45e65f6be6c3ec8a4b3074359ab4;p=thirdparty%2Fsquid.git Bug #1952: assertion failed: forward.cc:268: "entry->store_status == STORE_PENDING" was caused by missing handler for aborted requests. patch by Gonzalo Arana --- diff --git a/src/forward.cc b/src/forward.cc index 8cb013696f..f3f9fcd68a 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -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; diff --git a/src/forward.h b/src/forward.h index 64b349623a..cfc0543a09 100644 --- a/src/forward.h +++ b/src/forward.h @@ -68,6 +68,7 @@ public: HttpRequest *request; int server_fd; FwdServer *servers; + static void abort(void*); private: CBDATA_CLASS2(FwdState);