CVS commit by ossi: 

handle failure to store message. this helps with invalid messages like
0-byte files after crashes.


  M +1 -0      drv_imap.c   1.10.2.10
  M +14 -0     sync.c   1.43.2.5


--- isync/src/drv_imap.c  #1.10.2.9:1.10.2.10
@@ -1587,4 +1587,5 @@ imap_store_msg( store_t *gctx, msg_data_
                /* invalid message */
                free( fmap );
+               fprintf( stderr, "IMAP warning: storing message with incomplete 
header.\n" );
                return DRV_MSG_BAD;
         mktid:

--- isync/src/sync.c  #1.43.2.4:1.43.2.5
@@ -302,4 +302,11 @@ sync_old( int tops, store_t *sctx, store
                                                smsg->flags = msgdata.flags;
                                                switch (tdriver->store_msg( 
tctx, &msgdata, &uid )) {
+                                               case DRV_MSG_BAD:
+                                                       warn( pull ?
+                                                             "Warning: Slave 
refuses to store message %d from master.\n" :
+                                                             "Warning: Master 
refuses to store message %d from slave.\n",
+                                                             smsg->uid );
+                                                       smsg->status |= 
M_NOT_SYNCED;
+                                                       break;
                                                case DRV_STORE_BAD: return pull 
? SYNC_SLAVE_BAD : SYNC_MASTER_BAD;
                                                default: return SYNC_FAIL;
@@ -400,4 +407,11 @@ sync_new( int tops, store_t *sctx, store
                                                msg->flags = msgdata.flags;
                                                switch (tdriver->store_msg( 
tctx, &msgdata, &uid )) {
+                                               case DRV_MSG_BAD:
+                                                       warn( pull ?
+                                                             "Warning: Slave 
refuses to store message %d from master.\n" :
+                                                             "Warning: Master 
refuses to store message %d from slave.\n",
+                                                             msg->uid );
+                                                       msg->status |= 
M_NOT_SYNCED;
+                                                       continue;
                                                case DRV_STORE_BAD: return pull 
? SYNC_SLAVE_BAD : SYNC_MASTER_BAD;
                                                default: return SYNC_FAIL;



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to