Skip to content
Snippets Groups Projects
Commit e5f64faf authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Log a critical error message if a node is WFC, but its socket is still in use

This should avoid/work-around issue #630

Nelgin's terminal server log indicated that the node's configuration was being
reloaded for a new client connection (which doesn't normally/always happen,
only when there's been a config file change or a node "rerun" requested),
while there was still a user online using that node. This would explain the
segfault (configuration fields being freed and reallocated).

The node_socket[] array indicates when a node thread is actively servicing
a client, so it should contain INVALID_SOCKET for the any node's that WFC.
If it doesn't, that means something/someone changed the node's status value
to 0 (WFC) in the node.dab file while the node was still in-use. Let's not
crash in this case and rather just log the message and give the client the
next available node (if any).
parent f9b0dda5
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4743 passed
......@@ -5490,6 +5490,12 @@ NO_SSH:
if(sbbs->getnodedat(i,&node,1)!=0)
continue;
if(node.status==NODE_WFC) {
if(node_socket[i - 1] != INVALID_SOCKET) {
lprintf(LOG_CRIT, "%04d !Node %d status is WFC, but the node socket (%d) and thread are still in use!"
,client_socket, i, node_socket[i - 1]);
sbbs->putnodedat(i, &node);
continue;
}
node.status=NODE_LOGON;
#ifdef USE_CRYPTLIB
if(ssh)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment