Browse Source

don't call cancel() repeatedly on a store

erroring command replies will trickle in even after canceling
wip/maildir-uid-dupes-test
Oswald Buddenhagen 14 years ago
parent
commit
ec8f440383
  1. 7
      src/sync.c

7
src/sync.c

@ -185,7 +185,8 @@ typedef struct {
#define ST_SENT_FLAGS (1<<3) #define ST_SENT_FLAGS (1<<3)
#define ST_SENT_TRASH (1<<4) #define ST_SENT_TRASH (1<<4)
#define ST_CLOSED (1<<5) #define ST_CLOSED (1<<5)
#define ST_CANCELED (1<<6) #define ST_SENT_CANCEL (1<<6)
#define ST_CANCELED (1<<7)
#define ST_DID_EXPUNGE (1<<16) #define ST_DID_EXPUNGE (1<<16)
@ -399,7 +400,9 @@ cancel_sync( sync_vars_t *svars )
int other_state = svars->state[1-t]; int other_state = svars->state[1-t];
if (svars->ret & SYNC_BAD(t)) { if (svars->ret & SYNC_BAD(t)) {
cancel_done( AUX ); cancel_done( AUX );
} else { } else if (!(svars->state[t] & ST_SENT_CANCEL)) {
/* ignore subsequent failures from in-flight commands */
svars->state[t] |= ST_SENT_CANCEL;
svars->drv[t]->cancel( svars->ctx[t], cancel_done, AUX ); svars->drv[t]->cancel( svars->ctx[t], cancel_done, AUX );
} }
if (other_state & ST_CANCELED) if (other_state & ST_CANCELED)

Loading…
Cancel
Save