From d5b303aa73d109e79521b0f94ae970e989cd9f15 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Sat, 7 Dec 2019 10:34:52 +0800 Subject: [PATCH] server: exit immediately on old lws versions --- src/server.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server.c b/src/server.c index 6858704..05bc5d4 100644 --- a/src/server.c +++ b/src/server.c @@ -190,12 +190,13 @@ signal_cb(uv_signal_t *watcher, int signum) { exit(EXIT_FAILURE); force_exit = true; lws_cancel_service(context); -#if LWS_LIBRARY_VERSION_MAJOR < 3 - lws_libuv_stop(context); -#else +#if LWS_LIBRARY_VERSION_MAJOR >= 3 uv_stop(server->loop); -#endif lwsl_notice("send ^C to force exit.\n"); +#else + lws_libuv_stop(context); + exit(EXIT_SUCCESS); +#endif } int -- 2.43.4