Skip to content

Commit

Permalink
fix main
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldziuba03 committed Aug 1, 2024
1 parent 6f62a4a commit fd2cedd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit fd2cedd

Please sign in to comment.