Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.6.x' into candidate-…
Browse files Browse the repository at this point in the history
…9.6.4

Signed-off-by: Jake Smith <[email protected]>

# Conflicts:
#	helm/hpcc/Chart.yaml
#	helm/hpcc/templates/_helpers.tpl
#	helm/hpcc/templates/dafilesrv.yaml
#	helm/hpcc/templates/dali.yaml
#	helm/hpcc/templates/dfuserver.yaml
#	helm/hpcc/templates/eclagent.yaml
#	helm/hpcc/templates/eclccserver.yaml
#	helm/hpcc/templates/eclscheduler.yaml
#	helm/hpcc/templates/esp.yaml
#	helm/hpcc/templates/localroxie.yaml
#	helm/hpcc/templates/roxie.yaml
#	helm/hpcc/templates/sasha.yaml
#	helm/hpcc/templates/thor.yaml
#	version.cmake
  • Loading branch information
jakesmith committed Apr 15, 2024
2 parents 34875d0 + 931ee83 commit c9853ef
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
13 changes: 8 additions & 5 deletions fs/dafsserver/dafsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5604,7 +5604,7 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface
eps.getEndpointHostText(peerURL);
PROGLOG("Server accepting from %s", peerURL.str());
#endif
addClient(sock.getClear(), false);
addClient(sock.getClear(), false, false);
}

if (securesockavail)
Expand All @@ -5614,7 +5614,7 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface
eps.getEndpointHostText(peerURL.clear());
PROGLOG("Server accepting SECURE from %s", peerURL.str());
#endif
addClient(sockSSL.getClear(), false);
addClient(sockSSL.getClear(), true, false);
}

if (rowServiceSockAvail)
Expand All @@ -5624,7 +5624,7 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface
eps.getEndpointHostText(peerURL.clear());
PROGLOG("Server accepting row service socket from %s", peerURL.str());
#endif
addClient(acceptedRSSock.getClear(), true);
addClient(acceptedRSSock.getClear(), true, true);
}
}
else
Expand All @@ -5648,15 +5648,18 @@ class CRemoteFileServer : implements IRemoteFileServer, public CInterface
sendDaFsBuffer(socket, reply, hasMask(cmdFlags, CommandRetFlags::testSocket));
}

void addClient(ISocket *sock, bool rowService) // rowService used to distinguish client calls
void addClient(ISocket *sock, bool secure, bool rowService) // rowService used to distinguish client calls
{
Owned<CRemoteClientHandler> client = new CRemoteClientHandler(this, sock, globallasttick, rowService);
{
CriticalBlock block(sect);
clients.append(*client.getLink());
}
// JCSMORE - perhaps cap # added here... ?
selecthandler->add(sock, SELECTMODE_READ, client);
unsigned mode = SELECTMODE_READ;
if (secure)
mode |= SELECTMODE_WRITE;
selecthandler->add(sock, mode, client);
}

void stop()
Expand Down
2 changes: 1 addition & 1 deletion system/mp/mpcomm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ bool CMPConnectThread::handleAcceptedSocket(ISocket *_sock, unsigned timeoutMs,
// NB: min size is ConnectHdr.id for legacy clients, can thus distinguish old from new
try
{
traceSlowReadTms("MP: initial accept packet from", _sock, &connectHdr, sizeof(connectHdr.id), sizeof(connectHdr), rd, timeoutMs, CONFIRM_TIMEOUT_INTERVAL);
traceSlowReadTms("MP: initial accept packet from", sock, &connectHdr, sizeof(connectHdr.id), sizeof(connectHdr), rd, timeoutMs, CONFIRM_TIMEOUT_INTERVAL);
}
catch (IJSOCK_Exception *e)
{
Expand Down
23 changes: 19 additions & 4 deletions system/security/securesocket/securesocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,27 @@ CSecureSocket::CSecureSocket(ISocket* sock, int sockfd, ISecureSocketContextCall
m_peers = peers;;
m_loglevel = loglevel;
m_isSecure = false;

nonBlocking = false;
#if defined(O_NONBLOCK)
int flags = fcntl(sockfd, F_GETFL, 0);
if (-1 == flags) // unknown
nonBlocking = false;
else
if (-1 != flags)
nonBlocking = 0 != (flags & O_NONBLOCK);

#elif defined(_WIN32)
u_long flags;
if (ioctlsocket(sockfd, FIONBIO, &flags)==0)
{
if (flags)
nonBlocking = true;
}
#else
int flags;
if (ioctl(sock, FIONBIO, &flags)==0)
{
if (flags)
nonBlocking = true;
}
#endif
if(m_ssl == NULL)
{
throw MakeStringException(-1, "Can't create ssl");
Expand Down

0 comments on commit c9853ef

Please sign in to comment.