From: Timo Sirainen Date: Fri, 16 Feb 2018 12:26:11 +0000 (+0200) Subject: lib: Add o_stream_uncork_flush() to both uncork and flush X-Git-Tag: 2.3.1~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b44d1a08c1d9408ae599c7e48e9a01a346b438e5;p=thirdparty%2Fdovecot%2Fcore.git lib: Add o_stream_uncork_flush() to both uncork and flush --- diff --git a/src/lib/ostream.h b/src/lib/ostream.h index 9e76f98db3..c706b3fb87 100644 --- a/src/lib/ostream.h +++ b/src/lib/ostream.h @@ -136,6 +136,13 @@ bool o_stream_is_corked(struct ostream *stream); the stream had overflown, return error. Returns 1 if all data is sent, 0 there's still buffered data, -1 if error. */ int o_stream_flush(struct ostream *stream); +/* Wrapper to easily both uncork and flush. */ +static inline int o_stream_uncork_flush(struct ostream *stream) +{ + o_stream_uncork(stream); + return o_stream_flush(stream); +} + /* Set "flush pending" state of stream. If set, the flush callback is called when more data is allowed to be sent, even if the buffer itself is empty. */ void o_stream_set_flush_pending(struct ostream *stream, bool set);