From 0b44b9b943752cede6fa25e42a83207caf67cdf6 Mon Sep 17 00:00:00 2001 From: dmayle Date: Sat, 16 Mar 2019 03:08:37 +0000 Subject: [PATCH] Close the websocket after forking so that child processes don't prevent new connections (#162) --- src/protocol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocol.c b/src/protocol.c index e4204cb..9f1ada5 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -180,6 +180,8 @@ thread_run_command(void *args) { perror("setenv"); pthread_exit((void *) 1); } + // Don't pass the web socket onto child processes + close(lws_get_socket_fd(client->wsi)); if (execvp(server->argv[0], server->argv) < 0) { perror("execvp"); pthread_exit((void *) 1); @@ -401,4 +403,4 @@ callback_tty(struct lws *wsi, enum lws_callback_reasons reason, } return 0; -} \ No newline at end of file +} -- 2.43.4