From a3fb753490bf252ff1742459abd1b9ed248e2b56 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 23 Mar 2012 15:15:27 -0400 Subject: [PATCH] CamelIMAPXServer: Prevent failed commands from starting new ones. --- camel/providers/imapx/camel-imapx-server.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c index 4b0ec46..35e4384 100644 --- a/camel/providers/imapx/camel-imapx-server.c +++ b/camel/providers/imapx/camel-imapx-server.c @@ -546,6 +546,14 @@ err: camel_imapx_command_queue_remove (is->active, ic); + /* HACK: Since we're failing, make sure the command has a status + * structure and the result code indicates failure, so the + * ic->complete() callback does not start a new command. */ + if (ic->status == NULL) + ic->status = g_malloc0 (sizeof (struct _status_info)); + if (ic->status->result == IMAPX_OK) + ic->status->result = IMAPX_UNKNOWN; + /* Send a NULL GError since we've already set a * GError to get here, and we're not interested * in individual command errors. */ -- 2.7.4