]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fixup: Found/marked more Connection ownership/handling rule violations
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 30 Jul 2021 22:36:31 +0000 (18:36 -0400)
committerAlex Rousskov <rousskov@measurement-factory.com>
Sat, 31 Jul 2021 15:48:52 +0000 (11:48 -0400)
src/HappyConnOpener.cc
src/PeerPoolMgr.cc
src/ident/Ident.cc
src/servers/FtpServer.cc

index 30d5100c2355bfc4ea41c9a0a4903dd3af25c021..baf3122c18779299dda73eff593550e37c6d565e 100644 (file)
@@ -577,6 +577,7 @@ HappyConnOpener::openFreshConnection(Attempt &attempt, PeerConnectionPointer &de
     if (!dest->getPeer())
         cs->setHost(host_);
 
+    // XXX: Do not co-own attempt.path with ConnOpener.
     attempt.path = dest;
     attempt.connWait.start(cs, callConnect);
 
@@ -731,6 +732,8 @@ HappyConnOpener::checkForNewConnection()
     if (!destinations->empty()) {
         if (!currentPeer) {
             auto newPrime = destinations->extractFront();
+            // XXX: Do not co-own currentPeer Connection with ConnOpener
+            // (which is activated via startConnecting() below).
             currentPeer = newPrime;
             Must(currentPeer);
             debugs(17, 7, "new peer " << *currentPeer);
index cc09b12302443823c615c7a6c390cdb28194ba13..745669706996b27710d2487d80aaf6f83eafe439 100644 (file)
@@ -121,6 +121,7 @@ PeerPoolMgr::handleOpenedConnection(const CommConnectCbParams &params)
         const auto connector = new Security::BlindPeerConnector(request, params.conn, callback, nullptr, timeLeft);
         encryptionWait.start(connector, callback);
         AsyncJob::Start(connector); // will call our callback
+        // XXX: Exceptions orphan params.conn
         return;
     }
 
index a9f1bc3efa69e2bc5b99bcadd81eee080496cd4e..d796e9ed1c1d3575c9b819ae7252a66f786fb71d 100644 (file)
@@ -271,6 +271,8 @@ Ident::Start(const Comm::ConnectionPointer &conn, IDCB * callback, void *data)
     state = new IdentStateData;
     state->hash.key = xstrdup(key);
 
+    // XXX: Do not co-own state->conn Connection with ConnOpener.
+
     // copy the conn details. We do not want the original FD to be re-used by IDENT.
     state->conn = conn->cloneIdentDetails();
     // NP: use random port for secure outbound to IDENT_PORT
index 5fb97398481cb0f84f73a2b5bf369bf816a6fbb3..641ced5fd994da044da877d13f85d5aab2202b0f 100644 (file)
@@ -1676,6 +1676,8 @@ Ftp::Server::checkDataConnPre()
         return false;
     }
 
+    // XXX: Do not co-own dataConn with ConnOpener.
+
     // active transfer: open a data connection from Squid to client
     typedef CommCbMemFunT<Server, CommConnectCbParams> Dialer;
     AsyncCall::Pointer callback = JobCallback(17, 3, Dialer, this, Ftp::Server::connectedForData);