o_stream_nsend(stream, str, strlen(str));
}
-void o_stream_nflush(struct ostream *stream)
-{
- if (unlikely(stream->closed || stream->stream_errno != 0))
- return;
- (void)o_stream_flush(stream);
- stream->real_stream->last_errors_not_checked = TRUE;
-}
-
int o_stream_nfinish(struct ostream *stream)
{
- o_stream_nflush(stream);
+ (void)o_stream_flush(stream);
o_stream_ignore_last_errors(stream);
if (stream->stream_errno == 0 && stream->real_stream->noverflow) {
io_stream_set_error(&stream->real_stream->iostream,
if (_stream->parent != NULL)
o_stream_cork(_stream->parent);
} else {
- o_stream_nflush(&_stream->ostream);
+ (void)o_stream_flush(&_stream->ostream);
+ _stream->last_errors_not_checked = TRUE;
+
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.
+/* Try to flush the buffer by calling o_stream_flush() 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);
void o_stream_nsendv(struct ostream *stream, const struct const_iovec *iov,
unsigned int iov_count);
void o_stream_nsend_str(struct ostream *stream, const char *str);
-void o_stream_nflush(struct ostream *stream);
/* Marks the stream's error handling as completed. Flushes the stream and
returns -1 if stream->stream_errno is non-zero. Returns failure if any of
the o_stream_nsend*() didn't write all data. */