Commit 0a335d41 authored by rswindell's avatar rswindell
Browse files

Initializes smb.subnum for SMB-related @-codes and JS properties.

parent b77a1b67
......@@ -75,6 +75,7 @@ void sbbs_t::bulkmail(uchar *ar)
return; }
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......
......@@ -157,6 +157,7 @@ bool sbbs_t::email(int usernumber, char *top, char *subj, long mode)
return(false); }
sprintf(smb.file,"%smail", cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......
......@@ -624,6 +624,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
return; }
sprintf(smb.file,"%smail", cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......
......@@ -337,6 +337,7 @@ ulong sbbs_t::getmsgnum(uint subnum, time_t t)
sprintf(smb.file,"%s%s",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=subnum;
if((i=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
return(0); }
......@@ -395,6 +396,7 @@ time_t sbbs_t::getmsgtime(uint subnum, ulong ptr)
sprintf(smb.file,"%s%s",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=subnum;
if((i=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
return(0); }
......@@ -464,6 +466,7 @@ ulong sbbs_t::getlastmsg(uint subnum, ulong *ptr, time_t *t)
sprintf(smb.file,"%s%s",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=subnum;
if((i=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
return(0); }
......
......@@ -58,6 +58,7 @@ int DLLCALL getmail(scfg_t* cfg, int usernumber, BOOL sent)
return(0);
if(!usernumber)
return(l/sizeof(idxrec_t)); /* Total system e-mail */
smb.subnum=INVALID_SUB;
if(smb_open(&smb)!=0)
return(0);
while(!smb_feof(smb.sid_fp)) {
......@@ -297,6 +298,7 @@ void sbbs_t::delallmail(uint usernumber)
return; }
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
smb_stack(&smb,SMB_STACK_POP);
......
......@@ -2748,6 +2748,7 @@ void node_thread(void* arg)
lprintf("Purging deleted/expired e-mail");
sprintf(sbbs->smb.file,"%smail",sbbs->cfg.data_dir);
sbbs->smb.retry_time=sbbs->cfg.smb_retry_time;
sbbs->smb.subnum=INVALID_SUB;
if((i=smb_open(&sbbs->smb))!=0)
sbbs->errormsg(WHERE,ERR_OPEN,sbbs->smb.file,i,sbbs->smb.last_error);
else {
......
......@@ -144,6 +144,7 @@ bool sbbs_t::inetmail(char *into, char *subj, long mode)
return(false); }
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......@@ -340,6 +341,7 @@ bool sbbs_t::qnetmail(char *into, char *subj, long mode)
return(false); }
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......
......@@ -226,6 +226,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
if(useron.qwk&(QWK_EMAIL|QWK_ALLMAIL) /* && !prepack */) {
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
fclose(qwk);
if(personal)
......@@ -328,6 +329,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
sprintf(smb.file,"%s%s"
,cfg.sub[usrsub[i][j]]->data_dir,cfg.sub[usrsub[i][j]]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=usrsub[i][j];
if((k=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,k,smb.last_error);
continue; }
......
......@@ -85,6 +85,7 @@ bool sbbs_t::pack_rep(uint hubnum)
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
fclose(rep);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......@@ -141,6 +142,7 @@ bool sbbs_t::pack_rep(uint hubnum)
sprintf(smb.file,"%s%s"
,cfg.sub[j]->data_dir,cfg.sub[j]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=j;
if((k=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,k,smb.last_error);
continue; }
......@@ -240,6 +242,7 @@ bool sbbs_t::pack_rep(uint hubnum)
if(packedmail) { /* Delete NetMail */
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
return(true); }
......
......@@ -322,6 +322,7 @@ void sbbs_t::qwk_success(ulong msgcnt, char bi, char prepack)
if(useron.qwk&(QWK_EMAIL|QWK_ALLMAIL)) {
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
return; }
......
......@@ -431,6 +431,7 @@ for(i=0;i<total_subs;i++) {
,LEN_GSNAME,grp[sub[i]->grp]->sname,sub[i]->lname);
sprintf(smb.file,"%s%s",sub[i]->data_dir,sub[i]->code);
smb.retry_time=30;
smb.sunum=i;
if((j=smb_open(&smb))!=0) {
printf("smb_open returned %d\n",j);
continue; }
......
......@@ -70,6 +70,7 @@ void sbbs_t::readmail(uint usernumber, int which)
return; }
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......@@ -209,6 +210,7 @@ void sbbs_t::readmail(uint usernumber, int which)
if(domsg && !(sys_status&SS_ABORT)) {
msg.subnum=INVALID_SUB;
show_msg(&msg
,msg.from_ext && msg.idx.from==1 && !msg.from_net.type
? 0:P_NOATCODES);
......
......@@ -298,6 +298,7 @@ int sbbs_t::scanposts(uint subnum, long mode, char *find)
return(0); }
sprintf(smb.file,"%s%s",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=subnum;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......@@ -472,6 +473,7 @@ int sbbs_t::scanposts(uint subnum, long mode, char *find)
if(!reads && mode)
CRLF;
msg.subnum=subnum;
show_msg(&msg
,msg.from_ext && !strcmp(msg.from_ext,"1") && !msg.from_net.type
? 0:P_NOATCODES);
......@@ -951,6 +953,7 @@ int sbbs_t::searchsub(uint subnum, char *search)
total=getposts(&cfg,subnum);
sprintf(smb.file,"%s%s",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=subnum;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......@@ -1081,6 +1084,7 @@ int sbbs_t::searchsub_toyou(uint subnum)
total=getposts(&cfg,subnum);
sprintf(smb.file,"%s%s",cfg.sub[subnum]->data_dir,cfg.sub[subnum]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=subnum;
if((i=smb_open(&smb))!=0) {
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_OPEN,smb.file,i,smb.last_error);
......
......@@ -134,6 +134,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
smb_stack(&smb,SMB_STACK_PUSH);
sprintf(smb.file,"%smail",cfg.data_dir);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=INVALID_SUB;
if((k=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,k,smb.last_error);
smb_stack(&smb,SMB_STACK_POP);
......@@ -191,6 +192,7 @@ bool sbbs_t::unpack_qwk(char *packet,uint hubnum)
lastsub=INVALID_SUB;
sprintf(smb.file,"%s%s",cfg.sub[j]->data_dir,cfg.sub[j]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=j;
if((k=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,k,smb.last_error);
continue;
......
......@@ -174,6 +174,7 @@ bool sbbs_t::unpack_rep(char* repfile)
smb_close(&smb);
lastsub=INVALID_SUB; }
smb.subnum=INVALID_SUB;
if((k=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,k,smb.last_error);
continue; }
......@@ -351,6 +352,7 @@ bool sbbs_t::unpack_rep(char* repfile)
lastsub=INVALID_SUB;
sprintf(smb.file,"%s%s",cfg.sub[n]->data_dir,cfg.sub[n]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=n;
if((j=smb_open(&smb))!=0) {
errormsg(WHERE,ERR_OPEN,smb.file,j,smb.last_error);
continue; }
......
......@@ -1140,6 +1140,7 @@ bool sbbs_t::movemsg(smbmsg_t* msg, uint subnum)
sprintf(smb.file,"%s%s",cfg.sub[newsub]->data_dir,cfg.sub[newsub]->code);
smb.retry_time=cfg.smb_retry_time;
smb.subnum=newsub;
if((i=smb_open(&smb))!=0) {
FREE(buf);
smb_stack(&smb,SMB_STACK_POP);
......
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