Don't increment the response pointer when deciding what type of header
authorJeffrey Stedfast <fejj@ximian.com>
Thu, 19 Sep 2002 06:17:16 +0000 (06:17 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Thu, 19 Sep 2002 06:17:16 +0000 (06:17 +0000)
2002-09-19  Jeffrey Stedfast  <fejj@ximian.com>

* providers/imap/camel-imap-folder.c (parse_fetch_response): Don't
increment the response pointer when deciding what type of header
response we got, this screws up the string that we strdup into the
part_spec string later. Also, instead of using the entire blob of
HEADER.FIELDS that we get in the response, shorten it to just
HEADER.FIELDS to use as the part_spec key.

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

index 68ef5df..1ddf48f 100644 (file)
@@ -1,3 +1,12 @@
+2002-09-19  Jeffrey Stedfast  <fejj@ximian.com>
+
+       * providers/imap/camel-imap-folder.c (parse_fetch_response): Don't
+       increment the response pointer when deciding what type of header
+       response we got, this screws up the string that we strdup into the
+       part_spec string later. Also, instead of using the entire blob of
+       HEADER.FIELDS that we get in the response, shorten it to just
+       HEADER.FIELDS to use as the part_spec key.
+
 2002-09-18  Jeffrey Stedfast  <fejj@ximian.com>
 
        * providers/imap/camel-imap-folder.c (CAMEL_MESSAGE_INFO_HEADERS):
index 4a0236f..3945097 100644 (file)
@@ -2527,11 +2527,10 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                        if (*response == 'B') {
                                response += 5;
                                
-                               /* HEADER], HEADER.FIELDS... or 0] */
+                               /* HEADER], HEADER.FIELDS (...)], or 0] */
                                if (!g_strncasecmp (response, "HEADER", 6)) {
-                                       response += 6;
                                        header = TRUE;
-                                       if (!g_strncasecmp (response, ".FIELDS ", 8))
+                                       if (!g_strncasecmp (response + 6, ".FIELDS ", 8))
                                                cache_header = FALSE;
                                } else if (!g_strncasecmp (response, "0]", 2))
                                        header = TRUE;
@@ -2539,7 +2538,12 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                                p = strchr (response, ']');
                                if (!p || *(p + 1) != ' ')
                                        break;
-                               part_spec = g_strndup (response, p - response);
+                               
+                               if (cache_header)
+                                       part_spec = g_strndup (response, p - response);
+                               else
+                                       part_spec = g_strdup ("HEADER.FIELDS");
+                               
                                response = p + 2;
                        } else {
                                part_spec = g_strdup ("");