[asterisk-commits] tilghman: branch 1.4 r278261 - /branches/1.4/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 20 17:23:19 CDT 2010


Author: tilghman
Date: Tue Jul 20 17:23:13 2010
New Revision: 278261

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278261
Log:
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)

Modified:
    branches/1.4/apps/app_voicemail.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=278261&r1=278260&r2=278261
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Tue Jul 20 17:23:13 2010
@@ -5955,12 +5955,15 @@
 			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);
 			}
 		}




More information about the asterisk-commits mailing list