From 1ca278ad0d11166b3ffbe116c5c90f6cda09ccb5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 26 Feb 2022 18:24:04 +0100 Subject: [PATCH] simplify journaling of expiring unborn messages don't use a separate journal command anymore, but handle them like regular expirations, and let the entry purge loop at the end cleanup them. --- src/sync.c | 4 ++-- src/sync_state.c | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/sync.c b/src/sync.c index e52eed0..f82846a 100644 --- a/src/sync.c +++ b/src/sync.c @@ -1319,14 +1319,14 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux } } else { if (srec->status & S_NEXPIRE) { - JLOG( "= %u %u", (srec->uid[F], srec->uid[N]), "expire unborn" ); + srec->status = S_EXPIRE | S_EXPIRED; + JLOG( "~ %u %u %u", (srec->uid[F], srec->uid[N], srec->status), "expire unborn" ); // If we have so many new messages that some of them are instantly expired, // but some are still propagated because they are important, we need to // ensure explicitly that the bulk fetch limit is upped. if (svars->maxxfuid < srec->uid[F]) svars->maxxfuid = srec->uid[F]; srec->msg[F]->srec = NULL; - srec->status = S_DEAD; } } } diff --git a/src/sync_state.c b/src/sync_state.c index 9130b3d..3329efd 100644 --- a/src/sync_state.c +++ b/src/sync_state.c @@ -298,7 +298,6 @@ load_state( sync_vars_t *svars ) case '+': case '&': case '-': - case '=': case '_': case '|': bad = sscanf( buf + 2, "%u %u", &t1, &t2 ) != 2; @@ -364,12 +363,6 @@ load_state( sync_vars_t *svars ) debug( "killed\n" ); srec->status = S_DEAD; break; - case '=': - debug( "aborted\n" ); - if (svars->maxxfuid < srec->uid[F]) - svars->maxxfuid = srec->uid[F]; - srec->status = S_DEAD; - break; case '#': memcpy( srec->tuid, buf + tn + 2, TUIDL ); debug( "TUID now %." stringify(TUIDL) "s\n", srec->tuid );