Commit 1d847ed3 authored by rswindell's avatar rswindell
Browse files

Introduce new node status (NODE_LOGOUT), which is used for the status of a node

after a user (has been) disconnected and before the node transitions to waiting
for connection (WFC) status. Usually the duration of this status is very short,
but it can be longer (e.g. for running log-out module and event) and for (new)
msg-scan pointer fix-ups.
Updated logout() to remove some cruft and add some more log/debug output.
Automatic new-scan pointer fix-ups when performing new-message scans (if the
current pointer is greater than the last message number, set it to the last
message number) and when saving message pointers.
Passing user_t* to get/putmsgptrs() instead of message number now (to better
detect Guest account).
parent 228274a9
...@@ -47,13 +47,13 @@ void sbbs_t::getmsgptrs() ...@@ -47,13 +47,13 @@ void sbbs_t::getmsgptrs()
if(!useron.number) if(!useron.number)
return; return;
bputs(text[LoadingMsgPtrs]); bputs(text[LoadingMsgPtrs]);
::getmsgptrs(&cfg,(useron.rest&FLAG('G')) ? 0:useron.number,subscan); ::getmsgptrs(&cfg,&useron,subscan);
bputs(text[LoadedMsgPtrs]); bputs(text[LoadedMsgPtrs]);
} }
void sbbs_t::putmsgptrs() void sbbs_t::putmsgptrs()
{ {
::putmsgptrs(&cfg,(useron.rest&FLAG('G')) ? 0:useron.number,subscan); ::putmsgptrs(&cfg,&useron,subscan);
} }
/****************************************************************************/ /****************************************************************************/
......
...@@ -447,6 +447,10 @@ void sbbs_t::printnodedat(uint number, node_t* node) ...@@ -447,6 +447,10 @@ void sbbs_t::printnodedat(uint number, node_t* node)
bputs(text[NodeStatusLogon]); bputs(text[NodeStatusLogon]);
bputs(node_connection_desc(this, node->connection, tmp)); bputs(node_connection_desc(this, node->connection, tmp));
break; break;
case NODE_LOGOUT:
bprintf(text[NodeStatusLogout]
,(node->misc&NODE_ANON) && !SYSOP ? text[UNKNOWN_USER] : username(&cfg,node->useron,tmp));
break;
case NODE_EVENT_WAITING: case NODE_EVENT_WAITING:
bputs(text[NodeStatusEventWaiting]); bputs(text[NodeStatusEventWaiting]);
break; break;
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
/****************************************************************************/ /****************************************************************************/
void sbbs_t::logout() void sbbs_t::logout()
{ {
char path[MAX_PATH+1];
char str[256]; char str[256];
char tmp[512]; char tmp[512];
int i,j; int i,j;
...@@ -52,18 +53,23 @@ void sbbs_t::logout() ...@@ -52,18 +53,23 @@ void sbbs_t::logout()
now=time(NULL); now=time(NULL);
if(localtime_r(&now,&tm)==NULL) if(localtime_r(&now,&tm)==NULL)
return; errormsg(WHERE,ERR_CHK,"localtime",(ulong)now);
if(!useron.number) { /* Not logged in, so do nothing */ if(!useron.number) { /* Not logged in, so do nothing */
if(!online) { if(!online) {
sprintf(str,"%s T:%3u sec\r\n" SAFEPRINTF2(str,"%s T:%3u sec\r\n"
,hhmmtostr(&cfg,&tm,tmp) ,hhmmtostr(&cfg,&tm,tmp)
,(uint)(now-answertime)); ,(uint)(now-answertime));
logline("@-",str); logline("@-",str);
} }
return; return;
} }
strcpy(lastuseron,useron.alias); /* for use with WFC status display */ lprintf(LOG_INFO, "Node %d %s logout initiated", cfg.node_num, useron.alias);
SAFECOPY(lastuseron,useron.alias);
if(!online && getnodedat(cfg.node_num, &node, /* lock: */true) == 0) {
node.status = NODE_LOGOUT;
putnodedat(cfg.node_num, &node);
}
if(useron.rest&FLAG('G')) { if(useron.rest&FLAG('G')) {
putuserrec(&cfg,useron.number,U_NAME,LEN_NAME,nulstr); putuserrec(&cfg,useron.number,U_NAME,LEN_NAME,nulstr);
...@@ -78,47 +84,28 @@ void sbbs_t::logout() ...@@ -78,47 +84,28 @@ void sbbs_t::logout()
getnodedat(i,&node,0); getnodedat(i,&node,0);
if((node.status==NODE_INUSE || node.status==NODE_QUIET) if((node.status==NODE_INUSE || node.status==NODE_QUIET)
&& !(node.misc&NODE_AOFF) && node.useron!=useron.number) { && !(node.misc&NODE_AOFF) && node.useron!=useron.number) {
sprintf(str,text[NodeLoggedOff],cfg.node_num SAFEPRINTF2(str,text[NodeLoggedOff],cfg.node_num
,thisnode.misc&NODE_ANON ,thisnode.misc&NODE_ANON
? text[UNKNOWN_USER] : useron.alias); ? text[UNKNOWN_USER] : useron.alias);
putnmsg(&cfg,i,str); } putnmsg(&cfg,i,str);
}
} }
if(!online) { /* NOT re-login */ if(!online) { /* NOT re-login */
if(cfg.sys_logout[0]) { /* execute system logout event */
#if 0 /* too soon, handled in node_thread */ lprintf(LOG_DEBUG, "Node %d executing logout event", cfg.node_num);
getnodedat(cfg.node_num,&thisnode,1);
thisnode.status=NODE_WFC;
thisnode.misc&=~(NODE_INTR|NODE_MSGW|NODE_NMSG
|NODE_UDAT|NODE_POFF|NODE_AOFF|NODE_EXT);
putnodedat(cfg.node_num,&thisnode);
#endif
#if 0 /* beep? */
if(sys_status&SS_SYSALERT) {
mswait(500);
offhook();
CLS;
lputs("\r\n\r\nAlerting Sysop...");
while(!lkbrd(1)) {
sbbs_beep(1000,200);
nosound();
mswait(200);
}
lkbrd(0);
}
#endif
sys_status&=~SS_SYSALERT;
if(cfg.sys_logout[0]) /* execute system logout event */
external(cmdstr(cfg.sys_logout,nulstr,nulstr,NULL),EX_OUTL|EX_OFFLINE); external(cmdstr(cfg.sys_logout,nulstr,nulstr,NULL),EX_OUTL|EX_OFFLINE);
} }
}
if(cfg.logout_mod[0]) if(cfg.logout_mod[0]) {
lprintf(LOG_DEBUG, "Node %d executing logout module", cfg.node_num);
exec_bin(cfg.logout_mod,&main_csi); exec_bin(cfg.logout_mod,&main_csi);
}
backout(); backout();
sprintf(str,"%smsgs/%4.4u.msg",cfg.data_dir,useron.number); SAFEPRINTF2(path,"%smsgs/%4.4u.msg",cfg.data_dir,useron.number);
if(!flength(str)) /* remove any 0 byte message files */ if(fexistcase(path) && !flength(path)) /* remove any 0 byte message files */
remove(str); remove(path);
delfiles(cfg.temp_dir,ALLFILES); delfiles(cfg.temp_dir,ALLFILES);
putmsgptrs(); putmsgptrs();
...@@ -139,7 +126,7 @@ void sbbs_t::logout() ...@@ -139,7 +126,7 @@ void sbbs_t::logout()
if(useron.min && j>i) { if(useron.min && j>i) {
j-=i; /* j=time to deduct from min */ j-=i; /* j=time to deduct from min */
sprintf(str,"Minute Adjustment: %d",-j); SAFEPRINTF(str,"Minute Adjustment: %d",-j);
logline(">>",str); logline(">>",str);
if(useron.min>(ulong)j) if(useron.min>(ulong)j)
useron.min-=j; useron.min-=j;
...@@ -165,18 +152,20 @@ void sbbs_t::logout() ...@@ -165,18 +152,20 @@ void sbbs_t::logout()
hhmmtostr(&cfg,&tm,str); hhmmtostr(&cfg,&tm,str);
strcat(str," "); strcat(str," ");
if(sys_status&SS_USERON) if(sys_status&SS_USERON)
sprintf(tmp,"T:%3u R:%3lu P:%3lu E:%3lu F:%3lu " safe_snprintf(tmp,sizeof(tmp),"T:%3u R:%3lu P:%3lu E:%3lu F:%3lu "
"U:%3luk %lu D:%3luk %lu" "U:%3luk %lu D:%3luk %lu"
,(uint)(now-logontime)/60,posts_read,logon_posts ,(uint)(now-logontime)/60,posts_read,logon_posts
,logon_emails,logon_fbacks,logon_ulb/1024UL,logon_uls ,logon_emails,logon_fbacks,logon_ulb/1024UL,logon_uls
,logon_dlb/1024UL,logon_dls); ,logon_dlb/1024UL,logon_dls);
else else
sprintf(tmp,"T:%3u sec",(uint)(now-answertime)); SAFEPRINTF(tmp,"T:%3u sec",(uint)(now-answertime));
strcat(str,tmp); strcat(str,tmp);
strcat(str,"\r\n"); strcat(str,"\r\n");
logline("@-",str); logline("@-",str);
sys_status&=~SS_USERON; sys_status&=~SS_USERON;
answertime=now; // Incase we're relogging on answertime=now; // Incase we're relogging on
lprintf(LOG_DEBUG, "Node %d %s logout completed", cfg.node_num, useron.alias);
} }
/****************************************************************************/ /****************************************************************************/
...@@ -184,30 +173,30 @@ void sbbs_t::logout() ...@@ -184,30 +173,30 @@ void sbbs_t::logout()
/****************************************************************************/ /****************************************************************************/
void sbbs_t::backout() void sbbs_t::backout()
{ {
char str[256],code[128],*buf; char path[MAX_PATH+1],code[128],*buf;
int i,file; int i,file;
long length,l; long length,l;
file_t f; file_t f;
sprintf(str,"%sbackout.dab",cfg.node_dir); SAFEPRINTF(path,"%sbackout.dab",cfg.node_dir);
if(flength(str)<1L) { if(flength(path)<1L) {
remove(str); remove(path);
return; return;
} }
if((file=nopen(str,O_RDONLY))==-1) { if((file=nopen(path,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY); errormsg(WHERE,ERR_OPEN,path,O_RDONLY);
return; return;
} }
length=(long)filelength(file); length=(long)filelength(file);
if((buf=(char *)malloc(length))==NULL) { if((buf=(char *)malloc(length))==NULL) {
close(file); close(file);
errormsg(WHERE,ERR_ALLOC,str,length); errormsg(WHERE,ERR_ALLOC,path,length);
return; return;
} }
if(read(file,buf,length)!=length) { if(read(file,buf,length)!=length) {
close(file); close(file);
free(buf); free(buf);
errormsg(WHERE,ERR_READ,str,length); errormsg(WHERE,ERR_READ,path,length);
return; return;
} }
close(file); close(file);
...@@ -226,10 +215,11 @@ void sbbs_t::backout() ...@@ -226,10 +215,11 @@ void sbbs_t::backout()
} }
break; break;
default: default:
errormsg(WHERE,ERR_CHK,str,buf[l]); } errormsg(WHERE,ERR_CHK,path,buf[l]);
}
} }
free(buf); free(buf);
remove(str); /* always remove the backout file */ remove(path); /* always remove the backout file */
} }
/****************************************************************************/ /****************************************************************************/
...@@ -245,13 +235,13 @@ void sbbs_t::logofflist() ...@@ -245,13 +235,13 @@ void sbbs_t::logofflist()
return; return;
if(localtime_r(&logontime,&tm)==NULL) if(localtime_r(&logontime,&tm)==NULL)
return; return;
sprintf(str,"%slogs/%2.2d%2.2d%2.2d.lol",cfg.logs_dir,tm.tm_mon+1,tm.tm_mday SAFEPRINTF4(str,"%slogs/%2.2d%2.2d%2.2d.lol",cfg.logs_dir,tm.tm_mon+1,tm.tm_mday
,TM_YEAR(tm.tm_year)); ,TM_YEAR(tm.tm_year));
if((file=nopen(str,O_WRONLY|O_CREAT|O_APPEND))==-1) { if((file=nopen(str,O_WRONLY|O_CREAT|O_APPEND))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_APPEND); errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_APPEND);
return; return;
} }
sprintf(str,"%-*.*s %-2d %-8.8s %2.2d:%2.2d %2.2d:%2.2d %3d%3ld%3ld%3ld%3ld" safe_snprintf(str,sizeof(str),"%-*.*s %-2d %-8.8s %2.2d:%2.2d %2.2d:%2.2d %3d%3ld%3ld%3ld%3ld"
"%3ld%3ld\r\n",LEN_ALIAS,LEN_ALIAS,useron.alias,cfg.node_num,connection "%3ld%3ld\r\n",LEN_ALIAS,LEN_ALIAS,useron.alias,cfg.node_num,connection
,tm.tm_hour,tm.tm_min,tm_now.tm_hour,tm_now.tm_min ,tm.tm_hour,tm.tm_min,tm_now.tm_hour,tm_now.tm_min
,(int)(now-logontime)/60,posts_read,logon_posts,logon_emails ,(int)(now-logontime)/60,posts_read,logon_posts,logon_emails
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2013 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -260,7 +260,10 @@ void printnodedat(int number, node_t node) ...@@ -260,7 +260,10 @@ void printnodedat(int number, node_t node)
printf("Networking"); printf("Networking");
break; break;
case NODE_LOGON: case NODE_LOGON:
printf("At logon prompt"); printf("At login prompt");
break;
case NODE_LOGOUT:
printf("Logging out");
break; break;
case NODE_EVENT_WAITING: case NODE_EVENT_WAITING:
printf("Waiting for all nodes to become inactive"); printf("Waiting for all nodes to become inactive");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "smbdefs.h" /* uchar, ushort, ulong and _PACK */ #include "smbdefs.h" /* uchar, ushort, ulong and _PACK */
#include "limits.h" #include "limits.h"
enum { /* Node Status */ enum node_status { /* Node Status */
NODE_WFC /* Waiting for Call */ NODE_WFC /* Waiting for Call */
,NODE_LOGON /* at logon prompt */ ,NODE_LOGON /* at logon prompt */
,NODE_NEWUSER /* New user applying */ ,NODE_NEWUSER /* New user applying */
...@@ -56,6 +56,7 @@ enum { /* Node Status */ ...@@ -56,6 +56,7 @@ enum { /* Node Status */
,NODE_EVENT_WAITING /* Waiting for all nodes to be inactive */ ,NODE_EVENT_WAITING /* Waiting for all nodes to be inactive */
,NODE_EVENT_RUNNING /* Running an external event */ ,NODE_EVENT_RUNNING /* Running an external event */
,NODE_EVENT_LIMBO /* Allowing another node to run an event */ ,NODE_EVENT_LIMBO /* Allowing another node to run an event */
,NODE_LOGOUT /* Logging out */
}; };
#define NODE_INVALID_STATUS 0xff /* Invalid status value */ #define NODE_INVALID_STATUS 0xff /* Invalid status value */
...@@ -76,7 +77,7 @@ enum { /* Node Status */ ...@@ -76,7 +77,7 @@ enum { /* Node Status */
#define NODE_EXT (1<<12) /* Extended info on node action */ #define NODE_EXT (1<<12) /* Extended info on node action */
#define NODE_LCHAT (1<<13) /* Being pulled into local chat */ #define NODE_LCHAT (1<<13) /* Being pulled into local chat */
enum { /* Node Action */ enum node_action { /* Node Action */
NODE_MAIN /* Main Prompt */ NODE_MAIN /* Main Prompt */
,NODE_RMSG /* Reading Messages */ ,NODE_RMSG /* Reading Messages */
,NODE_RMAL /* Reading Mail */ ,NODE_RMAL /* Reading Mail */
...@@ -112,20 +113,20 @@ enum { /* Node Action */ ...@@ -112,20 +113,20 @@ enum { /* Node Action */
#define SIZEOF_NODE_T 15 /* Must == sizeof(node_t) */ #define SIZEOF_NODE_T 15 /* Must == sizeof(node_t) */
typedef struct _PACK { /* Node information kept in node.dab */ typedef struct _PACK { /* Node information kept in node.dab */
uchar status, /* Current Status of Node */ uchar status, /* Current Status of Node (enum node_status) */
errors, /* Number of Critical Errors */ errors, /* Number of Critical Errors */
action; /* Action User is doing on Node */ action; /* Action User is doing on Node (enum node_action) */
uint16_t useron, /* User on Node */ uint16_t useron, /* User on Node */
connection, /* Connection rate of Node */ connection, /* Connection rate of Node */
#define NODE_CONNECTION_LOCAL 0 #define NODE_CONNECTION_LOCAL 0
#define NODE_CONNECTION_TELNET USHRT_MAX /* 0xffff */ #define NODE_CONNECTION_TELNET USHRT_MAX /* 0xffff */
#define NODE_CONNECTION_RLOGIN (USHRT_MAX-1) #define NODE_CONNECTION_RLOGIN (USHRT_MAX-1)
#define NODE_CONNECTION_SSH (USHRT_MAX-2) #define NODE_CONNECTION_SSH (USHRT_MAX-2)
misc, /* Miscellaneous bits for node */ misc, /* Miscellaneous bits for node */
aux; /* Auxillary word for node */ aux; /* Auxillary word for node */
uint32_t extaux; /* Extended aux dword for node */ uint32_t extaux; /* Extended aux dword for node */
} node_t; } node_t;
#if defined(_WIN32) || defined(__BORLANDC__) #if defined(_WIN32) || defined(__BORLANDC__)
#pragma pack(pop) /* original packing */ #pragma pack(pop) /* original packing */
......
...@@ -425,11 +425,10 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack) ...@@ -425,11 +425,10 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
subs_scanned++; subs_scanned++;
msgs=getlastmsg(usrsub[i][j],&lastmsg,0); msgs=getlastmsg(usrsub[i][j],&lastmsg,0);
if(!msgs || lastmsg<=subscan[usrsub[i][j]].ptr) { /* no msgs */ if(!msgs || lastmsg<=subscan[usrsub[i][j]].ptr) { /* no msgs */
if(subscan[usrsub[i][j]].ptr>lastmsg) { /* corrupted ptr */ if(subscan[usrsub[i][j]].ptr>lastmsg) /* corrupted ptr */
outchar('*'); subscan[usrsub[i][j]].ptr=lastmsg; /* so fix automatically */
subscan[usrsub[i][j]].ptr=lastmsg; /* so fix automatically */ if(subscan[usrsub[i][j]].last>lastmsg)
subscan[usrsub[i][j]].last=lastmsg; subscan[usrsub[i][j]].last=lastmsg;
}
bprintf(text[NScanStatusFmt] bprintf(text[NScanStatusFmt]
,cfg.grp[cfg.sub[usrsub[i][j]]->grp]->sname ,cfg.grp[cfg.sub[usrsub[i][j]]->grp]->sname
,cfg.sub[usrsub[i][j]]->lname,0L,msgs); ,cfg.sub[usrsub[i][j]]->lname,0L,msgs);
......
...@@ -413,7 +413,9 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find) ...@@ -413,7 +413,9 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
} }
if(mode&SCAN_NEW && subscan[subnum].ptr>=last && !(mode&SCAN_BACK)) { if(mode&SCAN_NEW && subscan[subnum].ptr>=last && !(mode&SCAN_BACK)) {
if(subscan[subnum].ptr>last) if(subscan[subnum].ptr>last)
subscan[subnum].ptr=subscan[subnum].last=last; subscan[subnum].ptr=last;
if(subscan[subnum].last>last)
subscan[subnum].last=last;
bprintf(text[NScanStatusFmt] bprintf(text[NScanStatusFmt]
,cfg.grp[cfg.sub[subnum]->grp]->sname,cfg.sub[subnum]->lname,0L,msgs); ,cfg.grp[cfg.sub[subnum]->grp]->sname,cfg.sub[subnum]->lname,0L,msgs);
return(0); return(0);
......
...@@ -373,7 +373,7 @@ js_login(JSContext *cx, uintN argc, jsval *arglist) ...@@ -373,7 +373,7 @@ js_login(JSContext *cx, uintN argc, jsval *arglist)
/* ToDo Deuce: did you mean to do this *before* the above memset(0) ? */ /* ToDo Deuce: did you mean to do this *before* the above memset(0) ? */
if(client->user.number) { if(client->user.number) {
if(client->subscan!=NULL) if(client->subscan!=NULL)
putmsgptrs(&scfg, client->user.number, client->subscan); putmsgptrs(&scfg, &client->user, client->subscan);
} }
if(isdigit(*user)) if(isdigit(*user))
...@@ -428,7 +428,7 @@ js_login(JSContext *cx, uintN argc, jsval *arglist) ...@@ -428,7 +428,7 @@ js_login(JSContext *cx, uintN argc, jsval *arglist)
lprintf(LOG_CRIT,"!MALLOC FAILURE"); lprintf(LOG_CRIT,"!MALLOC FAILURE");
} }
if(client->subscan!=NULL) { if(client->subscan!=NULL) {
getmsgptrs(&scfg,client->user.number,client->subscan); getmsgptrs(&scfg,&client->user,client->subscan);
} }
JS_RESUMEREQUEST(cx, rc); JS_RESUMEREQUEST(cx, rc);
...@@ -1133,7 +1133,7 @@ static void js_service_thread(void* arg) ...@@ -1133,7 +1133,7 @@ static void js_service_thread(void* arg)
if(service_client.user.number) { if(service_client.user.number) {
if(service_client.subscan!=NULL) if(service_client.subscan!=NULL)
putmsgptrs(&scfg, service_client.user.number, service_client.subscan); putmsgptrs(&scfg, &service_client.user, service_client.subscan);
lprintf(LOG_INFO,"%04d %s Logging out %s" lprintf(LOG_INFO,"%04d %s Logging out %s"
,socket, service->protocol, service_client.user.alias); ,socket, service->protocol, service_client.user.alias);
logoutuserdat(&scfg,&service_client.user,time(NULL),service_client.logintime); logoutuserdat(&scfg,&service_client.user,time(NULL),service_client.logintime);
......
...@@ -821,6 +821,7 @@ enum { ...@@ -821,6 +821,7 @@ enum {
,InThePast ,InThePast
,InTheFuture ,InTheFuture
,AgeOfPostedItem ,AgeOfPostedItem
,NodeStatusLogout
,TOTAL_TEXT ,TOTAL_TEXT
}; };
......
...@@ -1182,7 +1182,7 @@ const char * const text_defaults[TOTAL_TEXT]={ ...@@ -1182,7 +1182,7 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x41\x72\x63\x68\x69\x76\x65\x20\x54\x79\x70\x65" ,"\x41\x72\x63\x68\x69\x76\x65\x20\x54\x79\x70\x65"
,"\x56\x61\x6c\x69\x64\x61\x74\x65\x20\x6d\x65\x73\x73\x61\x67\x65\x20\x23\x25\x75\x20\x27\x25\x73\x27" ,"\x56\x61\x6c\x69\x64\x61\x74\x65\x20\x6d\x65\x73\x73\x61\x67\x65\x20\x23\x25\x75\x20\x27\x25\x73\x27"
,"\x57\x61\x69\x74\x69\x6e\x67\x20\x66\x6f\x72\x20\x63\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e" ,"\x57\x61\x69\x74\x69\x6e\x67\x20\x66\x6f\x72\x20\x63\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e"
,"\x41\x74\x20\x6c\x6f\x67\x6f\x6e\x20\x70\x72\x6f\x6d\x70\x74" ,"\x41\x74\x20\x6c\x6f\x67\x69\x6e\x20\x70\x72\x6f\x6d\x70\x74"
,"\x4e\x65\x77\x20\x75\x73\x65\x72\x20\x61\x70\x70\x6c\x79\x69\x6e\x67\x20\x66\x6f\x72\x20\x61\x63\x63\x65\x73\x73" ,"\x4e\x65\x77\x20\x75\x73\x65\x72\x20\x61\x70\x70\x6c\x79\x69\x6e\x67\x20\x66\x6f\x72\x20\x61\x63\x63\x65\x73\x73"
,"\x4f\x66\x66\x6c\x69\x6e\x65" ,"\x4f\x66\x66\x6c\x69\x6e\x65"
,"\x57\x61\x69\x74\x69\x6e\x67\x20\x66\x6f\x72\x20\x61\x6c\x6c\x20\x6e\x6f\x64\x65\x73\x20\x74\x6f\x20\x62\x65\x63\x6f\x6d\x65\x20" ,"\x57\x61\x69\x74\x69\x6e\x67\x20\x66\x6f\x72\x20\x61\x6c\x6c\x20\x6e\x6f\x64\x65\x73\x20\x74\x6f\x20\x62\x65\x63\x6f\x6d\x65\x20"
...@@ -1281,4 +1281,5 @@ const char * const text_defaults[TOTAL_TEXT]={ ...@@ -1281,4 +1281,5 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x61\x67\x6f" ,"\x61\x67\x6f"
,"\x66\x72\x6f\x6d\x20\x6e\x6f\x77" ,"\x66\x72\x6f\x6d\x20\x6e\x6f\x77"
,"\x25\x73\x20\x25\x73\x20\x25\x73" ,"\x25\x73\x20\x25\x73\x20\x25\x73"
,"\x6c\x6f\x67\x67\x69\x6e\x67\x20\x6f\x75\x74\x20\x01\x68\x25\x73"
}; };
...@@ -845,29 +845,33 @@ char* DLLCALL nodestatus(scfg_t* cfg, node_t* node, char* buf, size_t buflen) ...@@ -845,29 +845,33 @@ char* DLLCALL nodestatus(scfg_t* cfg, node_t* node, char* buf, size_t buflen)
return(buf); return(buf);
} }
str[0]=0;
switch(node->status) { switch(node->status) {
case NODE_WFC: case NODE_WFC:
strcpy(str,"Waiting for connection"); SAFECOPY(str,"Waiting for connection");
break; break;
case NODE_OFFLINE: case NODE_OFFLINE:
strcpy(str,"Offline"); strcpy(str,"Offline");
break; break;
case NODE_NETTING: /* Obsolete */ case NODE_NETTING: /* Obsolete */
strcpy(str,"Networking"); SAFECOPY(str,"Networking");
break; break;
case NODE_LOGON: case NODE_LOGON:
SAFEPRINTF(str,"At logon prompt %s" SAFEPRINTF(str,"At login prompt %s"
,node_connection_desc(node->connection, tmp)); ,node_connection_desc(node->connection, tmp));
break; break;
case NODE_LOGOUT:
SAFEPRINTF(str,"Logging out %s", username(cfg,node->useron,tmp));
break;
case NODE_EVENT_WAITING: case NODE_EVENT_WAITING:
strcpy(str,"Waiting for all nodes to become inactive"); SAFECOPY(str,"Waiting for all nodes to become inactive");
break; break;
case NODE_EVENT_LIMBO: case NODE_EVENT_LIMBO:
SAFEPRINTF(str,"Waiting for node %d to finish external event" SAFEPRINTF(str,"Waiting for node %d to finish external event"
,node->aux); ,node->aux);
break; break;
case NODE_EVENT_RUNNING: case NODE_EVENT_RUNNING:
strcpy(str,"Running external event"); SAFECOPY(str,"Running external event");
break; break;
case NODE_NEWUSER: case NODE_NEWUSER:
SAFEPRINTF(str,"New user applying for access %s"