search for: tls_recv

Displaying 5 results from an estimated 5 matches for "tls_recv".

2019 Jun 03
0
[PATCH libnbd discussion only 3/5] lib: Pass handle to socket recv and send calls.
...DBLOCK) return 1; /* more data */ diff --git a/lib/crypto.c b/lib/crypto.c index c437788..aba2e27 100644 --- a/lib/crypto.c +++ b/lib/crypto.c @@ -145,7 +145,7 @@ nbd_unlocked_set_tls_psk_file (struct nbd_handle *h, const char *filename) #ifdef HAVE_GNUTLS static ssize_t -tls_recv (struct socket *sock, void *buf, size_t len) +tls_recv (struct nbd_handle *h, struct socket *sock, void *buf, size_t len) { ssize_t r; @@ -163,7 +163,8 @@ tls_recv (struct socket *sock, void *buf, size_t len) } static ssize_t -tls_send (struct socket *sock, const void *buf, size_t len) +t...
2019 Jun 06
1
[libnbd PATCH] tls: Check for pending bytes in gnutls buffers
...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, }; diff --git a/lib/internal.h b/lib/internal.h index 5b6152b..61ddbde 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -192,6 +192,7 @@ struct socket_ops { struct socket *sock,...
2019 Jun 08
0
[PATCH libnbd 1/3] lib: socket: Add .send flags parameter.
...->send (h, h->sock, h->wbuf, h->wlen, 0); if (r == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) return 1; /* more data */ diff --git a/lib/crypto.c b/lib/crypto.c index e0f173f..703bc84 100644 --- a/lib/crypto.c +++ b/lib/crypto.c @@ -164,7 +164,7 @@ tls_recv (struct nbd_handle *h, struct socket *sock, void *buf, size_t len) static ssize_t tls_send (struct nbd_handle *h, - struct socket *sock, const void *buf, size_t len) + struct socket *sock, const void *buf, size_t len, int flags) { ssize_t r; diff --git a/lib/internal.h b...
2019 Jun 08
6
[PATCH libnbd 0/3] states: Use MSG_MORE to coalesce messages.
Appears to have a measurable benefit, see 3/3 for test results. Rich.
2019 Jun 03
10
[PATCH libnbd discussion only 0/5] api: Implement concurrent writer.
This works, but there's no time saving and I'm still investigating whether it does what I think it does. Nevertheless I thought I would post it because it (probably) implements the idea I had last night outlined in: https://www.redhat.com/archives/libguestfs/2019-June/msg00010.html The meat of the change is patch 4. Patch 5 is an example which I would probably fold into patch 4 for