diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-07-24 15:17:47 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-07-24 15:33:46 +1000 |
commit | 5508c2501ead3dd6fba1700cdcafd539c3636c33 (patch) | |
tree | 0b2cd0cdcd2821a148191ecc4fe2091f4bcc7e03 | |
parent | da293a1eef2ddd709f10b63744032302ca3597d3 (diff) | |
download | jimtcl-5508c2501ead3dd6fba1700cdcafd539c3636c33.zip jimtcl-5508c2501ead3dd6fba1700cdcafd539c3636c33.tar.gz jimtcl-5508c2501ead3dd6fba1700cdcafd539c3636c33.tar.bz2 |
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 <steveb@workware.net.au>
-rw-r--r-- | jim-aio.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |