[evolution-patches] 69533, workaround imap server protocol violation




changelog says it all i guess (and some more in teh bug report)

"seems to work", although i've only tested it against groupwise so far.  i'm pretty sure it is impossible to get a literal followed by a blank line in any normal imap protocol exchange, so we just ignore blank lines after literals.

Z
--
Michael Zucchi <notzed ximian com>
"Ride, Work, Sleep. Beer."
Novell's Evolution and Free Software Developer
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2251.2.27
diff -u -p -r1.2251.2.27 ChangeLog
--- camel/ChangeLog	1 Dec 2004 03:59:14 -0000	1.2251.2.27
+++ camel/ChangeLog	2 Dec 2004 04:01:49 -0000
@@ -1,3 +1,12 @@
+2004-12-02  Not Zed  <NotZed Ximian com>
+
+	** See bug #69533.
+
+	* providers/imap/camel-imap-command.c (imap_read_untagged): gross
+	hack, if we get a blank line after a literal, assume the server
+	(read: groupwise) made a mistake.  Given the complexity of this
+	code i'm not sure it is the server anyway but what can you do.
+
 2004-12-01  Not Zed  <NotZed Ximian com>
 
 	** See bug #69776.
Index: camel/providers/imap/camel-imap-command.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/imap/camel-imap-command.c,v
retrieving revision 1.60.26.1
diff -u -p -r1.60.26.1 camel-imap-command.c
--- camel/providers/imap/camel-imap-command.c	30 Nov 2004 07:56:07 -0000	1.60.26.1
+++ camel/providers/imap/camel-imap-command.c	2 Dec 2004 04:01:50 -0000
@@ -499,10 +499,16 @@ imap_read_untagged (CamelImapStore *stor
 		
 		fulllen += str->len;
 		g_ptr_array_add (data, str);
-		
+
 		/* Read the next line. */
-		if (camel_imap_store_readline (store, &line, ex) < 0)
-			goto lose;
+		do {
+			if (camel_imap_store_readline (store, &line, ex) < 0)
+				goto lose;
+
+			/* MAJOR HACK ALERT, gropuwise sometimes sends an extra blank line after literals, check that here */
+			if (line[0] == 0)
+				g_warning("Server sent empty line after a literal, assuming in error");
+		} while (line[0] == 0);
 	}
 	
 	/* Now reassemble the data. */


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