[evolution-data-server] [IMAPx] Add few more debug prints around command processing



commit 2f57ad48183bc51977a7c89b113e370b182ec3bc
Author: Milan Crha <mcrha redhat com>
Date:   Tue Sep 8 10:53:10 2015 +0200

    [IMAPx] Add few more debug prints around command processing

 camel/providers/imapx/camel-imapx-conn-manager.c |    7 ++++-
 camel/providers/imapx/camel-imapx-server.c       |   28 ++++++++++++++++-----
 2 files changed, 26 insertions(+), 9 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-conn-manager.c 
b/camel/providers/imapx/camel-imapx-conn-manager.c
index d708a30..49fc670 100644
--- a/camel/providers/imapx/camel-imapx-conn-manager.c
+++ b/camel/providers/imapx/camel-imapx-conn-manager.c
@@ -1007,9 +1007,9 @@ camel_imapx_conn_manager_run_job_sync (CamelIMAPXConnManager *conn_man,
                                g_clear_object (&idle_mailbox);
 
                                imapx_conn_manager_unmark_busy (conn_man, cinfo);
-                       } else if (local_error && (local_error->domain == G_IO_ERROR || local_error->domain 
== G_TLS_ERROR || local_error->domain == CAMEL_IMAPX_ERROR ||
+                       } else if (!local_error || ((local_error->domain == G_IO_ERROR || local_error->domain 
== G_TLS_ERROR || local_error->domain == CAMEL_IMAPX_ERROR ||
                                   g_error_matches (local_error, CAMEL_IMAPX_SERVER_ERROR, 
CAMEL_IMAPX_SERVER_ERROR_TRY_RECONNECT)) &&
-                                  !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED)) {
+                                  !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))) {
                                c (camel_imapx_server_get_tagprefix (cinfo->is), "Removed connection %p 
(server:%p) due to error: %s\n",
                                        cinfo, cinfo->is, local_error ? local_error->message : "Unknown 
error");
 
@@ -1030,6 +1030,9 @@ camel_imapx_conn_manager_run_job_sync (CamelIMAPXConnManager *conn_man,
                                        g_clear_error (&tmp);
                                }
                        } else {
+                               c (camel_imapx_server_get_tagprefix (cinfo->is), "Unmark connection %p 
(server:%p) busy after failure, error: %s\n",
+                                       cinfo, cinfo->is, local_error ? local_error->message : "Unknown 
error");
+
                                imapx_conn_manager_unmark_busy (conn_man, cinfo);
                        }
 
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 6f74fc0..e70fd95 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -3637,14 +3637,14 @@ camel_imapx_server_process_command_sync (CamelIMAPXServer *is,
        COMMAND_LOCK (is);
 
        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));
+               g_warning ("%s: Starting command %p (%s) while still processing %p (%s)", G_STRFUNC,
+                       ic, camel_imapx_job_get_kind_name (ic->job_kind),
+                       is->priv->current_command, 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);
-
        if (g_cancellable_set_error_if_cancelled (cancellable, &local_error)) {
+               c (is->priv->tagprefix, "%s: command %p (%s) cancelled\n", G_STRFUNC, ic, 
camel_imapx_job_get_kind_name (ic->job_kind));
+
                COMMAND_UNLOCK (is);
 
                if (error_prefix && local_error)
@@ -3656,6 +3656,10 @@ camel_imapx_server_process_command_sync (CamelIMAPXServer *is,
                return FALSE;
        }
 
+       c (is->priv->tagprefix, "%s: %p (%s) ~> %p (%s)\n", G_STRFUNC, is->priv->current_command,
+               is->priv->current_command ? camel_imapx_job_get_kind_name 
(is->priv->current_command->job_kind) : "",
+               ic, camel_imapx_job_get_kind_name (ic->job_kind));
+
        is->priv->current_command = ic;
        is->priv->continuation_command = ic;
 
@@ -3725,6 +3729,16 @@ camel_imapx_server_process_command_sync (CamelIMAPXServer *is,
 
                is->priv->current_command = NULL;
                is->priv->continuation_command = NULL;
+       } else {
+               c (is->priv->tagprefix, "%s: current command:%p doesn't match passed-in command:%p success:%d 
local-error:%s result:%s status-text:'%s'\n", G_STRFUNC,
+                       is->priv->current_command, ic, success, local_error ? local_error->message : "[null]",
+                       ic->status ? (
+                               ic->status->result == IMAPX_OK ? "OK" :
+                               ic->status->result == IMAPX_NO ? "NO" :
+                               ic->status->result == IMAPX_BAD ? "BAD" :
+                               ic->status->result == IMAPX_PREAUTH ? "PREAUTH" :
+                               ic->status->result == IMAPX_BYE ? "BYE" : "???") : "[null]",
+                       ic->status ? ic->status->text : "[null]");
        }
 
        COMMAND_UNLOCK (is);
@@ -6128,9 +6142,9 @@ camel_imapx_server_stop_idle_sync (CamelIMAPXServer *is,
                camel_imapx_command_unref (idle_command);
 
                if (success)
-                       c (camel_imapx_server_get_tagprefix (is), "DONE finished successfully");
+                       c (camel_imapx_server_get_tagprefix (is), "DONE finished successfully\n");
                else
-                       c (camel_imapx_server_get_tagprefix (is), "DONE finished with error: %s", local_error 
? local_error->message : "Unknown error");
+                       c (camel_imapx_server_get_tagprefix (is), "DONE finished with error: %s\n", 
local_error ? local_error->message : "Unknown error");
 
                if (!success) {
                        GError *tmp = local_error;


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