mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-09 16:06:53 -07:00
Delete IMAP messages in reverse order, to ensure reordering after each expunge does not cause deletion of the wrong message.
(closes issue #16350) Reported by: noahisaac Patches: 20100623__issue16350.diff.txt uploaded by tilghman (license 14) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@278261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5955,12 +5955,15 @@ static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
|
||||
DELETE(vms->curdir, x, vms->fn, vmu);
|
||||
}
|
||||
ast_unlock_path(vms->curdir);
|
||||
#else
|
||||
#else /* defined(IMAP_STORAGE) */
|
||||
if (vms->deleted) {
|
||||
for (x=0;x < vmu->maxmsg;x++) {
|
||||
if (vms->deleted[x]) {
|
||||
if (option_debug > 2)
|
||||
ast_log(LOG_DEBUG,"IMAP delete of %d\n",x);
|
||||
/* Since we now expunge after each delete, deleting in reverse order
|
||||
* ensures that no reordering occurs between each step. */
|
||||
for (x = vmu->maxmsg - 1; x >= 0; x--) {
|
||||
if (vms->deleted[x]) {
|
||||
if (option_debug > 2) {
|
||||
ast_log(LOG_DEBUG, "IMAP delete of %d\n", x);
|
||||
}
|
||||
DELETE(vms->curdir, x, vms->fn, vmu);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user