** Revert changes for bug #534938 because it breaks message loading in
authorMatthew Barnes <mbarnes@redhat.com>
Sat, 7 Mar 2009 19:04:05 +0000 (19:04 +0000)
committerMatthew Barnes <mbarnes@src.gnome.org>
Sat, 7 Mar 2009 19:04:05 +0000 (19:04 +0000)
2009-03-07  Matthew Barnes  <mbarnes@redhat.com>

** Revert changes for bug #534938 because it breaks message
   loading in IMAP and can cause summary database corruption.

svn path=/trunk/; revision=10143

camel/providers/imap/ChangeLog
camel/providers/imap/camel-imap-command.c
camel/providers/imap/camel-imap-store.c

index b6092f0..8d577f3 100644 (file)
@@ -1,11 +1,7 @@
-2009-02-26  Milan Crha  <mcrha@redhat.com>
+2009-03-07  Matthew Barnes  <mbarnes@redhat.com>
 
-       ** Fix for bug #573240
-
-       * camel-imap-store.c: (camel_imap_store_readline):
-       * camel-imap-command.c: (imap_command_start),
-       (camel_imap_command_continuation), (imap_read_untagged):
-       Do not disconnect on user canceled.
+       ** Revert changes for bug #534938 because it breaks message
+          loading in IMAP and can cause summary database corruption.
 
 2009-02-12  Milan Crha  <mcrha@redhat.com>
 
index ac71cae..8a177f6 100644 (file)
@@ -232,9 +232,8 @@ imap_command_start (CamelImapStore *store, CamelFolder *folder,
                else
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                             g_strerror (errno));
-
-               if (g_str_has_prefix (cmd, "LOGIN"))
-                       camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
+               
+               camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
                return FALSE;
        }
        
@@ -276,14 +275,13 @@ camel_imap_command_continuation (CamelImapStore *store, const char *cmd,
 
        if (camel_stream_write (store->ostream, cmd, cmdlen) == -1 ||
            camel_stream_write (store->ostream, "\r\n", 2) == -1) {
-               if (errno == EINTR) {
+               if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
                                             _("Operation cancelled"));
-               } else {
+               else
                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                             g_strerror (errno));
-                       camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
-               }
+               camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
                CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
                return NULL;
        }
@@ -491,15 +489,13 @@ imap_read_untagged (CamelImapStore *store, char *line, CamelException *ex)
                
                do {
                        if ((n = camel_stream_read (store->istream, str->str + nread + 1, length - nread)) == -1) {
-                               if (errno == EINTR) {
+                               if (errno == EINTR)
                                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
                                                             _("Operation cancelled"));
-                               } else {
+                               else
                                        camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                                             g_strerror (errno));
-                                       camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
-                               }
-
+                               camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
                                g_string_free (str, TRUE);
                                goto lose;
                        }
index e446f48..79c794f 100644 (file)
@@ -3033,16 +3033,14 @@ camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *e
        }
 
        if (nread <= 0) {
-               if (errno == EINTR) {
+               if (errno == EINTR)
                        camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled"));
-               } else {
+               else
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
                                              _("Server unexpectedly disconnected: %s"),
                                              g_strerror (errno));
                
-                       camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
-               }
-
+               camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL);
                g_byte_array_free (ba, TRUE);
                return -1;
        }