From 3f76392c130fbfa4d727bceae762bdc47abe0279 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Mon, 11 Nov 2024 15:47:13 +0000 Subject: [PATCH] HPCC-32960 review changes Signed-off-by: Jake Smith --- system/jlib/jsocket.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/system/jlib/jsocket.cpp b/system/jlib/jsocket.cpp index 9a3c7048949..7e341db5c2d 100644 --- a/system/jlib/jsocket.cpp +++ b/system/jlib/jsocket.cpp @@ -4800,9 +4800,12 @@ class CSocketSelectThread: public CSocketBaseThread unsigned n=0; ForEachItemIn(i,items) { SelectItem &si = items.element(i); - if (!si.del) { - if (si.sock==sock) { + if (!si.del) + { + if (si.sock==sock) + { si.del = true; + break; } else n++; @@ -5524,6 +5527,7 @@ class CSocketEpollThread: public CSocketBaseThread { si.del = true; rm = SOCK_REMOVED; + break; } else n++; @@ -5828,7 +5832,7 @@ class CSocketEpollHandler: implements ISocketSelectHandler, public CInterface addrm |= threads.item(i).add(sock,mode,nfy); // if both added and removed, we're done if (((addrm & (SOCK_ADDED | SOCK_REMOVED)) == (SOCK_ADDED | SOCK_REMOVED)) || - (addrm == SOCK_FAILED)) + (addrm & SOCK_FAILED)) return; } else if (!(addrm & SOCK_REMOVED))