From: Shuanglei Tao Date: Sat, 7 Dec 2019 02:34:52 +0000 (+0800) Subject: server: exit immediately on old lws versions X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=d5b303aa73d109e79521b0f94ae970e989cd9f15;p=ttyd.git server: exit immediately on old lws versions --- 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