summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-09-19 06:17:16 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2002-09-19 06:17:16 +0000
commit8c02e7897fe001d3fb0f82633a8194c70d771218 (patch)
tree1b4c41869f1a6a34d01a9205d35bf18d5056cc8e
parent67a3c4e84e62fa20f30c595771012c33908cf2fb (diff)
downloadevolution-data-server-8c02e7897fe001d3fb0f82633a8194c70d771218.tar.gz
Don't increment the response pointer when deciding what type of header
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.
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/providers/imap/camel-imap-folder.c12
2 files changed, 17 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 68ef5df23..1ddf48f6b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -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):
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 4a0236f73..39450975d 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -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 ("");