[evolution-data-server] [IMAPx] Better runtime warning when running command on top of another



commit 8f6ac926f2f927d0e687bec07fa67e4d96c518f1
Author: Milan Crha <mcrha redhat com>
Date:   Thu Sep 3 14:47:46 2015 +0200

    [IMAPx] Better runtime warning when running command on top of another
    
    The CamelIMAPXServer should run only one command at one time, it's
    an error to issue two commands at the same time, thus rather than
    just printing an issue about the current_command not being NULL print
    what job is processing and which is to be processed, for better debugging.

 camel/providers/imapx/camel-imapx-command.h |    2 --
 camel/providers/imapx/camel-imapx-server.c  |    6 +++++-
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-command.h b/camel/providers/imapx/camel-imapx-command.h
index b8e56d4..836ac45 100644
--- a/camel/providers/imapx/camel-imapx-command.h
+++ b/camel/providers/imapx/camel-imapx-command.h
@@ -60,8 +60,6 @@ struct _CamelIMAPXCommandPart {
        gpointer ob;
 };
 
-
-
 struct _CamelIMAPXCommand {
        struct _CamelIMAPXServer *is;
        gint pri;
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index c9f17d5..c40d8af 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -3636,7 +3636,11 @@ camel_imapx_server_process_command_sync (CamelIMAPXServer *is,
 
        COMMAND_LOCK (is);
 
-       g_warn_if_fail (is->priv->current_command == NULL);
+       if (is->priv->current_command != NULL) {
+               g_warning ("%s: Starting command '%s' while still processing '%s'", G_STRFUNC,
+                       camel_imapx_job_get_kind_name (ic->job_kind),
+                       camel_imapx_job_get_kind_name (is->priv->current_command->job_kind));
+       }
 
        c (is->priv->tagprefix, "%s: %p ~> %p\n", G_STRFUNC, is->priv->current_command, ic);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]