search for: gnutls_record_check_pend

Displaying 1 result from an estimated 1 matches for "gnutls_record_check_pend".

2019 Jun 06
1
[libnbd PATCH] tls: Check for pending bytes in gnutls buffers
...SET_NEXT_STATE (%REPLY.START); + } return 0; DEAD: diff --git a/lib/crypto.c b/lib/crypto.c index 3f7c744..e0f173f 100644 --- a/lib/crypto.c +++ b/lib/crypto.c @@ -181,6 +181,12 @@ tls_send (struct nbd_handle *h, return r; } +static bool +tls_pending (struct socket *sock) +{ + return gnutls_record_check_pending (sock->u.tls.session) > 0; +} + static int tls_get_fd (struct socket *sock) { @@ -209,6 +215,7 @@ tls_close (struct socket *sock) static struct socket_ops crypto_ops = { .recv = tls_recv, .send = tls_send, + .pending = tls_pending, .get_fd = tls_get_fd, .close = tls_close,...