------------------------------------------------------------ revno: 13975 revision-id: squid3@treenet.co.nz-20160131052231-6i0edxcrr2pyhh4v parent: squid3@treenet.co.nz-20160106143207-abcdxzy3fqbr7rew fixes bug: http://bugs.squid-cache.org/show_bug.cgi?id=4378 author: Eduard Bagdasaryan committer: Amos Jeffries branch nick: 3.5 timestamp: Sun 2016-01-31 18:22:31 +1300 message: Bug 4378: assertion failed: DestinationIp.cc:60: 'checklist->conn() && checklist->conn()->clientConnection != NULL' ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20160131052231-6i0edxcrr2pyhh4v # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 742b792bc61240ac59ae1ff97a95906270f2ff24 # timestamp: 2016-01-31 05:28:41 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20160106143207-\ # abcdxzy3fqbr7rew # # Begin patch === modified file 'src/acl/DestinationIp.cc' --- src/acl/DestinationIp.cc 2016-01-01 00:14:27 +0000 +++ src/acl/DestinationIp.cc 2016-01-31 05:22:31 +0000 @@ -38,8 +38,9 @@ // 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)) { === modified file 'src/acl/FilledChecklist.cc' --- src/acl/FilledChecklist.cc 2016-01-01 00:14:27 +0000 +++ src/acl/FilledChecklist.cc 2016-01-31 05:22:31 +0000 @@ -69,7 +69,7 @@ ConnStateData * ACLFilledChecklist::conn() const { - return conn_; + return cbdataReferenceValid(conn_) ? conn_ : NULL; } void @@ -84,13 +84,15 @@ 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; }