From 66025e640db17e9ee5451487f4657c419b76c5fb Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Wed, 15 May 2019 20:21:24 +0800 Subject: [PATCH] server: allow reconnect to be 0 --- src/server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index 73c07ab..c125c0c 100644 --- a/src/server.c +++ b/src/server.c @@ -331,7 +331,7 @@ main(int argc, char **argv) { break; case 'r': server->reconnect = atoi(optarg); - if (server->reconnect <= 0) { + if (server->reconnect < 0) { fprintf(stderr, "ttyd: invalid reconnect: %s\n", optarg); return -1; } @@ -448,7 +448,9 @@ main(int argc, char **argv) { lwsl_notice(" start command: %s\n", server->command); lwsl_notice(" close signal: %s (%d)\n", server->sig_name, server->sig_code); lwsl_notice(" terminal type: %s\n", server->terminal_type); - lwsl_notice(" reconnect timeout: %ds\n", server->reconnect); + if (server->reconnect > 0) { + lwsl_notice(" reconnect timeout: %ds\n", server->reconnect); + } if (server->check_origin) lwsl_notice(" check origin: true\n"); if (server->url_arg) -- 2.43.4