diff --git a/src/rio.h b/src/rio.h index 10e5ad2821..146cd81ab3 100644 --- a/src/rio.h +++ b/src/rio.h @@ -116,7 +116,7 @@ typedef struct _rio rio; * if needed. */ static inline size_t rioWrite(rio *r, const void *buf, size_t len) { - if (r->flags & RIO_FLAG_WRITE_ERROR) return 0; + if (r->flags & RIO_FLAG_WRITE_ERROR || r->flags & RIO_FLAG_CLOSE_ASAP) return 0; while (len) { size_t bytes_to_write = (r->max_processing_chunk && r->max_processing_chunk < len) ? r->max_processing_chunk : len;