[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.h, 1.26, 1.27 mbox-sync-update.c, 1.20, 1.21

cras at dovecot.org cras at dovecot.org
Sat Jul 31 03:54:50 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv25838/lib-storage/index/mbox

Modified Files:
	mbox-storage.h mbox-sync-update.c 
Log Message:
Don't write Content-Length unless it's value is larger than 1024 bytes.



Index: mbox-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- mbox-storage.h	22 Jul 2004 21:20:01 -0000	1.26
+++ mbox-storage.h	31 Jul 2004 00:54:48 -0000	1.27
@@ -3,6 +3,8 @@
 
 /* Padding to leave in X-Keywords header when rewriting mbox */
 #define MBOX_HEADER_PADDING 50
+/* Don't write Content-Length header unless it's value is larger than this. */
+#define MBOX_MIN_CONTENT_LENGTH_SIZE 1024
 
 #define SUBSCRIPTION_FILE_NAME ".subscriptions"
 #define MBOX_INDEX_PREFIX "dovecot.index"

Index: mbox-sync-update.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-update.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- mbox-sync-update.c	26 Jul 2004 18:52:07 -0000	1.20
+++ mbox-sync-update.c	31 Jul 2004 00:54:48 -0000	1.21
@@ -1,9 +1,12 @@
+/* Copyright (C) 2004 Timo Sirainen */
+
 #include "lib.h"
 #include "ioloop.h"
 #include "buffer.h"
 #include "str.h"
 #include "message-parser.h"
 #include "index-storage.h"
+#include "mbox-storage.h"
 #include "mbox-sync-private.h"
 
 static void status_flags_append(struct mbox_sync_mail_context *ctx,
@@ -172,7 +175,8 @@
 		str_append_c(ctx->header, '\n');
 	}
 
-	if (ctx->content_length == (uoff_t)-1) {
+	if (ctx->content_length == (uoff_t)-1 &&
+	    ctx->mail.body_size >= MBOX_MIN_CONTENT_LENGTH_SIZE) {
 		str_printfa(ctx->header, "Content-Length: %"PRIuUOFF_T"\n",
 			    ctx->mail.body_size);
 	}



More information about the dovecot-cvs mailing list