From bfdd367463a734b157909dbf252cc0802f216dac Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 24 Sep 2010 03:29:53 +1200 Subject: [PATCH] more audit fixes --- src/comm/ConnOpener.cc | 5 +++-- src/comm/Connection.cc | 9 ++------- 2 files changed, 5 insertions(+), 9 deletions(-) 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); } -- 2.47.2