[dovecot-cvs] dovecot/src/lib-mail istream-header-filter.c, 1.3, 1.4 message-parser.c, 1.55, 1.56 message-parser.h, 1.25, 1.26

cras at dovecot.org cras at dovecot.org
Sat Jul 31 03:33:55 EEST 2004


Update of /home/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv25219/lib-mail

Modified Files:
	istream-header-filter.c message-parser.c message-parser.h 
Log Message:
Added struct message_header_line.middle and middle_len to contain the ':'
in header and whitespace around it.



Index: istream-header-filter.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-mail/istream-header-filter.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- istream-header-filter.c	18 Jul 2004 02:25:07 -0000	1.3
+++ istream-header-filter.c	31 Jul 2004 00:33:53 -0000	1.4
@@ -143,7 +143,8 @@
 		} else if (dest != NULL) {
 			if (!hdr->continued) {
 				buffer_append(dest, hdr->name, hdr->name_len);
-				buffer_append(dest, ": ", 2);
+				buffer_append(dest, hdr->middle,
+					      hdr->middle_len);
 			}
 			buffer_append(dest, hdr->value, hdr->value_len);
 			buffer_append(dest, "\r\n", 2);

Index: message-parser.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-mail/message-parser.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- message-parser.c	28 Jun 2004 21:31:10 -0000	1.55
+++ message-parser.c	31 Jul 2004 00:33:53 -0000	1.56
@@ -832,9 +832,12 @@
 		line->eoh = TRUE;
 		line->name_len = line->value_len = line->full_value_len = 0;
 		line->name = ""; line->value = line->full_value = NULL;
+		line->middle = NULL; line->middle_len = 0;
 	} else if (line->continued) {
 		line->value = msg;
 		line->value_len = size;
+		line->middle = NULL;
+		line->middle_len = 0;
 	} else if (colon_pos == UINT_MAX) {
 		/* missing ':', assume the whole line is name */
 		line->value = NULL;
@@ -844,6 +847,9 @@
 		str_append_n(ctx->name, msg, size);
 		line->name = str_c(ctx->name);
 		line->name_len = str_len(ctx->name);
+
+		line->middle = NULL;
+		line->middle_len = 0;
 	} else {
 		size_t pos;
 
@@ -880,6 +886,9 @@
 		while (colon_pos > 0 && IS_LWSP(msg[colon_pos-1]))
 			colon_pos--;
 
+		line->middle = msg + colon_pos;
+		line->middle_len = (size_t)(line->value - line->middle);
+
 		str_truncate(ctx->name, 0);
 		str_append_n(ctx->name, msg, colon_pos);
 		line->name = str_c(ctx->name);

Index: message-parser.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-mail/message-parser.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- message-parser.h	17 Jun 2004 21:28:23 -0000	1.25
+++ message-parser.h	31 Jul 2004 00:33:53 -0000	1.26
@@ -50,6 +50,9 @@
 	const unsigned char *full_value;
 	size_t full_value_len;
 
+	const unsigned char *middle;
+	size_t middle_len;
+
 	uoff_t name_offset, full_value_offset;
 
 	unsigned int continues:1; /* multiline header, continues in next line */



More information about the dovecot-cvs mailing list