tlsgate

TLS reverse proxy
git clone git://git.akobets.xyz/tlsgate
Log | Files | Refs | README | LICENSE

commit 96915bfbbbe63fd94643139578e227273d347b81
parent a6266e5699566ff9f65089760148beeb7b5877fd
Author: Artem Kobets <artem@akobets.xyz>
Date:   Thu,  3 Sep 2020 10:28:35 +0300

add -v flag

Diffstat:
MMakefile | 1+
Mmain.c | 14+++++++++-----
2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile @@ -8,6 +8,7 @@ LIBS = -ltls ALL_CFLAGS = -std=c99 -pedantic -Wall \ -Wmissing-prototypes -Wstrict-prototypes \ -D_POSIX_C_SOURCE=200809L \ + -DVERSION=\"$(VERSION)\" \ $(CFLAGS) $(CPPFLAGS) ALL_LDFLAGS = $(LIBS) $(LDFLAGS) diff --git a/main.c b/main.c @@ -2,6 +2,7 @@ #include <signal.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <sys/resource.h> #include <sys/wait.h> #include <unistd.h> @@ -32,7 +33,7 @@ usage(void) errx( "usage: %s -c cert -k key [-C ca]\n" " [-h host] -p port [-H host] [-P port] [-U file]\n" - " [-n proc-num]", + " [-n proc-num] [-v]", argv0 ); } @@ -60,7 +61,7 @@ main(int argc, char **argv) argv0 = argv[0]; - while ((opt = getopt(argc, argv, "c:k:C:h:p:H:P:U:"))) { + while ((opt = getopt(argc, argv, "c:k:C:h:p:H:P:U:nv"))) { switch (opt) { case 'c': cert_file = optarg; @@ -71,9 +72,6 @@ main(int argc, char **argv) case 'C': ca_file = optarg; break; - case 'n': - maxnprocs = atol(optarg); - break; case 'h': server_host = optarg; break; @@ -89,6 +87,12 @@ main(int argc, char **argv) case 'U': client_udsfile = optarg; break; + case 'n': + maxnprocs = atol(optarg); + break; + case 'v': + errx("version %s", VERSION); + break; default: usage(); break;