commit 161a4b11599cdda24339c34a34e91e33bb206e5a
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Jan 31 15:12:34 2006 +0000

    backport:
    - sanitize flag handling of expired messages
    - don't record we synced flags if we didn't
    - remove now superfluous temporary rflags

 src/sync.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index 3b0e1b6..3722f01 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -251,7 +251,7 @@ sync_old( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
 {
        driver_t *tdriver = tctx->conf->driver, *sdriver = sctx->conf->driver;
        int uid, tuid, unex;
-       unsigned char sflags, aflags, dflags, rflags;
+       unsigned char sflags, aflags, dflags;
        msg_data_t msgdata;
 
        /* excludes (push) c.3) d.2) d.3) d.4) / (pull) b.3) d.7) d.8) d.9) */
@@ -332,20 +332,18 @@ sync_old( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
                        unex = 0;
                        if (srec->status & S_EXPIRED) {
                                if (!pull) {
-                                       if (sflags & F_DELETED) {
-                                               if (!(sflags & F_FLAGGED))
-                                                       aflags &= ~F_DELETED;
-                                       } else
-                                               unex = 1;
+                                       if ((aflags & ~F_DELETED) || dflags)
+                                               info( "Info: Flags of expired 
message changed in (%d,%d)\n", srec->muid, srec->suid );
+                                       return SYNC_OK;
                                } else {
                                        if ((sflags & F_FLAGGED) && !(sflags & 
F_DELETED)) {
                                                unex = 1;
                                                dflags |= F_DELETED;
-                                       }
+                                       } else
+                                               return SYNC_OK;
                                }
                        }
-                       rflags = (*nflags | aflags) & ~dflags;
-                       if ((tops & OP_EXPUNGE) && (rflags & F_DELETED) &&
+                       if ((tops & OP_EXPUNGE) && (sflags & F_DELETED) &&
                            (!tctx->conf->trash || tctx->conf->trash_only_new))
                        {
                                aflags &= F_DELETED;
@@ -356,7 +354,7 @@ sync_old( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
                        case DRV_BOX_BAD: return SYNC_FAIL;
                        default: /* ok */ break;
                        case DRV_OK:
-                               *nflags = rflags;
+                               *nflags = (*nflags | aflags) & ~dflags;
                                if (unex) {
                                        debug( "unexpiring pair(%d,%d)\n", 
srec->muid, srec->suid );
                                        /* log last, so deletion can't be 
misinterpreted! */

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to