From fbabc5727345488b4203d9327e4384b14d38deba Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 19 Dec 2015 16:15:51 +0100 Subject: [PATCH] fixed some small bugs in async path and web socket --- lib/path.c | 6 ++++-- lib/websocket.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/path.c b/lib/path.c index b8e1d9259..95b72745d 100644 --- a/lib/path.c +++ b/lib/path.c @@ -62,12 +62,14 @@ static void * path_run_async(void *arg) p->overrun += expir; warn("Overrun detected for path: overruns=%" PRIu64, expir); } + + if (p->received == 0) + continue; if (path_run_hook(p, HOOK_ASYNC)) continue; - if (p->received > 0) - path_write(p); + path_write(p); } return NULL; diff --git a/lib/websocket.c b/lib/websocket.c index 61caaa1ca..153738341 100644 --- a/lib/websocket.c +++ b/lib/websocket.c @@ -407,7 +407,7 @@ int websocket_write(struct node *n, struct msg *pool, int poolsize, int first, i pthread_mutex_unlock(&w->write.mutex); - return 0; + return 1; } static struct node_type vt = {