[evolution-data-server] Bug 772347 - [IMAPx] NOTIFY responses stuck in stream until read from it



commit f92c784ea989a5fa364640b14dc27f0cac2f226d
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 13 11:31:56 2016 +0200

    Bug 772347 - [IMAPx] NOTIFY responses stuck in stream until read from it

 src/camel/providers/imapx/camel-imapx-server.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c
index 518dbe3..6fcaf69 100644
--- a/src/camel/providers/imapx/camel-imapx-server.c
+++ b/src/camel/providers/imapx/camel-imapx-server.c
@@ -6254,23 +6254,20 @@ imapx_server_run_idle_thread_cb (gpointer user_data)
 gboolean
 camel_imapx_server_can_use_idle (CamelIMAPXServer *is)
 {
-       gboolean use_idle = FALSE;
+       gboolean use_idle;
+       CamelIMAPXSettings *settings;
 
        g_mutex_lock (&is->priv->stream_lock);
 
-       /* No need for IDLE if the server supports NOTIFY. */
-       if (CAMEL_IMAPX_HAVE_CAPABILITY (is->priv->cinfo, NOTIFY)) {
-               g_mutex_unlock (&is->priv->stream_lock);
-
-               return FALSE;
-       }
-
-       if (CAMEL_IMAPX_HAVE_CAPABILITY (is->priv->cinfo, IDLE)) {
-               CamelIMAPXSettings *settings;
+       settings = camel_imapx_server_ref_settings (is);
+       use_idle = camel_imapx_settings_get_use_idle (settings);
+       g_object_unref (settings);
 
-               settings = camel_imapx_server_ref_settings (is);
-               use_idle = camel_imapx_settings_get_use_idle (settings);
-               g_object_unref (settings);
+       /* Run IDLE if the server supports NOTIFY, to have
+          a constant read on the stream, thus to be notified. */
+       if (!CAMEL_IMAPX_HAVE_CAPABILITY (is->priv->cinfo, NOTIFY) &&
+           !CAMEL_IMAPX_HAVE_CAPABILITY (is->priv->cinfo, IDLE)) {
+               use_idle = FALSE;
        }
 
        g_mutex_unlock (&is->priv->stream_lock);


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