From de0ff0f571d37716fa60bc2b1f4df8d6ab10d81b Mon Sep 17 00:00:00 2001 From: Mauritz Sundell Date: Fri, 18 Aug 2023 16:29:03 +0200 Subject: [PATCH] WL#15130 Socket-level TLS patch #1: class NdbSocket Post push fix. Make NdbSocket::ssl_readln return 0 on timeout. Change-Id: I4cad95abd319883c16f2c28eff5cf2b6761731d6 --- storage/ndb/src/common/util/NdbSocket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/common/util/NdbSocket.cpp b/storage/ndb/src/common/util/NdbSocket.cpp index b116e13e2a96..7ee49dd8fcd5 100644 --- a/storage/ndb/src/common/util/NdbSocket.cpp +++ b/storage/ndb/src/common/util/NdbSocket.cpp @@ -431,7 +431,8 @@ int NdbSocket::ssl_readln(int timeout, int * elapsed, Timer t(elapsed); result = poll_readable(timeout); } - if(result <= 0) return -1; + if(result == 0) return 0; // timeout + if(result < 0) return -1; /* Read until a complete line is available, eof, or timeout */ TlsLineReader reader(*this, buf, len, heldMutex); @@ -448,6 +449,7 @@ int NdbSocket::ssl_readln(int timeout, int * elapsed, } while(! (reader.error() || (*elapsed >= timeout))); Debug_Log("ssl_readln => -1 [ELAPSED: %d]", *elapsed); + if (*elapsed >= timeout) return 0; return -1; }