dovecot-2.2: ostream: Mark stream closed before handling its cal...

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 3 23:27:25 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/10c0aae82d0d
changeset: 16932:10c0aae82d0d
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 03 23:27:15 2013 +0200
description:
ostream: Mark stream closed before handling its callback to avoid infinite loops.
The callback could call o_stream_copy_error_from_parent(), which in turn
would try to close the same ostream again.

diffstat:

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

diffs (13 lines):

diff -r 653d5a81a22e -r 10c0aae82d0d src/lib/ostream.c
--- a/src/lib/ostream.c	Sun Nov 03 22:04:53 2013 +0200
+++ b/src/lib/ostream.c	Sun Nov 03 23:27:15 2013 +0200
@@ -46,8 +46,8 @@
 static void o_stream_close_full(struct ostream *stream, bool close_parents)
 {
 	if (!stream->closed) {
+		stream->closed = TRUE;
 		io_stream_close(&stream->real_stream->iostream, close_parents);
-		stream->closed = TRUE;
 	}
 
 	if (stream->stream_errno == 0)


More information about the dovecot-cvs mailing list