From: Amos Jeffries Date: Thu, 23 Sep 2010 15:29:53 +0000 (+1200) Subject: more audit fixes X-Git-Tag: take08~55^2~124^2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfdd367463a734b157909dbf252cc0802f216dac;p=thirdparty%2Fsquid.git more audit fixes --- diff --git a/src/comm/ConnOpener.cc b/src/comm/ConnOpener.cc index 7c6aa3fd6d..81bed1997a 100644 --- a/src/comm/ConnOpener.cc +++ b/src/comm/ConnOpener.cc @@ -61,11 +61,12 @@ Comm::ConnOpener::swanSong() calls_.timeout_ = NULL; } - // recover what we can from the job + // rollback what we can from the job state if (conn_ != NULL && conn_->isOpen()) { - // it never reached fully open, so abort the FD + // drop any handlers now to save a lot of cycles later commSetSelect(conn_->fd, COMM_SELECT_WRITE, NULL, NULL, 0); commSetTimeout(conn_->fd, -1, NULL, NULL); + // it never reached fully open, so abort the FD conn_->close(); } diff --git a/src/comm/Connection.cc b/src/comm/Connection.cc index b8987e82a7..f71f8db525 100644 --- a/src/comm/Connection.cc +++ b/src/comm/Connection.cc @@ -23,8 +23,7 @@ Comm::Connection::Connection() : Comm::Connection::~Connection() { close(); - if (getPeer()) - cbdataReferenceDone(_peer); + cbdataReferenceDone(_peer); } Comm::ConnectionPointer @@ -74,11 +73,7 @@ Comm::Connection::setPeer(peer *p) if (getPeer() == p) return; - /* clear any previous ptr */ - if (getPeer()) - cbdataReferenceDone(_peer); - - /* set the new one (unless it is NULL */ + cbdataReferenceDone(_peer); if (p) { _peer = cbdataReference(p); }