diff options
Diffstat (limited to '')
-rw-r--r-- | src/libnetdata/socket/security.c (renamed from libnetdata/socket/security.c) | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libnetdata/socket/security.c b/src/libnetdata/socket/security.c index 4deb76623..502998b79 100644 --- a/libnetdata/socket/security.c +++ b/src/libnetdata/socket/security.c @@ -233,6 +233,19 @@ static inline bool is_handshake_complete(NETDATA_SSL *ssl, const char *op) { * (These are often the same value, but can be different on some systems.) */ +ssize_t netdata_ssl_pending(NETDATA_SSL *ssl) { + return SSL_pending(ssl->conn); +} + +bool netdata_ssl_has_pending(NETDATA_SSL *ssl) { + // this call was added on OpenSSL 1.1.0 + // however, it is more accurate than SSL_pending() + // unfortunately it does not exists in libressl. + // return SSL_has_pending(ssl->conn); + + return SSL_pending(ssl->conn) > 0; +} + ssize_t netdata_ssl_read(NETDATA_SSL *ssl, void *buf, size_t num) { errno = 0; ssl->ssl_errno = 0; |