Skip to content

Commit

Permalink
WL#15130 Socket-level TLS patch #1: class NdbSocket
Browse files Browse the repository at this point in the history
Post push fix.

Make NdbSocket::ssl_readln return 0 on timeout.

Change-Id: I4cad95abd319883c16f2c28eff5cf2b6761731d6
  • Loading branch information
zmur committed Aug 23, 2023
1 parent 67d9af1 commit e4b3dde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion storage/ndb/src/common/util/NdbSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,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);
Expand All @@ -469,6 +470,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;
}

Expand Down

0 comments on commit e4b3dde

Please sign in to comment.