Displaying 3 results from an estimated 3 matches for "e0f173f".
2019 Jun 06
1
[libnbd PATCH] tls: Check for pending bytes in gnutls buffers
...e)
SET_NEXT_STATE (%ISSUE_COMMAND.START);
+ else {
+ assert (h->sock);
+ if (h->sock->ops->pending && h->sock->ops->pending (h->sock))
+ 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,...
2019 Jun 08
0
[PATCH libnbd 1/3] lib: socket: Add .send flags parameter.
...gt;ops->send (h, h->sock, h->wbuf, h->wlen);
+ r = h->sock->ops->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...
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.