This patch allow an ACLList destroy itself after check is complete.
If there is asyncInProgress() when the request is being destroyed, then let acl
checklist destroy it self once the check is done.
Patch provided by Gonzalo Arana.
/*
- * $Id: ACLChecklist.cc,v 1.31 2006/02/18 00:23:43 wessels Exp $
+ * $Id: ACLChecklist.cc,v 1.32 2006/04/02 11:58:38 serassio Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
debug (28,3)("ACLChecklist::asyncInProgress: %p async set to %d\n", this, async_);
}
+void
+ACLChecklist::markDeleteWhenDone()
+{
+ deleteWhenDone = true;
+}
+
bool
ACLChecklist::finished() const
{
if (!nodeMatched || state_ != NullState::Instance()) {
debug(28, 3) ("aclmatchAclList: %p returning false (AND list entry failed to match)\n", this);
checkForAsync();
+
+ if (deleteWhenDone && !asyncInProgress())
+ delete this;
+
PROF_stop(aclMatchAclList);
+
return;
}
conn_(NULL),
async_(false),
finished_(false),
+ deleteWhenDone(false),
allow_(ACCESS_DENIED),
state_(NullState::Instance()),
destinationDomainChecked_(false),
/*
- * $Id: ACLChecklist.h,v 1.21 2005/04/30 19:32:01 serassio Exp $
+ * $Id: ACLChecklist.h,v 1.22 2006/04/02 11:58:38 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
bool asyncInProgress() const;
void asyncInProgress(bool const);
+ void markDeleteWhenDone();
bool finished() const;
void markFinished();
void check();
ConnStateData::Pointer conn_; /* hack for ident and NTLM */
bool async_;
bool finished_;
+ bool deleteWhenDone;
allow_t allow_;
AsyncState *state_;
bool destinationDomainChecked_;
/*
- * $Id: client_side_request.cc,v 1.59 2006/03/02 22:47:07 wessels Exp $
+ * $Id: client_side_request.cc,v 1.60 2006/04/02 11:58:38 serassio Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
if (http)
cbdataReferenceDone(http);
- if (acl_checklist)
- delete acl_checklist;
+ if (acl_checklist) {
+ if (acl_checklist->asyncInProgress()) {
+ acl_checklist->markDeleteWhenDone();
+ } else {
+ delete acl_checklist;
+ }
+ }
}
ClientRequestContext::ClientRequestContext(ClientHttpRequest *anHttp) : http(anHttp), acl_checklist (NULL), redirect_state (REDIRECT_NONE)