From 11e6254179cb78412f40d2a263bf4fb40dd7f2ff Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Wed, 10 Jun 2020 20:04:01 +0200 Subject: Improve memdebug, add basic proxy stats --- uring.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'uring.c') 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 -- cgit v1.2.3