Updated with some of the same fixes I've made to camel-imap-folder.c like
authorJeffrey Stedfast <fejj@helixcode.com>
Fri, 21 Jul 2000 19:48:43 +0000 (19:48 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Fri, 21 Jul 2000 19:48:43 +0000 (19:48 +0000)
2000-07-21  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/imap/camel-imap-stream.c (stream_read): Updated with some of the
same fixes I've made to camel-imap-folder.c like recalculating message part
lengths.

camel/ChangeLog
camel/providers/imap/camel-imap-stream.c

index 74b3ce3..6deb5a1 100644 (file)
@@ -1,5 +1,9 @@
 2000-07-21  Jeffrey Stedfast  <fejj@helixcode.com>
 
+       * providers/imap/camel-imap-stream.c (stream_read): Updated with some of the
+       same fixes I've made to camel-imap-folder.c like recalculating message part
+       lengths.
+
        * providers/imap/camel-imap-store.c (camel_imap_command_extended): Rewrote
        the code to check for "* %d RECENT". Still needs to be modified, but should
        no longer cause an infinite loop by detecting mis-detecting RECENT messages.
index 9f45ed2..eb0a48a 100644 (file)
@@ -168,10 +168,10 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                        if (*q == '\n')
                                part_len--;
                }
-               /* we want to make sure we get up to the last \n */
-               for ( ; *q && *q != '\n'; q++, part_len++);
+               /* FIXME: This is a hack for IMAP daemons that send us a UID at the end of each FETCH */
+               for (q--, part_len--; q > p && *(q-1) != '\n'; q--, part_len--);
 
-               imap_stream->cache = g_strndup (p, part_len);
+               imap_stream->cache = g_strndup (p, part_len + 1);
                g_free (result);
                
                imap_stream->cache_ptr = imap_stream->cache;