commit ec8f440383d997e11d9374c6862bf1df81f203d3
parent b0bbd23512ff41608adc07dec77abf97b58012ba
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Sun, 3 Apr 2011 16:29:18 +0200
don't call cancel() repeatedly on a store
erroring command replies will trickle in even after canceling
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/sync.c b/src/sync.c
@@ -185,7 +185,8 @@ typedef struct {
#define ST_SENT_FLAGS (1<<3)
#define ST_SENT_TRASH (1<<4)
#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)
@@ -399,7 +400,9 @@ cancel_sync( sync_vars_t *svars )
int other_state = svars->state[1-t];
if (svars->ret & SYNC_BAD(t)) {
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 );
}
if (other_state & ST_CANCELED)