commit 1ca278ad0d11166b3ffbe116c5c90f6cda09ccb5
parent eab3874918f9c80db69a1b72d2f546efba4caa01
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Sat, 26 Feb 2022 18:24:04 +0100
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.
Diffstat:
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git 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
@@ -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 );