Browse Source

make callbacks return early when canceling

even after driver->cancel() the store may complete commands successfully.
return early in this case, so we don't attempt to continue syncing.
wip/maildir-uid-dupes-test
Oswald Buddenhagen 12 years ago
parent
commit
424e0e7221
  1. 12
      src/sync.c

12
src/sync.c

@ -246,6 +246,11 @@ msg_fetched( int sts, void *aux )
switch (sts) {
case DRV_OK:
INIT_SVARS(vars->aux);
if (check_cancel( svars )) {
free( vars->data.data );
vars->cb( SYNC_CANCELED, 0, vars );
return;
}
vars->msg->flags = vars->data.flags;
@ -482,16 +487,15 @@ check_ret( int sts, void *aux )
{
DECL_SVARS;
switch (sts) {
case DRV_CANCELED:
if (sts == DRV_CANCELED)
return 1;
case DRV_BOX_BAD:
INIT_SVARS(aux);
if (sts == DRV_BOX_BAD) {
svars->ret |= SYNC_FAIL;
cancel_sync( svars );
return 1;
}
return 0;
return check_cancel( svars );
}
#define SVARS_CHECK_RET \

Loading…
Cancel
Save