From: wessels <> Date: Sun, 7 May 2006 21:13:24 +0000 (+0000) Subject: Backed out change where clientReplyContext held a FwdState::Pointer. X-Git-Tag: SQUID_3_0_PRE4~180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be0c6690d56a9a9563586f835e190bc5cd8497dd;p=thirdparty%2Fsquid.git Backed out change where clientReplyContext held a FwdState::Pointer. That change was to fix problems with re-forwarded reqeusts where the FwdState refcount would go to zero. But it also introduced a new bug where errors would not be sent to clients because the refcount did NOT go to zero. --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 8c10027ba6..de5dae337c 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.103 2006/05/06 22:13:18 wessels Exp $ + * $Id: client_side_reply.cc,v 1.104 2006/05/07 15:13:24 wessels Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -80,7 +80,6 @@ clientReplyContext::~clientReplyContext() safe_free(tempBuffer.data); cbdataReferenceDone(http); HTTPMSGUNLOCK(reply); - fwd = NULL; // refcounted } clientReplyContext::clientReplyContext(ClientHttpRequest *clientContext) : http (cbdataReference(clientContext)), old_entry (NULL), old_sc(NULL), deleting(false) @@ -273,9 +272,9 @@ clientReplyContext::processExpired() * A refcounted pointer so that FwdState stays around as long as * this clientReplyContext does */ - fwd = FwdState::fwdStart(http->getConn().getRaw() != NULL ? http->getConn()->fd : -1, - http->storeEntry(), - http->request); + FwdState::fwdStart(http->getConn().getRaw() != NULL ? http->getConn()->fd : -1, + http->storeEntry(), + http->request); /* Register with storage manager to receive updates when data comes in. */ if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) @@ -842,9 +841,9 @@ clientReplyContext::processMiss() if (http->flags.internal) r->protocol = PROTO_INTERNAL; - fwd = FwdState::fwdStart(http->getConn().getRaw() != NULL ? http->getConn()->fd : -1, - http->storeEntry(), - r); + FwdState::fwdStart(http->getConn().getRaw() != NULL ? http->getConn()->fd : -1, + http->storeEntry(), + r); } } diff --git a/src/client_side_reply.h b/src/client_side_reply.h index dda25ae70d..121f9de90c 100644 --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.h,v 1.11 2006/05/05 21:33:56 wessels Exp $ + * $Id: client_side_reply.h,v 1.12 2006/05/07 15:13:24 wessels Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -138,7 +138,6 @@ private: void startSendProcess(); StoreIOBuffer holdingBuffer; HttpReply *reply; - FwdState::Pointer fwd; void processReplyAccess(); static PF ProcessReplyAccessResult; void processReplyAccessResult(bool accessAllowed); diff --git a/src/forward.cc b/src/forward.cc index dc420957f7..68c247b814 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.139 2006/05/05 21:33:56 wessels Exp $ + * $Id: forward.cc,v 1.140 2006/05/07 15:13:24 wessels Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -137,7 +137,7 @@ FwdState::~FwdState() * a transaction. It is a static method that may or may not * allocate a FwdState. */ -FwdState * +void FwdState::fwdStart(int client_fd, StoreEntry *entry, HttpRequest *request) { /* @@ -174,7 +174,7 @@ FwdState::fwdStart(int client_fd, StoreEntry *entry, HttpRequest *request) errorAppendEntry(entry, anErr); // frees anErr - return NULL; + return; } } @@ -194,27 +194,27 @@ FwdState::fwdStart(int client_fd, StoreEntry *entry, HttpRequest *request) ErrorState *anErr = errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE); anErr->request = HTTPMSGLOCK(request); errorAppendEntry(entry, anErr); // frees anErr - return NULL; + return; } switch (request->protocol) { case PROTO_INTERNAL: internalStart(request, entry); - return NULL; + return; case PROTO_CACHEOBJ: cachemgrStart(client_fd, request, entry); - return NULL; + return; case PROTO_URN: urnStart(request, entry); - return NULL; + return; default: FwdState *fwd = new FwdState(client_fd, entry, request); peerSelect(request, entry, fwdStartCompleteWrapper, fwd); - return fwd; + return; } /* NOTREACHED */ diff --git a/src/forward.h b/src/forward.h index 44a806484e..12866d0296 100644 --- a/src/forward.h +++ b/src/forward.h @@ -19,7 +19,7 @@ public: ~FwdState(); static void initModule(); - static FwdState * fwdStart(int fd, StoreEntry *, HttpRequest *); + static void fwdStart(int fd, StoreEntry *, HttpRequest *); void startComplete(FwdServer *); void startFail(); void fail(ErrorState *err);