Commits (2)
  • Rob Swindell's avatar
    When running 16-bit DOS commands "offline" on Windows, don't use dosxtrn · 47e60472
    Rob Swindell authored
    We shouldn't need a virtual UART/FOSSIL driver to execute "offline" program (e.g. timed events) in the first place, and our virtual UART/FOSSIL for Windows wouldn't work right in the scenario anyway even if it did load successfully.
    
    This resolves the reported issues with timed events configured as not "native" returning error 255 (and not running successfully) on Windows with SBBS v3.19. I'm not even sure what changed exactly in xtrn.cpp, dosxtrn.c, and sbbexec.c between v3.18 and v3.19 that's causing this to now fail, but it (using DOSXTRN to run offline DOS programs) really shouldn't have been attempted in the first place. So that was just a design issue that happened to kind of sort of work up until v3.19.
    47e60472
  • Rob Swindell's avatar
    Add "Native" option for QWKnet call-out cmd-lines · bb43c70b
    Rob Swindell authored
    This really shouldn't be necessary to toggle (at least now) on Windows, since we treat all off-line executions as "native", but for *nix, it could make a big difference if trying to invoke a native program or shell script for a QWKnet call-out and it would either fail due to no DOS support or try to executing using Linux-DOSEMU (unless the command's program name was in the global "native program list" configured in SCFG->External Programs).
    bb43c70b
......@@ -3010,10 +3010,13 @@ void event_thread(void* arg)
sbbs->lprintf(LOG_INFO,"Call-out: %s",sbbs->cfg.qhub[i]->id);
sbbs->online=ON_LOCAL;
sbbs->console|=CON_L_ECHO;
int ex_mode = EX_OFFLINE|EX_SH; /* sh for Unix perl scripts */
if(sbbs->cfg.qhub[i]->misc & QHUB_NATIVE)
ex_mode |= EX_NATIVE;
int result = sbbs->external(
sbbs->cmdstr(sbbs->cfg.qhub[i]->call
,sbbs->cfg.qhub[i]->id,sbbs->cfg.qhub[i]->id,NULL)
,EX_OFFLINE|EX_SH); /* sh for Unix perl scripts */
,ex_mode);
sbbs->lprintf(result ? LOG_ERR : LOG_INFO, "Call-out to: %s returned %d", sbbs->cfg.qhub[i]->id, result);
sbbs->console&=~CON_L_ECHO;
sbbs->online=FALSE;
......@@ -3185,7 +3188,7 @@ void event_thread(void* arg)
sbbs->online=ON_LOCAL;
sbbs->console|=CON_L_ECHO;
sbbs->lprintf(LOG_INFO,"Running %s%stimed event: %s"
,(ex_mode&EX_NATIVE) ? "native ":""
,(ex_mode&EX_NATIVE) ? "native ":"16-bit DOS "
,(ex_mode&EX_BG) ? "background ":""
,event_code);
{
......
......@@ -432,6 +432,7 @@ typedef enum { /* Values for xtrn_t.event */
#define QHUB_NOHEADERS (1<<16) /* Don't include HEADERS.DAT */
#define QHUB_NOVOTING (1<<17) /* Don't include VOTING.DAT */
#define QHUB_UTF8 (1<<18) /* Include UTF-8 characters */
#define QHUB_NATIVE (1<<19) /* Native call-out script */
/* Bits in user.chat */
#define CHAT_ECHO (1<<0) /* Multinode chat echo */
......
......@@ -833,6 +833,7 @@ void qhub_edit(int num)
sprintf(opt[i++],"%-27.27s%s","Pack Command Line",cfg.qhub[num]->pack);
sprintf(opt[i++],"%-27.27s%s","Unpack Command Line",cfg.qhub[num]->unpack);
sprintf(opt[i++],"%-27.27s%s","Call-out Command Line",cfg.qhub[num]->call);
sprintf(opt[i++],"%-27.27s%s","Native Call-out Command",cfg.qhub[num]->misc&QHUB_NATIVE ? "Yes":"No");
if(cfg.qhub[num]->node == NODE_ANY)
SAFECOPY(str, "Any");
else
......@@ -876,6 +877,9 @@ void qhub_edit(int num)
"The `Call-out Command Line` is executed when your system attempts a packet\n"
"exchange with the QWKnet hub (e.g. executes a script).\n"
"\n"
"Toggle `Native Call-out Command` to `Yes` if your Call-out Command-line\n"
"is invoking a native (not a 16-bit DOS) program or script.\n"
"\n"
"`Kludge Lines` (e.g. @TZ, @VIA, @MSGID, @REPLY) provide information not\n"
"available in standard QWK message headers, but are superfluous when the\n"
"HEADERS.DAT file is supported and used.\n"
......@@ -971,6 +975,10 @@ void qhub_edit(int num)
uifc.input(WIN_MID|WIN_SAV,0,0,""
,cfg.qhub[num]->call,sizeof(cfg.qhub[num]->call)-1,K_EDIT);
break;
case __COUNTER__:
cfg.qhub[num]->misc^=QHUB_NATIVE;
uifc.changes=1;
break;
case __COUNTER__:
if(cfg.qhub[num]->node == NODE_ANY)
SAFECOPY(str, "Any");
......
......@@ -365,6 +365,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
bprintf("Sorry, DOS programs are not supported on this node.\r\n");
return -1;
}
if(mode & EX_OFFLINE)
native = true; // We don't need to invoke our virtual UART/FOSSIL driver
if(mode&EX_SH || strcspn(cmdline,"<>|")!=strlen(cmdline))
sprintf(comspec_str,"%s /C ", comspec);
......