commit e6a15bee596eda747a016c9c52b27761c1632350
parent 3febb16fd5567ed18acd829a702193f97c9d30d3
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Sun, 20 Feb 2022 12:39:19 +0100
make sure we fetch source flags when expiring while pulling new
otherwise important messages may be incorrectly aborted.
Diffstat:
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/run-tests.pl b/src/run-tests.pl
@@ -1251,20 +1251,21 @@ my @x35 = (
A, "*F", "*F", "*F",
B, "*", "*", "*",
C, "*", "", "",
- D, "*", "", "",
+ D, "*F", "", "",
E, "*", "", "",
F, "*", "", "",
G, "*", "", "",
- H, "*", "", "",
+ H, "*F", "", "",
);
my @O35 = ("", "", "Sync New\nMaxMessages 3\nExpireUnread yes\n");
my @X35 = (
H, E, H,
B, "", "+~", "+T",
+ D, "", "*F", "*F",
F, "", "*", "*",
G, "", "*", "*",
- H, "", "*", "*",
+ H, "", "*F", "*F",
);
test("max messages + expire - too many new", \@x35, \@X35, \@O35);
diff --git a/src/sync.c b/src/sync.c
@@ -792,6 +792,8 @@ box_opened2( sync_vars_t *svars, int t )
svars->any_expiring = 1;
if (svars->any_expiring) {
opts[N] |= OPEN_OLD | OPEN_FLAGS;
+ if (chan->ops[N] & (OP_NEW | OP_RENEW))
+ opts[F] |= OPEN_FLAGS;
}
svars->opts[F] = svars->drv[F]->prepare_load_box( ctx[F], opts[F] );
svars->opts[N] = svars->drv[N]->prepare_load_box( ctx[N], opts[N] );