From a546b04bd9c6770fc35bafaa8709335664caef2c Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 6 Dec 2005 07:01:23 +0000 Subject: [PATCH] Bugzilla #1457 My changes to the way that the client-side performed http_access, redirector, and no_cache checks introduced a serious bug. Using any proxy authentication would crash Squid. One problem was that clientAccessCheckDone() should have returned after generating the error page. Instead it tried to keep going, as though access were allowed. The other problem was due to a recently added assertion, which was incorrect. Instead of asserting, the ClientRequestContext destructor now releases its lock on the parent ClientHttpRequest if necessary. --- src/client_side_request.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 4ef3d78247..2b00457b84 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.cc,v 1.53 2005/12/03 18:00:28 wessels Exp $ + * $Id: client_side_request.cc,v 1.54 2005/12/06 00:01:23 wessels Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -103,11 +103,12 @@ static void checkFailureRatio(err_type, hier_code); ClientRequestContext::~ClientRequestContext() { /* - * Note: ClientRequestContext is only deleted by its parent, - * ClientHttpRequest. That can only happen after ClientRequestContext - * calls cbdataReferenceDone(http) + * Release our "lock" on our parent, ClientHttpRequest, if we + * still have one */ - assert(NULL == http); + + if (http) + cbdataReferenceDone(http); if (acl_checklist) delete acl_checklist; @@ -451,6 +452,7 @@ ClientRequestContext::clientAccessCheckDone(int answer) auth_user_request : http->request->auth_user_request); node = (clientStreamNode *)http->client_stream.tail->data; clientStreamRead(node, http, node->readBuffer); + return; } /* ACCESS_ALLOWED continues here ... */ -- 2.47.3