]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istreams - Don't lose IO pending state when unsetting and setting io
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 22 Jan 2019 20:45:33 +0000 (22:45 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Thu, 21 Mar 2019 08:02:48 +0000 (10:02 +0200)
This makes sure that the pending state stays even after io_remove() when
io_add_istream() is again called.

src/lib/istream.c

index bc5f9e011bc8aca83b9f1acbfdc055d29b67218c..e04fb50c6f2a997f651fce47336aab9f7d4e2610 100644 (file)
@@ -970,6 +970,8 @@ void i_stream_unset_io(struct istream *stream, struct io *io)
        stream = i_stream_get_root_io(stream);
 
        i_assert(stream->real_stream->io == io);
+       if (io_is_pending(io))
+               stream->real_stream->io_pending = TRUE;
        stream->real_stream->io = NULL;
 }