summaryrefslogtreecommitdiff
path: root/uring.c
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-10 20:04:01 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-10 20:04:01 +0200
commit11e6254179cb78412f40d2a263bf4fb40dd7f2ff (patch)
treed641877095f16a1c6edb575c41c40b95e43b8004 /uring.c
parent320f600cd980230b2b2e34c7256c9564af6afae9 (diff)
Improve memdebug, add basic proxy stats
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