isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 254d2be9f47fd63285ac9c39d32be8bec7c7a6f7
parent 2b797fac6187736fc71b21a17cad6fa6793463e6
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Wed,  2 Feb 2022 13:06:43 +0100

remove pointless "lost track of ... messages" warnings

it doesn't really add any value when resuming after an interruption, as
incomplete propagations are perfectly expected, and are recovered from.
but it does make sense in the non-UIDPLUS path, where not finding just
stored messages indicates a problem.
so move the reporting from match_tuids() to msgs_found_new(), and remove
a redundant warning from the latter.

amends 6577bf3e.

Diffstat:
Msrc/sync.c | 18++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/sync.c b/src/sync.c @@ -283,7 +283,7 @@ assign_tuid( sync_vars_t *svars, sync_rec_t *srec ) JLOG( "# %u %u %." stringify(TUIDL) "s", (srec->uid[F], srec->uid[N], srec->tuid), "new TUID" ); } -static void +static int match_tuids( sync_vars_t *svars, int t, message_t *msgs ) { sync_rec_t *srec; @@ -324,8 +324,7 @@ match_tuids( sync_vars_t *svars, int t, message_t *msgs ) ASSIGN_UID( srec, t, tmsg->uid, "TUID matched %s", diag ); } } - if (num_lost) - warn( "Warning: lost track of %d %sed message(s)\n", num_lost, str_hl[t] ); + return num_lost; } @@ -2161,15 +2160,10 @@ static void msgs_found_new( int sts, message_t *msgs, void *aux ) { SVARS_CHECK_RET; - switch (sts) { - case DRV_OK: - debug( "matching just copied messages on %s\n", str_fn[t] ); - break; - default: - warn( "Warning: cannot find newly stored messages on %s.\n", str_fn[t] ); - break; - } - match_tuids( svars, t, msgs ); + debug( "matching just copied messages on %s\n", str_fn[t] ); + int num_lost = match_tuids( svars, t, msgs ); + if (num_lost) + warn( "Warning: lost track of %d %sed message(s)\n", num_lost, str_hl[t] ); msgs_new_done( svars, t ); }