diff options
author | Timo Sirainen <tss@iki.fi> | 2003-07-17 14:31:35 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-07-17 14:31:35 +0800 |
commit | 20d610abe40342e35f36626ff0af45c909bdcd7f (patch) | |
tree | 5f1e15516c70bfd12547e47d1df41215a21a6089 | |
parent | 96d8c5e1a3ade337ee1e7dcbe81b2b52d2a90901 (diff) | |
download | gsoc2013-evolution-20d610abe40342e35f36626ff0af45c909bdcd7f.tar gsoc2013-evolution-20d610abe40342e35f36626ff0af45c909bdcd7f.tar.gz gsoc2013-evolution-20d610abe40342e35f36626ff0af45c909bdcd7f.tar.bz2 gsoc2013-evolution-20d610abe40342e35f36626ff0af45c909bdcd7f.tar.lz gsoc2013-evolution-20d610abe40342e35f36626ff0af45c909bdcd7f.tar.xz gsoc2013-evolution-20d610abe40342e35f36626ff0af45c909bdcd7f.tar.zst gsoc2013-evolution-20d610abe40342e35f36626ff0af45c909bdcd7f.zip |
** See bug #42573
2003-07-17 Timo Sirainen <tss@iki.fi>
** See bug #42573
* providers/imap/camel-imap-folder.c (do_append): Only free the
response after we have finished the literal request, otherwise we
could try processing folder updates incorrectly.
svn path=/trunk/; revision=21851
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 24 |
2 files changed, 21 insertions, 11 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index f07d498dab..a51b2ffeee 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2003-07-17 Timo Sirainen <tss@iki.fi> + + ** See bug #42573 + + * providers/imap/camel-imap-folder.c (do_append): Only free the + response after we have finished the literal request, otherwise we + could try processing folder updates incorrectly. + 2003-07-14 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.h: Add the CamelMimePartEncodingType definition diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 07c2a3cf57..4a4fb85ecb 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1129,12 +1129,12 @@ do_append (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex) { CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store); - CamelImapResponse *response; + CamelImapResponse *response, *response2; CamelStream *memstream; CamelMimeFilter *crlf_filter; CamelStreamFilter *streamfilter; GByteArray *ba; - char *flagstr, *result, *end; + char *flagstr, *end; /* create flag string param */ if (info && info->flags) @@ -1169,22 +1169,24 @@ do_append (CamelFolder *folder, CamelMimeMessage *message, g_byte_array_free (ba, TRUE); return NULL; } - - result = camel_imap_response_extract_continuation (store, response, ex); - if (!result) { + + if (*response->status != '+') { + camel_imap_response_free (store, response); g_byte_array_free (ba, TRUE); return NULL; } - g_free (result); /* send the rest of our data - the mime message */ - response = camel_imap_command_continuation (store, ba->data, ba->len, ex); + response2 = camel_imap_command_continuation (store, ba->data, ba->len, ex); g_byte_array_free (ba, TRUE); - if (!response) - return response; + + /* free it only after message is sent. This may cause more FETCHes. */ + camel_imap_response_free (store, response); + if (!response2) + return response2; if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) { - *uid = camel_strstrcase (response->status, "[APPENDUID "); + *uid = camel_strstrcase (response2->status, "[APPENDUID "); if (*uid) *uid = strchr (*uid + 11, ' '); if (*uid) { @@ -1198,7 +1200,7 @@ do_append (CamelFolder *folder, CamelMimeMessage *message, } else *uid = NULL; - return response; + return response2; } static void |