search for: gnutls_record_uncork

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

Did you mean: gnutls_record_cork
2019 Jun 10
2
[nbdkit PATCH] crypto: Tweak handling of SEND_MORE
...her succeed completely * (returns 0) or fail (returns -1). flags is ignored for now. */ @@ -357,7 +363,11 @@ crypto_send (struct connection *conn, const void *vbuf, size_t len, int flags) assert (session != NULL); - if (flags & SEND_MORE) + if (len >= MAX_SEND_MORE_LEN) { + if (gnutls_record_uncork (session, GNUTLS_RECORD_WAIT) < 0) + return -1; + } + else if (flags & SEND_MORE) gnutls_record_cork (session); while (len > 0) { -- 2.20.1
2019 Jun 06
0
[nbdkit PATCH 1/2] server: Add support for corking
...f send calls, and either succeed + * completely (returns 0) or fail (returns -1). + */ +static int +crypto_cork (struct connection *conn, bool cork) +{ + gnutls_session_t session = conn->crypto_session; + + assert (session != NULL); + + if (cork) + gnutls_record_cork (session); + else if (gnutls_record_uncork (session, GNUTLS_RECORD_WAIT) < 0) + return -1; + + return 0; +} + /* There's no place in the NBD protocol to send back errors from * close, so this function ignores errors. */ @@ -504,6 +522,7 @@ crypto_negotiate_tls (struct connection *conn, int sockin, int sockout) */ conn...
2019 Jun 07
0
[nbdkit PATCH v2 2/2] server: Group related transmission send()s
...gnutls_record_cork (session); + while (len > 0) { r = gnutls_record_send (session, buf, len); if (r < 0) { @@ -368,6 +371,10 @@ crypto_send (struct connection *conn, const void *vbuf, size_t len, int flags) len -= r; } + if (!(flags & SEND_MORE) && + gnutls_record_uncork (session, GNUTLS_RECORD_WAIT) < 0) + return -1; + return 0; } diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c index 6993c8e..e0136de 100644 --- a/server/protocol-handshake-newstyle.c +++ b/server/protocol-handshake-newstyle.c @@ -94,13 +94,13 @@ s...
2019 Jun 07
4
[nbdkit PATCH v2 0/2] Reduce network overhead with MSG_MORE/corking
This time around, the numbers are indeed looking better than in v1; and I like the interface better. Eric Blake (2): server: Prefer send() over write() server: Group related transmission send()s server/internal.h | 7 +++- server/connections.c | 51 +++++++++++++++++++++++++--- server/crypto.c | 11 ++++--
2019 Jun 06
4
[nbdkit PATCH 0/2] Reduce network overhead with corking
Slightly RFC, as I need more time to investigate why Unix sockets appeared to degrade with this patch. But as TCP sockets (over loopback to localhost) and TLS sessions (regardless of underlying Unix or TCP) both showed improvements, this looks like a worthwhile series. Eric Blake (2): server: Add support for corking server: Cork around grouped transmission send()s server/internal.h | 3