Close the websocket after forking so that child processes don't prevent new connections (#162)

This commit is contained in:
dmayle
2019-03-16 03:08:37 +00:00
committed by Shuanglei Tao
parent 6df6ac3e03
commit 0b44b9b943

View File

@@ -180,6 +180,8 @@ thread_run_command(void *args) {
perror("setenv"); perror("setenv");
pthread_exit((void *) 1); 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) { if (execvp(server->argv[0], server->argv) < 0) {
perror("execvp"); perror("execvp");
pthread_exit((void *) 1); pthread_exit((void *) 1);
@@ -401,4 +403,4 @@ callback_tty(struct lws *wsi, enum lws_callback_reasons reason,
} }
return 0; return 0;
} }