Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 2f8c56f7 authored by rswindell's avatar rswindell

Attempt to address multiple redundant SSH related error/log messages from

the output_thread which may occur after an SSH-related error in the input
thread, e.g.:
Sun Mar 25 2018 01:45 pm bbs.synchro.net
Node 6 SSH ERROR 'Bad argument, parameter 2' (-2) setting channel

Sun Mar 25 2018 01:45 pm bbs.synchro.net
Node 6 SSH ERROR 'Bad argument, parameter 2' (-2) setting channel

Sun Mar 25 2018 01:45 pm bbs.synchro.net
Node 6 SSH ERROR 'Bad argument, parameter 2' (-2) setting channel

Sun Mar 25 2018 01:45 pm bbs.synchro.net
Node 6 SSH ERROR 'Bad argument, parameter 2' (-2) setting channel

Sun Mar 25 2018 01:45 pm bbs.synchro.net
Node 6 SSH ERROR 'Bad argument, parameter 2' (-2) setting channel

Sun Mar 25 2018 01:45 pm bbs.synchro.net
Node 6 SSH ERROR 'Bad argument, parameter 2' (-2) setting channel

... by introducing a new sbbs_t member variable: terminate_output_thread
which is only set to true when the input_thread is terminating.

If there is any possibility that the input_thread could startup and get
an SSH error before the output_thread even starts, then we will want to
move the terminate_output_thread=false initialization to the sbbs_t
constructor.
parent b0f5a306
......@@ -2044,6 +2044,7 @@ void input_thread(void *arg)
sbbs->sys_status|=SS_ABORT; /* as though Ctrl-C were hit */
sbbs->input_thread_running = false;
sbbs->terminate_output_thread = true;
if(node_socket[sbbs->cfg.node_num-1]==INVALID_SOCKET) // Shutdown locally
sbbs->terminated = true; // Signal JS to stop execution
......@@ -2318,9 +2319,10 @@ void output_thread(void* arg)
}
}
#endif
sbbs->terminate_output_thread = false;
/* Note: do not terminate when online==FALSE, that is expected for the terminal server output_thread */
while(sbbs->client_socket!=INVALID_SOCKET && !terminate_server) {
while(sbbs->client_socket!=INVALID_SOCKET && !terminate_server && !sbbs->terminate_output_thread) {
/*
* I'd like to check the linear buffer against the highwater
* at this point, but it would get too clumsy imho - Deuce
......@@ -2328,7 +2330,7 @@ void output_thread(void* arg)
* Actually, another option would just be to have the size
* of the linear buffer equal to the MSS... any larger and
* you could have small sends off the end. this would
* probobly be even clumbsier
* probably be even clumsier
*/
if(bufbot == buftop) {
/* Wait for something to output in the RingBuffer */
......
......@@ -380,6 +380,7 @@ public:
bool event_thread_running;
bool output_thread_running;
bool input_thread_running;
bool terminate_output_thread;
#ifdef JAVASCRIPT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment