瀏覽代碼

don't attempt to issue LOGOUT on bad stores

amends 9d22641b.
Oswald Buddenhagen 9 年之前
父節點
當前提交
8bd6eb433f
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/drv_imap.c

+ 6 - 2
src/drv_imap.c

@@ -1501,8 +1501,12 @@ imap_cleanup( void )
 	for (ctx = unowned; ctx; ctx = nctx) {
 		nctx = ctx->next;
 		set_bad_callback( ctx, (void (*)(void *))imap_cancel_store, ctx );
-		((imap_store_t *)ctx)->expectBYE = 1;
-		imap_exec( (imap_store_t *)ctx, 0, imap_cleanup_p2, "LOGOUT" );
+		if (((imap_store_t *)ctx)->state != SST_BAD) {
+			((imap_store_t *)ctx)->expectBYE = 1;
+			imap_exec( (imap_store_t *)ctx, 0, imap_cleanup_p2, "LOGOUT" );
+		} else {
+			imap_cancel_store( ctx );
+		}
 	}
 }