summaryrefslogtreecommitdiff
path: root/src/sbearssl/sbearssl_run.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-12-03 01:05:40 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-12-03 01:05:40 +0000
commitbdb38fdeb4183371b8ad8669c2821526133c39c8 (patch)
tree668f6b7e4ffc1549578259b19c4dd4d916d7156a /src/sbearssl/sbearssl_run.c
parentdb3aa47688fa38d4edd6563ce350577617e71a27 (diff)
downloads6-networking-bdb38fdeb4183371b8ad8669c2821526133c39c8.tar.xz
s6-tls*: small bugfixes. Add documentation.
Diffstat (limited to 'src/sbearssl/sbearssl_run.c')
-rw-r--r--src/sbearssl/sbearssl_run.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sbearssl/sbearssl_run.c b/src/sbearssl/sbearssl_run.c
index e4d49fa..ca4a79e 100644
--- a/src/sbearssl/sbearssl_run.c
+++ b/src/sbearssl/sbearssl_run.c
@@ -71,7 +71,12 @@ int sbearssl_run (br_ssl_engine_context *ctx, int *fds, unsigned int verbosity,
else if (!r)
{
fd_close(fds[0]) ; fds[0] = -1 ;
- br_ssl_engine_close(ctx) ;
+ if (options & 1)
+ {
+ shutdown(fds[3], SHUT_WR) ;
+ fd_close(fds[3]) ; fds[3] = -1 ;
+ }
+ else br_ssl_engine_close(ctx) ;
continue ;
}