Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commits (2)
  • Rob Swindell's avatar
    Debug the "thread_back field missing" error · 908618c8
    Rob Swindell authored
    Some QWKnet vote messages are failing:
    evnt unpackREP <ENSEMBLE> !ERROR 2 (No such file or directory) in qwk.cpp line 1146 (qwk_vote) writing "/sbbs/data/subs/dove-gen" access=-105 info=smb_addvote thread_back field missing
    
    Catch this problem a little higher up (in votemsg()) and log the message's reply-IDs to help determine what's the root-cause here. Don't bother calling smb_addvote() if thread_back is 0.
    908618c8
  • Rob Swindell's avatar
    Add/use P_REMOTE print-mode flag to bputs() · 12fde4ab
    Rob Swindell authored
    Do nothing if online != ON_REMOTE. Eliminates some if(online == ON_REMOTE) clauses.
    12fde4ab
......@@ -47,6 +47,7 @@ char* sbbs_t::auto_utf8(const char* str, long* mode)
P_AUTO_UTF8
P_NOATCODES
P_TRUNCATE
P_REMOTE
****************************************************************************/
int sbbs_t::bputs(const char *str, long mode)
{
......@@ -54,6 +55,9 @@ int sbbs_t::bputs(const char *str, long mode)
ulong l=0;
long term = term_supports();
if((mode & P_REMOTE) && online != ON_REMOTE)
return 0;
if(online==ON_LOCAL && console&CON_L_ECHO) /* script running as event */
return(lputs(LOG_INFO, str));
......
......@@ -552,6 +552,11 @@ extern "C" int votemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, const char* smsgf
if(smb_getmsgidx_by_msgid(smb, &remsg, msg->reply_id) == SMB_SUCCESS)
msg->hdr.thread_back = remsg.idx.number; /* poll or message being voted on */
}
if(msg->hdr.thread_back == 0) {
safe_snprintf(smb->last_error, sizeof(smb->last_error), "%s thread_back field is zero (reply_id=%s, ftn_reply=%s)"
,__FUNCTION__, msg->reply_id, msg->ftn_reply);
return SMB_ERR_HDR_FIELD;
}
if(smb_voted_already(smb, msg->hdr.thread_back, msg->from, (enum smb_net_type)msg->from_net.type, msg->from_net.addr))
return SMB_DUPE_MSG;
remsg.hdr.number = msg->hdr.thread_back;
......
......@@ -488,8 +488,7 @@ bool sbbs_t::qwk_import_msg(FILE *qwk_fp, char *hdrblk, ulong blocks
smb_hfield_str(msg, FIDOCHARSET, charset);
}
if(online==ON_REMOTE)
bputs(text[WritingIndx]);
bputs(P_REMOTE, text[WritingIndx]);
if(smb->status.max_crcs==0) /* no CRC checking means no body text dupe checking */
dupechk_hashes&=~(1<<SMB_HASH_SOURCE_BODY);
......
......@@ -752,6 +752,7 @@ typedef enum { /* Values for xtrn_t.event */
#define P_NOXATTRS (1<<15) /* No "Extra Attribute Codes" supported */
#define P_MARKUP (1<<16) /* Support StyleCodes/Rich/StructuredText */
#define P_HIDEMARKS (1<<17) /* Hide the mark-up characters */
#define P_REMOTE (1<<18) /* Only print when online == ON_REMOTE */
/* Bits in 'mode' for listfiles */
#define FL_ULTIME (1<<0) /* List files by upload time */
......
......@@ -338,8 +338,7 @@ bool sbbs_t::unpack_rep(char* repfile)
useron.etoday++;
putuserrec(&cfg,useron.number,U_ETODAY,5
,ultoa(useron.etoday,tmp,10));
if(online == ON_REMOTE)
bprintf(text[Emailed],username(&cfg,usernum,tmp),usernum);
bprintf(P_REMOTE, text[Emailed],username(&cfg,usernum,tmp),usernum);
SAFEPRINTF2(str,"sent QWK e-mail to %s #%d"
,username(&cfg,usernum,tmp),usernum);
logline("E+",str);
......@@ -374,7 +373,7 @@ bool sbbs_t::unpack_rep(char* repfile)
else { /* message on a sub-board */
/**************************/
if((n=resolve_qwkconf(confnum))==INVALID_SUB) {
bprintf(text[QWKInvalidConferenceN],confnum);
bprintf(P_REMOTE, text[QWKInvalidConferenceN],confnum);
SAFEPRINTF(str,"Invalid QWK conference number %ld", confnum);
logline(LOG_NOTICE,"P!",str);
errors++;
......@@ -514,8 +513,7 @@ bool sbbs_t::unpack_rep(char* repfile)
,/* fromhub: */0, &smb, /* touser: */0, &msg, &dupe)) {
logon_posts++;
user_posted_msg(&cfg, &useron, 1);
if(online == ON_REMOTE)
bprintf(text[Posted],cfg.grp[cfg.sub[n]->grp]->sname
bprintf(P_REMOTE, text[Posted],cfg.grp[cfg.sub[n]->grp]->sname
,cfg.sub[n]->lname);
SAFEPRINTF2(str,"posted QWK message on %s %s"
,cfg.grp[cfg.sub[n]->grp]->sname,cfg.sub[n]->lname);
......