From: Shuanglei Tao Date: Wed, 15 May 2019 12:21:24 +0000 (+0800) Subject: server: allow reconnect to be 0 X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=66025e640db17e9ee5451487f4657c419b76c5fb;p=ttyd.git server: allow reconnect to be 0 --- 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)