diff options
Diffstat (limited to 'uring.c')
-rw-r--r-- | uring.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -191,7 +191,7 @@ uring_tbuf_write_cb(struct cfg *cfg, struct uring_task *task, int res) /* We wrote some more data */ task->tbuf->done += res; - if (task->tbuf->done >= task->tbuf->len) { + if (task->tbuf->done >= task->tbuf->len || res == 0) { r = task->tbuf->len; goto finished; } @@ -315,7 +315,10 @@ uring_tbuf_read_until_eof(struct cfg *cfg, struct uring_task *task, callback_t c static int uring_tbuf_have_data(struct cfg *cfg, struct uring_task *task, int res) { - return res; + if (res < 0) + return res; + else + return 1; } void |