summaryrefslogtreecommitdiff
path: root/uring.c
diff options
context:
space:
mode:
Diffstat (limited to 'uring.c')
-rw-r--r--uring.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/uring.c b/uring.c
index 4859ac0..c8e1dbb 100644
--- a/uring.c
+++ b/uring.c
@@ -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