]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
istream-chain: Support using io_add_istream() for the chain stream.
authorTimo Sirainen <tss@iki.fi>
Fri, 15 Aug 2014 12:22:46 +0000 (15:22 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 15 Aug 2014 12:22:46 +0000 (15:22 +0300)
The callback is notified whenever new streams are added to the chain.

It's currently not possible to have nonblocking istreams added to the chain
and the callback being called when they have new data, but it would be
possible to implement as well if needed at some point.

src/lib/istream-chain.c

index 9ecba9a0da0c66c597946709d69166774b8e0f1d..194fda2e5d6fcaf7dc9981791cce23587b110c82 100644 (file)
@@ -54,6 +54,9 @@ i_stream_chain_append_internal(struct istream_chain *chain,
                }
        }
        DLLIST2_APPEND(&chain->head, &chain->tail, link);
+       /* if io_add_istream() has been added to this chain stream, notify
+          the callback that we have more data available. */
+       i_stream_set_input_pending(stream, TRUE);
 }
 
 void i_stream_chain_append(struct istream_chain *chain, struct istream *stream)