[dovecot-cvs] dovecot/src/lib-mail message-parser.c, 1.71, 1.71.2.1 message-parser.h, 1.30, 1.30.2.1

cras at dovecot.org cras at dovecot.org
Sat Jun 17 20:10:39 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv11417/lib-mail

Modified Files:
      Tag: branch_1_0
	message-parser.c message-parser.h 
Log Message:
Added crlf_newline flag to header parser, which is set if the header ended
with CR+LF instead of LF.



Index: message-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-parser.c,v
retrieving revision 1.71
retrieving revision 1.71.2.1
diff -u -d -r1.71 -r1.71.2.1
--- message-parser.c	14 Jan 2006 18:47:35 -0000	1.71
+++ message-parser.c	17 Jun 2006 17:10:37 -0000	1.71.2.1
@@ -718,6 +718,7 @@
 
 	last_no_newline = line->no_newline;
 	line->no_newline = FALSE;
+	line->crlf_newline = FALSE;
 
 	if (line->continues) {
 		if (line->use_full_value && !line->continued) {
@@ -777,9 +778,10 @@
 				size = 0;
 				if (ctx->hdr_size != NULL)
 					ctx->hdr_size->lines++;
-				if (msg[0] == '\r')
+				if (msg[0] == '\r') {
+					line->crlf_newline = TRUE;
 					ctx->skip = 2;
-				else {
+				} else {
 					ctx->skip = 1;
 					if (ctx->hdr_size != NULL)
 						ctx->hdr_size->virtual_size++;
@@ -860,6 +862,7 @@
 					ctx->hdr_size->virtual_size++;
 				size = i;
 			} else {
+				line->crlf_newline = TRUE;
 				size = i-1;
 			}
 

Index: message-parser.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-parser.h,v
retrieving revision 1.30
retrieving revision 1.30.2.1
diff -u -d -r1.30 -r1.30.2.1
--- message-parser.h	14 Jan 2006 18:47:35 -0000	1.30
+++ message-parser.h	17 Jun 2006 17:10:37 -0000	1.30.2.1
@@ -59,6 +59,7 @@
 	unsigned int continued:1; /* multiline header, continues */
 	unsigned int eoh:1; /* "end of headers" line */
 	unsigned int no_newline:1; /* no \n after this line */
+	unsigned int crlf_newline:1; /* newline was \r\n */
 	unsigned int use_full_value:1; /* set if you want full_value */
 };
 



More information about the dovecot-cvs mailing list