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

Eliminate the global 'sbbs' here, was masking bugs

I'm not sure what purpose this global variable once had, but it wasn't needed
now and it was masking copy/paste issues in some of the sbbs_t methods in this
file. Just make an 'sbbs' local to bbs_thread(), since there's where it's
legit-used.

FYI: All the Cryptlib-SSH macros assume there's an 'sbbs' in scope.
parent 5231996f
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ SOCKET uspy_socket[MAX_NODES]; /* UNIX domain spy sockets */ ...@@ -90,7 +90,7 @@ SOCKET uspy_socket[MAX_NODES]; /* UNIX domain spy sockets */
#endif #endif
SOCKET node_socket[MAX_NODES]; SOCKET node_socket[MAX_NODES];
struct xpms_set *ts_set; struct xpms_set *ts_set;
static sbbs_t* sbbs=NULL; //static sbbs_t* sbbs=NULL;
static scfg_t scfg; static scfg_t scfg;
static char * text[TOTAL_TEXT]; static char * text[TOTAL_TEXT];
static scfg_t node_scfg[MAX_NODES]; static scfg_t node_scfg[MAX_NODES];
...@@ -2175,7 +2175,7 @@ void sbbs_t::passthru_socket_activate(bool activate) ...@@ -2175,7 +2175,7 @@ void sbbs_t::passthru_socket_activate(bool activate)
do { // Allow time for the passthru_thread to move any pending socket data to the outbuf do { // Allow time for the passthru_thread to move any pending socket data to the outbuf
SLEEP(100); // Before the node_thread starts sending its own data to the outbuf SLEEP(100); // Before the node_thread starts sending its own data to the outbuf
} while(RingBufFull(&sbbs->outbuf)); } while(RingBufFull(&outbuf));
} }
passthru_socket_active = activate; passthru_socket_active = activate;
} }
...@@ -3967,10 +3967,10 @@ void sbbs_t::hangup(void) ...@@ -3967,10 +3967,10 @@ void sbbs_t::hangup(void)
mswait(1000); /* Give socket output buffer time to flush */ mswait(1000); /* Give socket output buffer time to flush */
client_off(client_socket); client_off(client_socket);
if(ssh_mode) { if(ssh_mode) {
pthread_mutex_lock(&sbbs->ssh_mutex); pthread_mutex_lock(&ssh_mutex);
ssh_session_destroy(client_socket, ssh_session, __LINE__); ssh_session_destroy(client_socket, ssh_session, __LINE__);
sbbs->ssh_mode = false; ssh_mode = false;
pthread_mutex_unlock(&sbbs->ssh_mutex); pthread_mutex_unlock(&ssh_mutex);
} }
close_socket(client_socket); close_socket(client_socket);
client_socket=INVALID_SOCKET; client_socket=INVALID_SOCKET;
...@@ -5150,7 +5150,7 @@ void bbs_thread(void* arg) ...@@ -5150,7 +5150,7 @@ void bbs_thread(void* arg)
NO_SSH: NO_SSH:
#endif #endif
sbbs = new sbbs_t(0, &server_addr, sizeof(server_addr) sbbs_t* sbbs = new sbbs_t(0, &server_addr, sizeof(server_addr)
,"Terminal Server", ts_set->socks[0].sock, &scfg, text, NULL); ,"Terminal Server", ts_set->socks[0].sock, &scfg, text, NULL);
if(sbbs->init()==false) { if(sbbs->init()==false) {
lputs(LOG_CRIT,"!BBS initialization failed"); lputs(LOG_CRIT,"!BBS initialization failed");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment