From: wessels <> Date: Thu, 12 Apr 2007 11:03:54 +0000 (+0000) Subject: Fix some HttpMsg lock counting bugs in HTCP. X-Git-Tag: SQUID_3_0_PRE6~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8def95fc057513fa2d3144772ea6918c2f4034f;p=thirdparty%2Fsquid.git Fix some HttpMsg lock counting bugs in HTCP. --- diff --git a/src/htcp.cc b/src/htcp.cc index 6763c2df02..90dc096230 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -1,6 +1,6 @@ /* - * $Id: htcp.cc,v 1.71 2006/11/04 14:15:22 hno Exp $ + * $Id: htcp.cc,v 1.72 2007/04/12 05:03:54 wessels Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -767,6 +767,9 @@ htcpUnpackSpecifier(char *buf, int sz) s->request = HttpRequest::CreateFromUrlAndMethod(s->uri, method == METHOD_NONE ? METHOD_GET : method); + if (s->request) + HTTPMSGLOCK(s->request); + return s; } @@ -862,7 +865,7 @@ htcpAccessCheck(acl_access * acl, htcpSpecifier * s, struct sockaddr_in *from) ACLChecklist checklist; checklist.src_addr = from->sin_addr; checklist.my_addr = no_addr; - checklist.request = s->request; + checklist.request = HTTPMSGLOCK(s->request); checklist.accessList = cbdataReference(acl); /* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */ int result = checklist.fastCheck(); @@ -1227,8 +1230,6 @@ htcpHandleTstRequest(htcpDataHeader * dhdr, char *buf, int sz, struct sockaddr_i return; } - HTTPMSGLOCK(s->request); - if (!htcpAccessCheck(Config.accessList.htcp, s, from)) { debug(31, 2) ("htcpHandleTstRequest: Access denied\n");