Merge pull request #172 from edzius/master

Handle SSL_send SYSCALL error without errno
https://www.openssl.org/docs/man1.1.1/man3/SSL_get_error.html
This commit is contained in:
Bruno Silvestre 2021-05-29 09:38:29 -03:00 committed by GitHub
commit 359151144b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,6 +182,10 @@ static int ssl_send(void *ctx, const char *data, size_t count, size_t *sent,
ssl->error = SSL_ERROR_SSL; ssl->error = SSL_ERROR_SSL;
return LSEC_IO_SSL; return LSEC_IO_SSL;
} }
/* Return failure when SSL reports syscall error
* but errno is not set to break send operation. */
if (errno == 0)
return LSEC_IO_SSL;
if (err == 0) if (err == 0)
return IO_CLOSED; return IO_CLOSED;
return lsec_socket_error(); return lsec_socket_error();