]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Add o_stream_uncork_flush() to both uncork and flush
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 16 Feb 2018 12:26:11 +0000 (14:26 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 12 Mar 2018 08:41:08 +0000 (10:41 +0200)
src/lib/ostream.h

index 9e76f98db3956d56d10e7e5250ee1fa1ac952b5f..c706b3fb87bb4dc8a632b9aa8141854c5bbb52de 100644 (file)
@@ -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);