From 5508c2501ead3dd6fba1700cdcafd539c3636c33 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Fri, 24 Jul 2020 15:17:47 +1000 Subject: aio: ssl: connection close isn't an error A return code of SSL_ERROR_ZERO_RETURN means the connection was closed. It isn't an error. Signed-off-by: Steve Bennett --- jim-aio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'jim-aio.c') diff --git a/jim-aio.c b/jim-aio.c index 473aa7e..e189781 100644 --- a/jim-aio.c +++ b/jim-aio.c @@ -299,7 +299,11 @@ static const char *ssl_getline(struct AioFile *af, char *buf, int len) static int ssl_error(const struct AioFile *af) { int ret = SSL_get_error(af->ssl, 0); - if (ret == SSL_ERROR_SYSCALL || ret == 0) { + /* XXX should we be following the same logic as ssl_reader() here? */ + if (ret == SSL_ERROR_ZERO_RETURN || ret == SSL_ERROR_NONE) { + return JIM_OK; + } + if (ret == SSL_ERROR_SYSCALL) { return stdio_error(af); } return JIM_ERR; -- cgit v1.1