...
 
Commits (2)
......@@ -44,7 +44,8 @@
/****************************************************************************/
char sbbs_t::getkey(long mode)
{
uchar ch,coldkey,c=0,spin=sbbs_random(5);
uchar ch, coldkey, spin = sbbs_random(10);
ulong c = sbbs_random(5);
time_t last_telnet_cmd=0;
long term = term_supports();
......@@ -70,145 +71,11 @@ char sbbs_t::getkey(long mode)
}
if(mode&K_SPIN) {
if(term&NO_EXASCII) {
switch(c++) {
case 0:
outchar(BS);
outchar('|');
break;
case 1:
outchar(BS);
outchar('/');
break;
case 2:
outchar(BS);
outchar('-');
break;
case 3:
outchar(BS);
outchar('\\');
c=0;
break;
}
} else {
switch(spin) {
case 0:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('/');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('\\');
c=0;
break;
}
break;
case 1:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('');
break;
case 4:
outchar(BS);
outchar('');
break;
case 5:
outchar(BS);
outchar('');
c=0;
break;
}
break;
case 2:
switch(c++) {
case 0:
outchar(BS);
outchar('-');
break;
case 1:
outchar(BS);
outchar('=');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('=');
c=0;
break;
}
break;
case 3:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('');
c=0;
break;
}
break;
case 4:
switch(c++) {
case 0:
outchar(BS);
outchar('');
break;
case 1:
outchar(BS);
outchar('');
break;
case 2:
outchar(BS);
outchar('');
break;
case 3:
outchar(BS);
outchar('');
c=0;
break;
}
break;
}
}
char* cursor = text[SpinningCursor0 + spin];
outchar('\b');
outchar(cursor[(c++) % strlen(cursor)]);
}
ch=inkey(mode,mode&K_SPIN ? 250:1000);
ch=inkey(mode,mode&K_SPIN ? 200:1000);
if(sys_status&SS_ABORT)
return(0);
now=time(NULL);
......
......@@ -147,12 +147,12 @@ int thread_suid_broken=TRUE; /* NPTL is no longer broken */
} \
} while (0)
#define GCESSTR(status, str, sess, action) do { \
#define GCESSTR(status, str, log_level, sess, action) do { \
char *GCES_estr; \
int GCES_level; \
get_crypt_error_string(status, sess, &GCES_estr, action, &GCES_level);\
if (GCES_estr) { \
lprintf(GCES_level, "%s SSH %s from %s (session %d)", str, GCES_estr, __FUNCTION__, sess); \
lprintf(log_level, "%s SSH %s from %s (session %d)", str, GCES_estr, __FUNCTION__, sess); \
free_crypt_attrstr(GCES_estr); \
} \
} while (0)
......@@ -2424,7 +2424,7 @@ void output_thread(void* arg)
continue;
}
if (cryptStatusError((err=cryptSetAttribute(sbbs->ssh_session, CRYPT_SESSINFO_SSH_CHANNEL, sbbs->session_channel)))) {
GCESSTR(err, node, sbbs->ssh_session, "setting channel");
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "setting channel");
ssh_errors++;
sbbs->online=FALSE;
i=buftop-bufbot; // Pretend we sent it all
......@@ -2432,7 +2432,7 @@ void output_thread(void* arg)
else {
if(cryptStatusError((err=cryptPushData(sbbs->ssh_session, (char*)buf+bufbot, buftop-bufbot, &i)))) {
/* Handle the SSH error here... */
GCESSTR(err, node, sbbs->ssh_session, "pushing data");
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "pushing data");
ssh_errors++;
sbbs->online=FALSE;
i=buftop-bufbot; // Pretend we sent it all
......@@ -2440,9 +2440,9 @@ void output_thread(void* arg)
else {
// READ = WRITE TIMEOUT HACK... REMOVE WHEN FIXED
if(cryptStatusError(err=cryptSetAttribute(sbbs->ssh_session, CRYPT_OPTION_NET_WRITETIMEOUT, 5)))
GCESSTR(err, node, sbbs->ssh_session, "setting write timeout");
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "setting write timeout");
if(cryptStatusError((err=cryptFlushData(sbbs->ssh_session)))) {
GCESSTR(err, node, sbbs->ssh_session, "flushing data");
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "flushing data");
ssh_errors++;
if (err != CRYPT_ERROR_TIMEOUT) {
sbbs->online=FALSE;
......@@ -2451,7 +2451,7 @@ void output_thread(void* arg)
}
// READ = WRITE TIMEOUT HACK... REMOVE WHEN FIXED
if(cryptStatusError(err=cryptSetAttribute(sbbs->ssh_session, CRYPT_OPTION_NET_WRITETIMEOUT, 0)))
GCESSTR(err, node, sbbs->ssh_session, "setting write timeout");
GCESSTR(err, node, LOG_WARNING, sbbs->ssh_session, "setting write timeout");
}
}
pthread_mutex_unlock(&sbbs->ssh_mutex);
......
......@@ -843,6 +843,16 @@ enum {
,NodeConnectionRaw
,MouseTerminalQ
,TerminalMouse
,SpinningCursor0
,SpinningCursor1
,SpinningCursor2
,SpinningCursor3
,SpinningCursor4
,SpinningCursor5
,SpinningCursor6
,SpinningCursor7
,SpinningCursor8
,SpinningCursor9
,TOTAL_TEXT
};
......
/* $Id: text_defaults.c,v 1.80 2020/08/04 04:26:03 rswindell Exp $ */
/* Synchronet default text strings */
/* Automatically generated by textgen $ */
......@@ -1375,4 +1373,14 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x44\x6f\x65\x73\x20\x79\x6f\x75\x72\x20\x74\x65\x72\x6d\x69\x6e\x61\x6c\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x6d\x6f\x75\x73\x65"
"\x20\x72\x65\x70\x6f\x72\x74\x69\x6e\x67" // 831 MouseTerminalQ
,"\x28\x6d\x6f\x75\x73\x65\x29\x20" // 832 TerminalMouse
,"\x2d\x3e\x29\x7c\x28\x3c\x2d\x3c\x28\x7c\x29\x3e" // 833 SpinningCursor0
,"\xb3\x2f\xc4\x5c" // 834 SpinningCursor1
,"\xb0\xb1\xb2\xdb\xb2\xb1" // 835 SpinningCursor2
,"\x2d\x3d\xf0\x3d" // 836 SpinningCursor3
,"\xda\xc0\xd9\xbf" // 837 SpinningCursor4
,"\xdc\xde\xdf\xdd" // 838 SpinningCursor5
,"\x2d\x3e\x29\x7c\x28\x3c\x2d\x3c\x28\x7c\x29\x3e" // 839 SpinningCursor6
,"\xb3\x2f\xc4\x5c" // 840 SpinningCursor7
,"\xb0\xb1\xb2\xdb\xb2\xb1" // 841 SpinningCursor8
,"\x2d\x3d\xf0\x3d" // 842 SpinningCursor9
};