From a043eb3931b58d9370565734211508af1f83fe94 Mon Sep 17 00:00:00 2001 From: grm Date: Sun, 2 Mar 2025 14:42:46 +0200 Subject: Add template and suppress verbose logging --- src/web.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/web.c') diff --git a/src/web.c b/src/web.c index 3108545..f3aa5f7 100644 --- a/src/web.c +++ b/src/web.c @@ -58,8 +58,6 @@ char *read_file_to_string(const char *filename) { return buffer; } - - int key_to_number(char key) { switch (key) { @@ -207,13 +205,13 @@ void *websocket_server_thread(void *arg) { info.pt_serv_buf_size = 32 * 1024; info.options = LWS_SERVER_OPTION_VALIDATE_UTF8; - context = lws_create_context(&info); + context = lws_create_context(&info); if (!context) { fprintf(stderr, "lws_create_context failed\n"); return NULL; } - printf("WebSocket server running on ws://localhost:%d\n", WS_PORT); + printf("WebSocket server running on ws://localhost:%d [http://localhost:%d]\n", WS_PORT, WS_PORT); while (1) { lws_service(context, 1000); // Service WebSocket events @@ -259,6 +257,8 @@ init_web(synth_t * synth) html_content = get_from_template(); synthx = synth; + lws_set_log_level(LLL_WARN, NULL); + // Create a new thread for the WebSocket server if (pthread_create(&server_thread, NULL, websocket_server_thread, NULL) != 0) { fprintf(stderr, "Failed to create server thread\n"); -- cgit v1.2.3