]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
more audit fixes
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 23 Sep 2010 15:29:53 +0000 (03:29 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 23 Sep 2010 15:29:53 +0000 (03:29 +1200)
src/comm/ConnOpener.cc
src/comm/Connection.cc

index 7c6aa3fd6d7b262be46af1d34ee71b13e9d183d8..81bed1997a4acc8cecd2441aca209954fd169d01 100644 (file)
@@ -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();
     }
 
index b8987e82a7a7a40e442658ef300ded040a697b18..f71f8db52516c7479b0c50e3cf82057467142b12 100644 (file)
@@ -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);
     }