dovecot-2.2: lib: iostream_rawlog_create_from_stream() now allow...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 23 08:41:38 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/49dd781d8f26
changeset: 18449:49dd781d8f26
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 23 11:40:03 2015 +0300
description:
lib: iostream_rawlog_create_from_stream() now allows input or output to be NULL.

diffstat:

 src/lib/iostream-rawlog.c |  20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diffs (29 lines):

diff -r fedd88ce9315 -r 49dd781d8f26 src/lib/iostream-rawlog.c
--- a/src/lib/iostream-rawlog.c	Thu Apr 23 11:20:53 2015 +0300
+++ b/src/lib/iostream-rawlog.c	Thu Apr 23 11:40:03 2015 +0300
@@ -285,13 +285,17 @@
 	struct istream *old_input;
 	struct ostream *old_output;
 
-	old_input = *input;
-	old_output = *output;
+	if (input != NULL) {
+		old_input = *input;
+		*input = i_stream_create_rawlog_from_stream(old_input,
+				rawlog_output, rawlog_flags);
+		i_stream_unref(&old_input);
+	}
+	if (output != NULL) {
+		old_output = *output;
+		*output = o_stream_create_rawlog_from_stream(old_output,
+				rawlog_output, rawlog_flags);
+		o_stream_unref(&old_output);
+	}
 	o_stream_ref(rawlog_output);
-	*input = i_stream_create_rawlog_from_stream(old_input, rawlog_output,
-						    rawlog_flags);
-	*output = o_stream_create_rawlog_from_stream(old_output, rawlog_output,
-						     rawlog_flags);
-	i_stream_unref(&old_input);
-	o_stream_unref(&old_output);
 }


More information about the dovecot-cvs mailing list