jcs
/subtext
/amendments
/485
binkp: Setup binkp_*_dir variables even if we're not polling
Posting to an FTN board needs to know where the outbox dir is, or
it'll write files in the wrong place.
jcs made amendment 485 about 1 year ago
--- binkp.c Mon Apr 17 15:10:38 2023
+++ binkp.c Wed Apr 19 00:43:17 2023
@@ -59,6 +59,12 @@ binkp_init(void)
{
Str255 base_dir;
+ binkp_mkdir(base_dir, NULL);
+ binkp_mkdir(binkp_inbox_dir, "inbox");
+ binkp_mkdir(binkp_done_dir, "processed");
+ binkp_mkdir(binkp_outbox_dir, "outbox");
+ binkp_mkdir(binkp_bad_dir, "bad");
+
if (db->config.binkp_hostname[0] == '\0')
return;
@@ -69,12 +75,6 @@ binkp_init(void)
return;
}
- binkp_mkdir(base_dir, NULL);
- binkp_mkdir(binkp_inbox_dir, "inbox");
- binkp_mkdir(binkp_done_dir, "processed");
- binkp_mkdir(binkp_outbox_dir, "outbox");
- binkp_mkdir(binkp_bad_dir, "bad");
-
binkp_ready = true;
}
@@ -1063,6 +1063,11 @@ binkp_scan_message(struct fidopkt_message *msg)
if (size == 0) {
logger_printf("[binkp] Failed encoding fidopkt during scan");
return false;
+ }
+
+ if (binkp_outbox_dir[0] == 0) {
+ warn("binkp: outbox dir is empty, can't store scanned packet");
+ goto done;
}
snprintf(filename, sizeof(filename), "%c%07lx.pkt",
--- main.c Mon Mar 27 11:07:06 2023
+++ main.c Wed Apr 19 00:34:06 2023
@@ -119,12 +119,11 @@ main(void)
logger_printf("[db] Updating username cache");
user_cache_usernames();
+ binkp_init();
if (db->config.telnet_port)
telnet_init();
if (db->config.modem_port)
serial_init();
- if (db->config.binkp_hostname[0])
- binkp_init();
blanker_last_blank = Time;