diff --git a/lib/web.c b/lib/web.c index b7f6bec7f..c6d1b235b 100644 --- a/lib/web.c +++ b/lib/web.c @@ -143,8 +143,6 @@ static void * worker(void *ctx) { struct web *w = ctx; - assert(w->state == STATE_STARTED); - for (;;) lws_service(w->context, 100); @@ -223,11 +221,11 @@ int web_start(struct web *w) error("WebSocket: failed to initialize server"); } - w->state = STATE_STARTED; ret = pthread_create(&w->thread, NULL, worker, w); if (ret) error("Failed to start Web worker"); + w->state = STATE_STARTED; return ret; }