diff --git a/include/villas/nodes/websocket.h b/include/villas/nodes/websocket.h index 287b62cbf..a19cb65f7 100644 --- a/include/villas/nodes/websocket.h +++ b/include/villas/nodes/websocket.h @@ -22,6 +22,10 @@ #include "pool.h" #include "queue_signalled.h" #include "common.h" +#include "config.h" + +#define DEFAULT_WEBSOCKET_QUEUELEN (DEFAULT_QUEUELEN * 64) +#define DEFAULT_WEBSOCKET_SAMPLELEN DEFAULT_SAMPLELEN /* Forward declaration */ struct lws; diff --git a/lib/nodes/websocket.c b/lib/nodes/websocket.c index 27c44ceeb..7ec609807 100644 --- a/lib/nodes/websocket.c +++ b/lib/nodes/websocket.c @@ -16,7 +16,6 @@ #include "webmsg_format.h" #include "timing.h" #include "utils.h" -#include "config.h" #include "plugin.h" #include "nodes/websocket.h" @@ -57,7 +56,7 @@ static int websocket_connection_init(struct websocket_connection *c, struct lws else list_push(&connections, c); - ret = queue_init(&c->queue, DEFAULT_QUEUELEN, &memtype_hugepage); + ret = queue_init(&c->queue, DEFAULT_WEBSOCKET_QUEUELEN, &memtype_hugepage); if (ret) { warn("Failed to create queue for incoming websocket connection. Closing.."); return -1; @@ -268,13 +267,13 @@ int websocket_start(struct node *n) int ret; struct websocket *w = n->_vd; - size_t blocklen = LWS_PRE + WEBMSG_LEN(DEFAULT_SAMPLELEN); + size_t blocklen = LWS_PRE + WEBMSG_LEN(DEFAULT_WEBSOCKET_SAMPLELEN); - ret = pool_init(&w->pool, 64 * DEFAULT_QUEUELEN, blocklen, &memtype_hugepage); + ret = pool_init(&w->pool, DEFAULT_WEBSOCKET_QUEUELEN, blocklen, &memtype_hugepage); if (ret) return ret; - ret = queue_signalled_init(&w->queue, DEFAULT_QUEUELEN, &memtype_hugepage); + ret = queue_signalled_init(&w->queue, DEFAULT_WEBSOCKET_QUEUELEN, &memtype_hugepage); if (ret) return ret;