summaryrefslogtreecommitdiff
path: root/src/sbearssl/sbearssl_run.c
diff options
context:
space:
mode:
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 ;
}