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 64f260dd authored by rswindell's avatar rswindell

sbbs_t::outcom() now retries (1000 times with 80ms delays) if the transmit

buffer if full. So now everything that uses outcom (including JS
console.write) now includes a retry. The lower-level non-retry outcom()
was renamed _outcom() (and is used by outcom).
Added new Ctrl-A code: Ctrl-AF - enables the blink attribute, but only
if/when a blink font was activated in the terminal. Lower-case 'f' refers
to the normal-intensity blink-font. Uppercase 'F' refers to the high
intensity blink-font. This allows you to mix fonts in text/menu files
and not have annoying blinking text in non-supporting terminals. This is
the first Ctrl-A code to be case-sensitive.
parent c7ca34ae
......@@ -218,22 +218,7 @@ void sbbs_t::outchar(char ch)
else {
if(ch==(char)TELNET_IAC && !(telnet_mode&TELNET_MODE_OFF))
outcom(TELNET_IAC); /* Must escape Telnet IAC char (255) */
i=0;
while(outcom(ch)&TXBOF && i<1440) { /* 3 minute pause delay */
if(!online)
break;
i++;
if(sys_status&SS_SYSPAGE)
sbbs_beep(i,80);
else
mswait(80);
}
if(i==1440) { /* timeout - beep flush outbuf */
i=rioctl(TXBC);
lprintf(LOG_NOTICE,"timeout(outchar) %04X %04X\r\n",i,rioctl(IOFO));
outcom(BEL);
rioctl(IOCS|PAUSE);
}
outcom(ch);
}
}
if(!outchar_esc) {
......@@ -547,6 +532,12 @@ void sbbs_t::ctrl_a(char x)
atr|=BLINK;
attr(atr);
break;
case 'F': /* Blink, only if alt Blink Font is loaded */
if(((atr&HIGH) && (console&CON_HBLINK_FONT)) || (!(atr&HIGH) && (console&CON_BLINK_FONT)))
attr(atr|BLINK);
else if(x == 'F' && !(atr&HIGH)) /* otherwise, set HIGH attribute (only if capital 'F') */
attr(atr|HIGH);
break;
case 'N': /* Normal */
attr(LIGHTGRAY);
break;
......
......@@ -3909,7 +3909,9 @@ int sbbs_t::incom(unsigned long timeout)
return(ch);
}
int sbbs_t::outcom(uchar ch)
// Steve's original implementation (in RCIOL) did not incorporate a retry
// ... so this function does not either. :-P
int sbbs_t::_outcom(uchar ch)
{
if(!RingBufFree(&outbuf))
return(TXBOF);
......@@ -3918,6 +3920,28 @@ int sbbs_t::outcom(uchar ch)
return(0);
}
// This outcom version retries - copied loop from sbbs_t::outchar()
int sbbs_t::outcom(uchar ch, int max_attempts)
{
int i = 0;
while(_outcom(ch) != 0) {
if(!online)
break;
i++;
if(i >= max_attempts) { /* timeout - beep flush outbuf */
lprintf(LOG_NOTICE, "timeout(outcom) %04X %04X", rioctl(TXBC), rioctl(IOFO));
_outcom(BEL);
rioctl(IOCS|PAUSE);
return TXBOF;
}
if(sys_status&SS_SYSPAGE)
sbbs_beep(i, OUTCOM_RETRY_DELAY);
else
mswait(OUTCOM_RETRY_DELAY);
}
return 0; // Success
}
int sbbs_t::putcom(const char *str, size_t len)
{
size_t i;
......
......@@ -347,7 +347,10 @@ public:
pthread_mutex_t ssh_mutex;
bool ssh_mutex_created;
int outcom(uchar ch); // send character
#define OUTCOM_RETRY_DELAY 80 // milliseconds
#define OUTCOM_RETRY_ATTEMPTS 1000 // 80 seconds
int _outcom(uchar ch); // send character, without retry (on buffer flow condition)
int outcom(uchar ch, int max_attempts = OUTCOM_RETRY_ATTEMPTS); // send character, with retry
int incom(unsigned long timeout=0); // receive character
void spymsg(const char *msg); // send message to active spies
......
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