diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/lib/istream-tee.h | |
parent | Initial commit. (diff) | |
download | dovecot-upstream.tar.xz dovecot-upstream.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/istream-tee.h')
-rw-r--r-- | src/lib/istream-tee.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/istream-tee.h b/src/lib/istream-tee.h new file mode 100644 index 0000000..82c0c93 --- /dev/null +++ b/src/lib/istream-tee.h @@ -0,0 +1,17 @@ +#ifndef ISTREAM_TEE_H +#define ISTREAM_TEE_H + +/* Tee can be used to create multiple child input streams which can access + a single non-blocking input stream in a way that data isn't removed from + memory until all child streams have consumed the input. + + If the stream's buffer gets full because some child isn't consuming the + data, other streams get returned 0 by i_stream_read(). */ +struct tee_istream *tee_i_stream_create(struct istream *input); +/* Returns TRUE if last read() operation returned 0, because it was waiting + for another tee stream to read more of its data. */ +bool tee_i_stream_child_is_waiting(struct istream *input); + +struct istream *tee_i_stream_create_child(struct tee_istream *tee); + +#endif |