Commit b9e78bdf authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Batch download queue not cleared upon packed QWK packet

Before the "new filebase" merge of 2021, a user's batch download queue would be cleared when a QWK packet was successfully packed for them via the event thread (i.e. triggered via semaphore file). That was lost in the new filebase change (the batch download queue would not be cleared) - caught by Coverity (CID 350336).

It appears pre-packed QWK packets never cleared the batch download queue (does anyone actually use this feature in this day and age?) - fixed.
parent d4306822
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "telnet.h" #include "telnet.h"
#include "netwrap.h" #include "netwrap.h"
#include "petdefs.h" #include "petdefs.h"
#include "filedat.h"
#include "js_rtpool.h" #include "js_rtpool.h"
#include "js_request.h" #include "js_request.h"
#include "ssl.h" #include "ssl.h"
...@@ -2570,7 +2571,6 @@ static bool is_time_to_run(time_t now, const qhub_t* hub) ...@@ -2570,7 +2571,6 @@ static bool is_time_to_run(time_t now, const qhub_t* hub)
void event_thread(void* arg) void event_thread(void* arg)
{ {
char str[MAX_PATH+1]; char str[MAX_PATH+1];
char bat_list[MAX_PATH+1];
char semfile[MAX_PATH+1]; char semfile[MAX_PATH+1];
int i,j,k; int i,j,k;
int file; int file;
...@@ -2752,7 +2752,7 @@ void event_thread(void* arg) ...@@ -2752,7 +2752,7 @@ void event_thread(void* arg)
sbbs->lprintf(LOG_INFO, "Packing completed: %s", str); sbbs->lprintf(LOG_INFO, "Packing completed: %s", str);
sbbs->qwk_success(l,0,1); sbbs->qwk_success(l,0,1);
sbbs->putmsgptrs(); sbbs->putmsgptrs();
remove(bat_list); batch_list_clear(&sbbs->cfg, sbbs->useron.number, XFER_BATCH_DOWNLOAD);
} else } else
sbbs->lputs(LOG_INFO, "No packet created (no new messages)"); sbbs->lputs(LOG_INFO, "No packet created (no new messages)");
sbbs->delfiles(sbbs->cfg.temp_dir,ALLFILES); sbbs->delfiles(sbbs->cfg.temp_dir,ALLFILES);
...@@ -2804,6 +2804,7 @@ void event_thread(void* arg) ...@@ -2804,6 +2804,7 @@ void event_thread(void* arg)
if(sbbs->pack_qwk(str,&l,true /* pre-pack */)) { if(sbbs->pack_qwk(str,&l,true /* pre-pack */)) {
sbbs->qwk_success(l,0,1); sbbs->qwk_success(l,0,1);
sbbs->putmsgptrs(); sbbs->putmsgptrs();
batch_list_clear(&sbbs->cfg, sbbs->useron.number, XFER_BATCH_DOWNLOAD);
} }
sbbs->delfiles(sbbs->cfg.temp_dir,ALLFILES); sbbs->delfiles(sbbs->cfg.temp_dir,ALLFILES);
sbbs->console&=~CON_L_ECHO; sbbs->console&=~CON_L_ECHO;
......
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