diff options
author | Not Zed <NotZed@Ximian.com> | 2001-02-02 10:13:13 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-02-02 10:13:13 +0800 |
commit | ebd3b725015d95ecd6812589052370e1b88f4f22 (patch) | |
tree | 682ba7abb02268a26df541465fd7d4fc0d7381df | |
parent | 609933378dab3b1df305afef4c51195373ab526f (diff) | |
download | gsoc2013-evolution-ebd3b725015d95ecd6812589052370e1b88f4f22.tar gsoc2013-evolution-ebd3b725015d95ecd6812589052370e1b88f4f22.tar.gz gsoc2013-evolution-ebd3b725015d95ecd6812589052370e1b88f4f22.tar.bz2 gsoc2013-evolution-ebd3b725015d95ecd6812589052370e1b88f4f22.tar.lz gsoc2013-evolution-ebd3b725015d95ecd6812589052370e1b88f4f22.tar.xz gsoc2013-evolution-ebd3b725015d95ecd6812589052370e1b88f4f22.tar.zst gsoc2013-evolution-ebd3b725015d95ecd6812589052370e1b88f4f22.zip |
Add missing header for cancel check stuff.
2001-02-02 Not Zed <NotZed@Ximian.com>
* camel-stream-fs.c: Add missing header for cancel check stuff.
* camel-session.c (camel_cancel_cancel): Fix a wrong cast.
* camel-mime-part.c (init_header_name_table): Setup a new table
header_formatted_table, that lists headers that we dont want to
fold (they've already been folded).
(write_to_stream): Check for already formatted headers, and dont
try and fold them. This is a fix for bug #1097.
svn path=/trunk/; revision=7941
-rw-r--r-- | camel/ChangeLog | 12 | ||||
-rw-r--r-- | camel/camel-mime-part.c | 13 | ||||
-rw-r--r-- | camel/camel-session.c | 2 | ||||
-rw-r--r-- | camel/camel-stream-fs.c | 2 |
4 files changed, 25 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index e9e6b4dbd6..11400e8684 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,15 @@ +2001-02-02 Not Zed <NotZed@Ximian.com> + + * camel-stream-fs.c: Add missing header for cancel check stuff. + + * camel-session.c (camel_cancel_cancel): Fix a wrong cast. + + * camel-mime-part.c (init_header_name_table): Setup a new table + header_formatted_table, that lists headers that we dont want to + fold (they've already been folded). + (write_to_stream): Check for already formatted headers, and dont + try and fold them. This is a fix for bug #1097. + 2001-02-01 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (header_fold): If we are folding, drop the diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index bb9489ad4a..a22b96240a 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -54,7 +54,7 @@ typedef enum { static GHashTable *header_name_table; - +static GHashTable *header_formatted_table; static CamelMediumClass *parent_class=NULL; @@ -95,7 +95,10 @@ init_header_name_table() g_hash_table_insert (header_name_table, "Content-Transfer-Encoding", (gpointer)HEADER_ENCODING); g_hash_table_insert (header_name_table, "Content-MD5", (gpointer)HEADER_CONTENT_MD5); g_hash_table_insert (header_name_table, "Content-Type", (gpointer)HEADER_CONTENT_TYPE); - + + header_formatted_table = g_hash_table_new(g_strcase_hash, g_strcase_equal); + g_hash_table_insert(header_formatted_table, "Content-Type", (void *)1); + g_hash_table_insert(header_formatted_table, "Content-Disposition", (void *)1); } static void @@ -483,15 +486,19 @@ write_to_stream(CamelDataWrapper *data_wrapper, CamelStream *stream) struct _header_raw *h = mp->headers; char *val; + /* fold/write the headers. But dont fold headers that are already formatted + (e.g. ones with parameter-lists, that we know about, and have created) */ while (h) { val = h->value; if (val == NULL) { g_warning("h->value is NULL here for %s", h->name); count = 0; - } else { + } else if (g_hash_table_lookup(header_formatted_table, val) == NULL) { val = header_fold(val, strlen(h->name)); count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val); g_free(val); + } else { + count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val); } if (count == -1) return -1; diff --git a/camel/camel-session.c b/camel/camel-session.c index d32ec547a7..8f97c507b9 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -639,7 +639,7 @@ void camel_cancel_cancel(CamelCancel *cc) if (cc == NULL) { if (cancel_active) { CAMEL_ACTIVE_LOCK(); - g_hash_table_foreach(cancel_active, (GHRFunc)cancel_thread, NULL); + g_hash_table_foreach(cancel_active, (GHFunc)cancel_thread, NULL); CAMEL_ACTIVE_UNLOCK(); } } else if ((cc->flags & CAMEL_CANCEL_CANCELLED) == 0) { diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c index c1758c1ab0..95778de63c 100644 --- a/camel/camel-stream-fs.c +++ b/camel/camel-stream-fs.c @@ -32,6 +32,8 @@ #include <errno.h> #include <string.h> +#include "camel-session.h" /* for camel_cancel_* */ + static CamelSeekableStreamClass *parent_class = NULL; /* Returns the class for a CamelStreamFS */ |