dovecot-2.2-pigeonhole: Adjusted to changes in Dovecot istream API.

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Wed Aug 29 00:07:42 EEST 2012


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/0eafbad49e41
changeset: 1657:0eafbad49e41
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Tue Aug 28 23:07:36 2012 +0200
description:
Adjusted to changes in Dovecot istream API.

diffstat:

 src/lib-managesieve/managesieve-parser.c |  10 ++++++++--
 src/lib-sieve/edit-mail.c                |  15 +++++++--------
 src/lib-sieve/sieve-lexer.c              |   4 ++--
 3 files changed, 17 insertions(+), 12 deletions(-)

diffs (80 lines):

diff -r 6ccbfb64bea5 -r 0eafbad49e41 src/lib-managesieve/managesieve-parser.c
--- a/src/lib-managesieve/managesieve-parser.c	Mon Aug 20 09:13:32 2012 +0200
+++ b/src/lib-managesieve/managesieve-parser.c	Tue Aug 28 23:07:36 2012 +0200
@@ -712,10 +712,16 @@
 	return ret;
 }
 
-static const struct stat *quoted_string_istream_stat
+static int quoted_string_istream_stat
 (struct istream_private *stream, bool exact)
 {
-	return i_stream_stat(stream->parent, exact);
+	const struct stat *st;
+
+	if (i_stream_stat(stream->parent, exact, &st) < 0)
+		return -1;
+
+	stream->statbuf = *st;
+	return 0;
 }
 
 static struct istream *quoted_string_istream_create
diff -r 6ccbfb64bea5 -r 0eafbad49e41 src/lib-sieve/edit-mail.c
--- a/src/lib-sieve/edit-mail.c	Mon Aug 20 09:13:32 2012 +0200
+++ b/src/lib-sieve/edit-mail.c	Tue Aug 28 23:07:36 2012 +0200
@@ -1710,7 +1710,7 @@
 	i_panic("edit-mail istream sync() not implemented");
 }
 
-static const struct stat *
+static int
 edit_mail_istream_stat(struct istream_private *stream, bool exact)
 {
 	struct edit_mail_istream *edstream =
@@ -1719,16 +1719,16 @@
 	const struct stat *st;
 
 	/* Stat the original stream */
-	st = i_stream_stat(stream->parent, exact);
-	if (st == NULL || st->st_size == -1 || !exact)
-		return st;
+	if (i_stream_stat(stream->parent, exact, &st) < 0)
+		return -1;
 
-	/* Adjust stat data */
 	stream->statbuf = *st;
+	if (st->st_size == -1 || !exact)
+		return 0;
 
 	if ( !edmail->headers_parsed ) {
 		if ( !edmail->modified )
-			return &stream->statbuf;
+			return 0;
 	} else {
 		stream->statbuf.st_size = edmail->wrapped_body_size.physical_size +
 			( edmail->eoh_crlf ? 2 : 1 );
@@ -1736,8 +1736,7 @@
 
 	stream->statbuf.st_size += edmail->hdr_size.physical_size +
 		edmail->body_size.physical_size;
-
-	return &stream->statbuf;
+	return 0;
 }
 
 struct istream *edit_mail_istream_create
diff -r 6ccbfb64bea5 -r 0eafbad49e41 src/lib-sieve/sieve-lexer.c
--- a/src/lib-sieve/sieve-lexer.c	Mon Aug 20 09:13:32 2012 +0200
+++ b/src/lib-sieve/sieve-lexer.c	Tue Aug 28 23:07:36 2012 +0200
@@ -76,8 +76,8 @@
 		return NULL;
 
 	/* Check script size */
-	st = i_stream_stat(stream, TRUE);
-	if ( st != NULL && st->st_size > 0 && svinst->max_script_size > 0 &&
+	if ( i_stream_stat(stream, TRUE, &st) >= 0 && st->st_size > 0 &&
+		svinst->max_script_size > 0 &&
 		(uoff_t)st->st_size > svinst->max_script_size ) {
 		sieve_error(ehandler, sieve_script_name(script),
 			"sieve script is too large (max %"PRIuSIZE_T" bytes)",


More information about the dovecot-cvs mailing list