Commit 20836afe authored by rswindell's avatar rswindell
Browse files

Checking protocol() return value.

parent 8871c4b4
......@@ -634,6 +634,7 @@ int sbbs_t::exec_function(csi_t *csi)
case CS_FILE_SEND:
csi->logic=LOGIC_FALSE;
menu("dlprot");
mnemonics(text[ProtocolOrQuit]);
strcpy(str,"Q");
......@@ -648,15 +649,19 @@ int sbbs_t::exec_function(csi_t *csi)
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron))
break;
if(i<cfg.total_prots) {
protocol(cmdstr(cfg.prot[i]->dlcmd,csi->str,csi->str,str),false);
autohangup(); }
if(protocol(cmdstr(cfg.prot[i]->dlcmd,csi->str,csi->str,str),false)==0)
csi->logic=LOGIC_TRUE;
autohangup();
}
return(0);
case CS_FILE_PUT:
csi->logic=LOGIC_FALSE;
if(!chksyspass())
return(0);
case CS_FILE_RECEIVE:
csi->logic=LOGIC_FALSE;
menu("ulprot");
mnemonics(text[ProtocolOrQuit]);
strcpy(str,"Q");
......@@ -672,8 +677,10 @@ int sbbs_t::exec_function(csi_t *csi)
if(cfg.prot[i]->mnemonic==ch && chk_ar(cfg.prot[i]->ar,&useron))
break;
if(i<cfg.total_prots) {
protocol(cmdstr(cfg.prot[i]->ulcmd,csi->str,csi->str,str),true);
autohangup(); }
if(protocol(cmdstr(cfg.prot[i]->ulcmd,csi->str,csi->str,str),true)==0)
csi->logic=LOGIC_TRUE;
autohangup();
}
return(0);
case CS_FILE_UPLOAD_BULK:
......
......@@ -825,6 +825,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
char tmp[512];
uchar *ixbbuf,*usrxfrbuf=NULL,*p;
int file;
int error;
int found=0;
uint i,j;
long usrxfrlen;
......@@ -1247,7 +1248,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
thisnode.aux=(tm->tm_hour*60)+tm->tm_min;
putnodedat(cfg.node_num,&thisnode); /* calculate ETA */
start=time(NULL);
j=protocol(cmdstr(cfg.prot[i]->dlcmd,path,nulstr,NULL),false);
error=protocol(cmdstr(cfg.prot[i]->dlcmd,path,nulstr,NULL),false);
end=time(NULL);
if(cfg.dir[f.dir]->misc&DIR_TFREE)
starttime+=end-start;
......@@ -1257,7 +1258,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
else
notdownloaded(f.size,start,end); }
else {
if(!j)
if(!error)
downloadfile(&f);
else {
bprintf(text[FileNotSent],f.name);
......
......@@ -383,8 +383,9 @@ void sbbs_t::qwk_sec()
char str[256],tmp2[256],ch,bi=0
,*AttemptedToDownloadQWKpacket="Attempted to download QWK packet";
char tmp[512];
int error;
int s;
uint i,j,k;
uint i,k;
ulong msgcnt;
time_t *sav_ptr;
file_t fd;
......@@ -575,7 +576,7 @@ void sbbs_t::qwk_sec()
padfname(tmp2,fd.name);
sprintf(str,"%sBATCHDN.LST",cfg.node_dir);
sprintf(tmp2,"%sBATCHUP.LST",cfg.node_dir);
j=protocol(cmdstr(cfg.prot[i]->bicmd,str,tmp2,NULL),true);
error=protocol(cmdstr(cfg.prot[i]->bicmd,str,tmp2,NULL),true);
batdn_total=batup_total=0;
if(cfg.prot[i]->misc&PROT_DSZLOG) {
if(!checkprotlog(&fd)) {
......@@ -587,7 +588,7 @@ void sbbs_t::qwk_sec()
qwk_success(msgcnt,1,0);
for(i=0;i<cfg.total_subs;i++)
sav_ptr[i]=sub_ptr[i]; } }
else if(j) {
else if(error) {
logline("D!",AttemptedToDownloadQWKpacket);
last_ns_time=ns_time;
for(i=0;i<cfg.total_subs;i++)
......@@ -672,7 +673,7 @@ void sbbs_t::qwk_sec()
sprintf(str,"%s%s.qwk",cfg.temp_dir,cfg.sys_id);
sprintf(tmp2,"%s.qwk",cfg.sys_id);
padfname(tmp2,fd.name);
j=protocol(cmdstr(cfg.prot[i]->dlcmd,str,nulstr,NULL),false);
error=protocol(cmdstr(cfg.prot[i]->dlcmd,str,nulstr,NULL),false);
if(cfg.prot[i]->misc&PROT_DSZLOG) {
if(!checkprotlog(&fd)) {
last_ns_time=ns_time;
......@@ -682,7 +683,7 @@ void sbbs_t::qwk_sec()
qwk_success(msgcnt,0,0);
for(i=0;i<cfg.total_subs;i++)
sav_ptr[i]=sub_ptr[i]; } }
else if(j) {
else if(error) {
logline("D!",AttemptedToDownloadQWKpacket);
last_ns_time=ns_time;
for(i=0;i<cfg.total_subs;i++)
......
......@@ -46,6 +46,7 @@ void sbbs_t::readmail(uint usernumber, int which)
,*p,*tp,*sp,ch;
char tmp[512];
int i,j;
int error;
int mismatches=0,act;
ulong msgs,curmsg;
long length,l,lm_mode;
......@@ -257,10 +258,10 @@ void sbbs_t::readmail(uint usernumber, int which)
&& chk_ar(cfg.prot[i]->ar,&useron))
break;
if(i<cfg.total_prots) {
j=protocol(cmdstr(cfg.prot[i]->dlcmd,str2,nulstr,NULL),false);
error=protocol(cmdstr(cfg.prot[i]->dlcmd,str2,nulstr,NULL),false);
if((cfg.prot[i]->misc&PROT_DSZLOG
&& checkprotlog(&fd))
|| (!(cfg.prot[i]->misc&PROT_DSZLOG) && !j)) {
|| (!(cfg.prot[i]->misc&PROT_DSZLOG) && !error)) {
if(which==MAIL_YOUR)
remove(str2);
logon_dlb+=length; /* Update stats */
......
......@@ -45,7 +45,8 @@ void sbbs_t::temp_xfer()
{
char str[256],tmp2[256],done=0,ch;
char tmp[512];
uint i,dirnum=cfg.total_dirs,j,files;
int error;
uint i,dirnum=cfg.total_dirs,files;
ulong bytes;
ulong space;
time_t start,end,t;
......@@ -175,7 +176,7 @@ void sbbs_t::temp_xfer()
putnodedat(cfg.node_num,&thisnode); /* calculate ETA */
start=time(NULL);
j=protocol(cmdstr(cfg.prot[i]->dlcmd,str,nulstr,NULL),false);
error=protocol(cmdstr(cfg.prot[i]->dlcmd,str,nulstr,NULL),false);
end=time(NULL);
if(cfg.dir[temp_dirnum]->misc&DIR_TFREE)
starttime+=end-start;
......@@ -185,7 +186,7 @@ void sbbs_t::temp_xfer()
else
notdownloaded(f.size,start,end); }
else {
if(!j)
if(!error)
downloadfile(&f);
else {
bprintf(text[FileNotSent],f.name);
......
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