From: wessels <> Date: Tue, 6 Dec 2005 07:01:23 +0000 (+0000) Subject: Bugzilla #1457 X-Git-Tag: SQUID_3_0_PRE4~466 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a546b04bd9c6770fc35bafaa8709335664caef2c;p=thirdparty%2Fsquid.git 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. --- 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 ... */