summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-02-27 23:37:34 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2003-02-27 23:37:34 +0000
commitece0f2b2021b1bfd710075e0c9692206f5039c48 (patch)
treed5d38442ce437dca352ca1d7595d8fe78c672036
parent16a783686fdf9656f0f32c323dd3ad3b4d3f0b39 (diff)
downloadevolution-data-server-ece0f2b2021b1bfd710075e0c9692206f5039c48.tar.gz
Add a 'flushed' state variable to the private struct. (do_read): Set
2003-02-27 Jeffrey Stedfast <fejj@ximian.com> * camel-stream-filter.c: Add a 'flushed' state variable to the private struct. (do_read): Set p->flushed to TRUE after we call camel_mime_filter_complete() on all the filters. (do_reset): Set p->flushed to FALSE. (do_eos): Make sure the filters have been flushed before returning that the stream is at EOS. * camel-mime-filter-canon.c (complete): Don't add a eol - otherwise we will fail to verify some mutt signatures that do not have a blank line before the boundary line (and note that the last \n before the boundary really belongs to the boundary anyway) so #if 0 this code out for now.
-rw-r--r--camel/ChangeLog16
-rw-r--r--camel/camel-mime-filter-canon.c5
-rw-r--r--camel/camel-stream-filter.c20
3 files changed, 36 insertions, 5 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 5989b9407..a1eb3c1a3 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,19 @@
+2003-02-27 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-stream-filter.c: Add a 'flushed' state variable to the
+ private struct.
+ (do_read): Set p->flushed to TRUE after we call
+ camel_mime_filter_complete() on all the filters.
+ (do_reset): Set p->flushed to FALSE.
+ (do_eos): Make sure the filters have been flushed before returning
+ that the stream is at EOS.
+
+ * camel-mime-filter-canon.c (complete): Don't add a eol -
+ otherwise we will fail to verify some mutt signatures that do not
+ have a blank line before the boundary line (and note that the last
+ \n before the boundary really belongs to the boundary anyway) so
+ #if 0 this code out for now.
+
2003-02-22 Jeffrey Stedfast <fejj@ximian.com>
* providers/sendmail/camel-sendmail-transport.c
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
index d7ec05bf2..80b1b4aeb 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -195,6 +195,8 @@ complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out,
while (o>starto && (o[-1] == ' ' || o[-1] == '\t' || o[-1]=='\r'))
o--;
}
+
+#if 0
/* check end of line canonicalisation */
if (o>starto) {
if (flags & CAMEL_MIME_FILTER_CANON_CRLF) {
@@ -208,7 +210,8 @@ complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out,
/* and always finish with an eol */
*o++ = '\n';
-
+#endif
+
*outlen = o - *out;
f->backlen = 0;
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c
index febfb04e2..5330dfadb 100644
--- a/camel/camel-stream-filter.c
+++ b/camel/camel-stream-filter.c
@@ -19,11 +19,16 @@
* Boston, MA 02111-1307, USA.
*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
#include <string.h>
#include "camel-stream-filter.h"
#define d(x)
-/*#include <stdio.h>*/
/* use my malloc debugger? */
/*extern void g_check(void *mp);*/
@@ -45,7 +50,8 @@ struct _CamelStreamFilterPrivate {
char *filtered; /* the filtered data */
size_t filteredlen;
- int last_was_read; /* was the last op read or write? */
+ int last_was_read:1; /* was the last op read or write? */
+ int flushed:1 /* were the filters flushed? */
};
#define READ_PAD (128) /* bytes padded before buffer */
@@ -90,6 +96,7 @@ camel_stream_filter_init (CamelStreamFilter *obj)
p->realbuffer = g_malloc(READ_SIZE + READ_PAD);
p->buffer = p->realbuffer + READ_PAD;
p->last_was_read = TRUE;
+ p->flushed = FALSE;
}
static void
@@ -234,6 +241,7 @@ do_read (CamelStream *stream, char *buffer, size_t n)
f = f->next;
}
size = p->filteredlen;
+ p->flushed = TRUE;
}
if (size <= 0)
return size;
@@ -371,7 +379,10 @@ do_eos (CamelStream *stream)
if (p->filteredlen > 0)
return FALSE;
-
+
+ if (!p->flushed)
+ return FALSE;
+
return camel_stream_eos(filter->source);
}
@@ -383,7 +394,8 @@ do_reset (CamelStream *stream)
struct _filter *f;
p->filteredlen = 0;
-
+ p->flushed = FALSE;
+
/* and reset filters */
f = p->filters;
while (f) {