AmendHub

Download:

jcs

/

subtext

/

amendments

/

431

binkp: Delete path after processing, not done_path

Also panic if deleting outbox file fails, otherwise we'll be sending
it over and over again

jcs made amendment 431 about 1 year ago
--- binkp.c Wed Mar 15 13:56:28 2023 +++ binkp.c Wed Mar 15 17:34:38 2023 @@ -710,9 +710,9 @@ binkp_toss_inbox(void) CtoPstr(binkp_done_dir); if (db->config.binkp_delete_done) { - if ((error = FSDelete(done_path, 0)) != 0) { - logger_printf("[binkp] Failed deleting %s: %d", - PtoCstr(done_path), error); + if ((error = FSDelete(path, 0)) != 0) { + logger_printf("[binkp] Failed deleting inbox file %s: %d", + PtoCstr(path), error); break; } } else { @@ -971,11 +971,10 @@ binkp_deliver_outbox(void) logger_printf("[binkp] Successfully sent file %s", file_name_c); error = FSDelete(path, 0); - if (error) { - logger_printf("[binkp] Failed deleting file %s: %d", + if (error) + /* this must be fatal so we don't keep trying this file */ + panic("[binkp] Failed deleting outbox file %s: %d", PtoCstr(path), error); - goto done; - } } if (!binkp_send_frame(BINKP_COMMAND_M_EOB, "", 0))