// To resolve this we will force DIRECT and only to the original client destination.
// In which case, we also need this ACL to accurately match the destination
if (Config.onoff.client_dst_passthru && (checklist->request->flags.intercepted || checklist->request->flags.interceptTproxy)) {
- assert(checklist->conn() && checklist->conn()->clientConnection != NULL);
- return ACLIP::match(checklist->conn()->clientConnection->local);
+ const ConnStateData *conn = checklist->conn();
+ return (conn != NULL && conn->clientConnection != NULL) ?
+ ACLIP::match(conn->clientConnection->local) : -1;
}
if (flags.isSet(ACL_F_NO_LOOKUP)) {
ConnStateData *
ACLFilledChecklist::conn() const
{
- return conn_;
+ return cbdataReferenceValid(conn_) ? conn_ : NULL;
}
void
int
ACLFilledChecklist::fd() const
{
- return (conn_ != NULL && conn_->clientConnection != NULL) ? conn_->clientConnection->fd : fd_;
+ const ConnStateData *c = conn();
+ return (c != NULL && c->clientConnection != NULL) ? c->clientConnection->fd : fd_;
}
void
ACLFilledChecklist::fd(int aDescriptor)
{
- assert(!conn() || conn()->clientConnection == NULL || conn()->clientConnection->fd == aDescriptor);
+ const ConnStateData *c = conn();
+ assert(!c || !c->clientConnection || c->clientConnection->fd == aDescriptor);
fd_ = aDescriptor;
}