summaryrefslogtreecommitdiff
path: root/src/tls/s6-ucspitlsd.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-11-16 05:13:06 +0000
committerLaurent Bercot <ska@appnovation.com>2023-11-16 05:13:06 +0000
commit26597a785ec2dd4e9ec9fb7d9765d2ee8779ee16 (patch)
treec2c5602397e9381b1cb04472ed057edd4a00e520 /src/tls/s6-ucspitlsd.c
parentd8ca717da164c3e76ebb56c954d0a08544955601 (diff)
downloads6-networking-26597a785ec2dd4e9ec9fb7d9765d2ee8779ee16.tar.xz
Add -J and -j to the TLS tools to check for peer close_notify.
Also, and more importantly, significantly rewrite stls_run() for better full-duplex support. This implementation isn't fully tested yet. Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tls/s6-ucspitlsd.c')
-rw-r--r--src/tls/s6-ucspitlsd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tls/s6-ucspitlsd.c b/src/tls/s6-ucspitlsd.c
index fc0868a..d2b9580 100644
--- a/src/tls/s6-ucspitlsd.c
+++ b/src/tls/s6-ucspitlsd.c
@@ -14,7 +14,7 @@
#include <s6-networking/config.h>
#include "s6tls-internal.h"
-#define USAGE "s6-ucspitlsd [ -S | -s ] [ -Y | -y ] [ -k snilevel ] [ -v verbosity ] [ -K timeout ] [ -Z | -z ] prog..."
+#define USAGE "s6-ucspitlsd [ -S | -s ] [ -J | -j ] [ -Y | -y ] [ -k snilevel ] [ -v verbosity ] [ -K timeout ] [ -Z | -z ] prog..."
#define dieusage() strerr_dieusage(100, USAGE)
static inline void child (int *, uint32_t, unsigned int, unsigned int, unsigned int, pid_t) gccattr_noreturn ;
@@ -77,14 +77,16 @@ int main (int argc, char const *const *argv)
subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
- int opt = subgetopt_r(argc, argv, "SsYyv:K:Zzk:", &l) ;
+ int opt = subgetopt_r(argc, argv, "SsJjyYv:K:Zzk:", &l) ;
if (opt == -1) break ;
switch (opt)
{
case 'S' : coptions |= 4 ; break ;
case 's' : coptions &= ~4 ; break ;
- case 'Y' : coptions |= 1 ; coptions &= ~2 ; break ;
+ case 'J' : coptions |= 8 ; break ;
+ case 'j' : coptions &= ~8 ; break ;
case 'y' : coptions |= 3 ; break ;
+ case 'Y' : coptions |= 1 ; coptions &= ~2 ; break ;
case 'v' : if (!uint0_scan(l.arg, &verbosity)) dieusage() ; break ;
case 'K' : if (!uint0_scan(l.arg, &kimeout)) dieusage() ; break ;
case 'Z' : poptions &= ~1 ; break ;