From fd2ceddafb1770a5af45fe1fa89c32ace9a17d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dziuba?= Date: Thu, 1 Aug 2024 07:24:41 +0200 Subject: [PATCH] fix main --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index a7ca5e1..a4fe8ab 100644 --- a/src/main.c +++ b/src/main.c @@ -13,7 +13,8 @@ void handle_onrequest(http_request_t *req) {} void worker(int id, int port) { - lx_io_t ctx = lx_init(); + lx_io_t ctx; + lx_init(&ctx); lx_http_t http = lx_http_init(DEFAULT_PORT, handle_onrequest); lx_http_listen(&ctx, &http); log_info("Server is listening on port %d", DEFAULT_PORT); @@ -29,7 +30,8 @@ void timer_once(lx_timer_t *timer) { } void timer_test() { - lx_io_t ctx = lx_init(); + lx_io_t ctx; + lx_init(&ctx); lx_timer_t timer; lx_timer_init(&ctx, &timer); lx_timer_start(&timer, timer_once, 8 * 1000);