Otherwise flush errors may be unintentionally ignored. This change requires
that all the o_stream_uncork() callers must call o_stream_nfinish()
afterwards, unless the ostream is set to ignore errors.
else if (!set) {
/* buffer flushing might close the stream */
ret = buffer_flush(fstream);
+ stream->last_errors_not_checked = TRUE;
if (fstream->io == NULL &&
(ret == 0 || fstream->flush_pending) &&
!stream->ostream.closed) {
if (_stream->parent != NULL)
o_stream_cork(_stream->parent);
} else {
- (void)o_stream_flush(&_stream->ostream);
+ o_stream_nflush(&_stream->ostream);
if (_stream->parent != NULL)
o_stream_uncork(_stream->parent);
}
/* Delays sending as far as possible, writing only full buffers. Also sets
TCP_CORK on if supported. */
void o_stream_cork(struct ostream *stream);
+/* Try to flush the buffer by calling o_stream_nflush() and remove TCP_CORK.
+ Note that after this o_stream_nfinish() must be called, unless the stream
+ ignores errors. */
void o_stream_uncork(struct ostream *stream);
bool o_stream_is_corked(struct ostream *stream);
/* Try to flush the output stream. Returns 1 if all sent, 0 if not,