evolution-data-server r10143 - trunk/camel/providers/imap



Author: mbarnes
Date: Sat Mar  7 19:04:05 2009
New Revision: 10143
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10143&view=rev

Log:
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.



Modified:
   trunk/camel/providers/imap/ChangeLog
   trunk/camel/providers/imap/camel-imap-command.c
   trunk/camel/providers/imap/camel-imap-store.c

Modified: trunk/camel/providers/imap/camel-imap-command.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-command.c	(original)
+++ trunk/camel/providers/imap/camel-imap-command.c	Sat Mar  7 19:04:05 2009
@@ -232,9 +232,8 @@
 		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 @@
 
 	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 @@
 		
 		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;
 			}

Modified: trunk/camel/providers/imap/camel-imap-store.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-store.c	(original)
+++ trunk/camel/providers/imap/camel-imap-store.c	Sat Mar  7 19:04:05 2009
@@ -3033,16 +3033,14 @@
 	}
 
 	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;
 	}



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