[evolution-data-server/gnome-3-16] [IMAPx] Consider also G_IO_ERROR_BROKEN_PIPE as 'Connection reset by peer' error



commit 6a1e35ebabeb397ed678078e01326280075f4e88
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 5 12:05:23 2015 +0200

    [IMAPx] Consider also G_IO_ERROR_BROKEN_PIPE as 'Connection reset by peer' error
    
    Since GLib 2.44 a G_IO_ERROR_CONNECTION_CLOSED is used for errors like 'Connection
    reset by peer', which is the same as G_IO_ERROR_BROKEN_PIPE. Do check for it too,
    instead of propagate the error into the UI.

 camel/providers/imapx/camel-imapx-server.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 6a1e4f7..d1653ab 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -7855,8 +7855,10 @@ imapx_ready_to_read (GInputStream *input_stream,
        if (local_error != NULL) {
                camel_imapx_debug (io, is->tagprefix, "Data read failed with error '%s'\n", 
local_error->message);
 
-               /* Sadly, G_IO_ERROR_FAILED is also used for 'Connection reset by peer' error */
+               /* Sadly, G_IO_ERROR_FAILED is also used for 'Connection reset by peer' error;
+                  since GLib 2.44 is used G_IO_ERROR_CONNECTION_CLOSED, which is the same as 
G_IO_ERROR_BROKEN_PIPE */
                if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_FAILED) ||
+                   g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE) ||
                    g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT)) {
                        local_error->domain = CAMEL_IMAPX_SERVER_ERROR;
                        local_error->code = CAMEL_IMAPX_SERVER_ERROR_TRY_RECONNECT;


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