changeset 887:06776a31f50c HEAD

The ending \r\n is message header shouldn't be filtered with FETCH BODY[HEADER.FIELDS...].
author Timo Sirainen <tss@iki.fi>
date Thu, 02 Jan 2003 14:20:46 +0200
parents 3a4f468a53c6
children 986e89b61520
files src/lib-storage/index/index-fetch-section.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-fetch-section.c	Thu Jan 02 13:50:53 2003 +0200
+++ b/src/lib-storage/index/index-fetch-section.c	Thu Jan 02 14:20:46 2003 +0200
@@ -188,12 +188,13 @@
 	FetchHeaderFieldContext *ctx = context;
 	const char *field_start, *field_end, *cr, *p;
 
-	/* see if we want this field */
+	/* see if we want this field. */
 	if (!ctx->match_func(ctx->fields, name, name_len))
 		return;
 
 	/* add the field, inserting CRs when needed. FIXME: is this too
-	   kludgy? we assume name continues with ": value".. */
+	   kludgy? we assume name continues with ": value". but otherwise
+	   we wouldn't reply with correct LWSP between ":". */
 	field_start = name;
 	field_end = value + value_len;
 
@@ -242,6 +243,12 @@
 	ctx->dest_size = 0;
 	message_parse_header(NULL, input, NULL, fetch_header_field, ctx);
 
+	/* FIXME: The blank line must not be filtered, says RFC. However, we
+	   shouldn't add it if it wasn't there in the first place. Not very
+	   easy to know currently so we'll just do it always, it'll be present
+	   in all sane messages anyway.. */
+	(void)fetch_header_append(ctx, "\r\n", 2);
+
 	i_assert(ctx->dest_size <= ctx->max_size);
 	i_assert(ctx->dest == NULL || str_len(ctx->dest) == ctx->dest_size);
 	return TRUE;