Skip to content

Commit

Permalink
HPCC-31474 modify secure set_nonblock impl.
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Apr 3, 2024
1 parent ed43474 commit 7b8c265
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions system/security/securesocket/securesocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,13 @@ class CSecureSocket : implements ISecureSocket, public CInterface
//
virtual bool set_nonblock(bool on) // returns old state
{
bool prevState = m_socket->set_nonblock(on);
int flags = fcntl(SSL_get_fd(m_ssl), F_GETFL, 0);
if (-1 != flags)
nonBlocking = 0 != (flags & O_NONBLOCK);
return prevState;
if (on == nonBlocking)
return nonBlocking;
if (on == m_socket->set_nonblock(on)) // this call should return opposite state, if it doesn't it failed
return nonBlocking;

nonBlocking = on;
return !nonBlocking; // previous state
}

// enable 'nagling' - small packet coalescing (implies delayed transmission)
Expand Down

0 comments on commit 7b8c265

Please sign in to comment.