Browse Source

HPCC-24829 Client should discard persistent connection for unexpected data

- Remove the connection from re-usable pool when unexpected and
  unsolicited data detected on it

Signed-off-by: Yanrui Ma <yanrui.ma@lexisnexisrisk.com>
Yanrui Ma 4 years ago
parent
commit
d629e2d2eb
1 changed files with 6 additions and 0 deletions
  1. 6 0
      common/thorhelper/persistent.cpp

+ 6 - 0
common/thorhelper/persistent.cpp

@@ -368,6 +368,12 @@ public:
             if (!ignore)
                 m_notify->notifySelected(sock, selected, this, reachedQuota);
         }
+        else
+        {
+            PERSILOG(PersistentLogLevel::PLogNormal, "PERSISTENT: Unexpected data received on connection %d, so discard the connection.", sock->OShandle());
+            remove(sock);
+        }
+
         return false;
     }