diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-11-11 23:55:28 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-11-11 23:55:28 +0000 |
commit | 24d1860868682d33f60970119b1cff1bf088a497 (patch) | |
tree | cb88a880d6bcb921af076cc0a107ac705c9764f0 /src/stls | |
parent | 1e10d30b41b65dbd520e01adc5fe686cb92b0f12 (diff) | |
download | s6-networking-24d1860868682d33f60970119b1cff1bf088a497.tar.xz |
New and fixed version of sbearssl_run
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/stls')
-rw-r--r-- | src/stls/stls_run.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stls/stls_run.c b/src/stls/stls_run.c index 960260b..7385c4e 100644 --- a/src/stls/stls_run.c +++ b/src/stls/stls_run.c @@ -104,9 +104,9 @@ static void send_closenotify (struct tls *ctx, int const *fds) iopause_g(&x, 1, 0) ; } -static void closeit (struct tls *ctx, int *fds, int brutal) +static void closeit (struct tls *ctx, int *fds, int closenotify) { - if (brutal) fd_shutdown(fds[3], 1) ; + if (!closenotify) fd_shutdown(fds[3], 1) ; else if (fds[2] >= 0) send_closenotify(ctx, fds) ; fd_close(fds[3]) ; fds[3] = -1 ; } @@ -243,7 +243,7 @@ void stls_run (struct tls *ctx, int *fds, uint32_t options, unsigned int verbosi if (r < 0) { if (r == -1) strerr_warnwu2x("read from peer: ", tls_error(ctx)) ; - if (options & 1) fd_shutdown(fds[2], 0) ; + if (!(options & 1)) fd_shutdown(fds[2], 0) ; /* XXX: We need a way to detect when we've received a close_notify, because then we need to trigger a write and then shut the engine |