dovecot-2.1: ostream: Keep track of flush callback for filter os...

dovecot at dovecot.org dovecot at dovecot.org
Wed Sep 21 15:58:45 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/62e1c575b16a
changeset: 13532:62e1c575b16a
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Sep 21 15:53:00 2011 +0300
description:
ostream: Keep track of flush callback for filter ostreams as well.

diffstat:

 src/lib/ostream.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (33 lines):

diff -r 0fb296c11edc -r 62e1c575b16a src/lib/ostream.c
--- a/src/lib/ostream.c	Wed Sep 21 15:51:00 2011 +0300
+++ b/src/lib/ostream.c	Wed Sep 21 15:53:00 2011 +0300
@@ -323,14 +323,11 @@
 				    stream_flush_callback_t *callback,
 				    void *context)
 {
-	if (_stream->parent == NULL) {
-		_stream->callback = callback;
-		_stream->context = context;
-	} else {
-		/* this is a filter stream, we don't have a flush
-		   callback ourself */
+	if (_stream->parent != NULL)
 		o_stream_set_flush_callback(_stream->parent, callback, context);
-	}
+
+	_stream->callback = callback;
+	_stream->context = context;
 }
 
 static void
@@ -385,6 +382,10 @@
 	if (parent != NULL) {
 		_stream->parent = parent;
 		o_stream_ref(parent);
+
+		_stream->callback = parent->real_stream->callback;
+		_stream->context = parent->real_stream->context;
+		_stream->max_buffer_size = parent->real_stream->max_buffer_size;
 	}
 
 	if (_stream->iostream.close == NULL)


More information about the dovecot-cvs mailing list