]> prime8.dev >> repos - ttyd.git/commitdiff
server: exit immediately on old lws versions
authorShuanglei Tao <tsl0922@gmail.com>
Sat, 7 Dec 2019 02:34:52 +0000 (10:34 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Sun, 8 Dec 2019 05:29:47 +0000 (13:29 +0800)
src/server.c

index 6858704d5e02a1568d0361ff728102f9ef5ce448..05bc5d46f850b520c65be892e949efcaf925f5b7 100644 (file)
@@ -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