search for: crypto_send

Displaying 10 results from an estimated 10 matches for "crypto_send".

Did you mean: crypto_aead
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 10
2
[nbdkit PATCH] crypto: Tweak handling of SEND_MORE
...there's no need to try and merge it + * with any corked data from a previous send that used SEND_MORE. + */ +#define MAX_SEND_MORE_LEN (64 * 1024) + /* Write buffer to GnuTLS and either 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) gn...
2019 Jun 06
0
[nbdkit PATCH 1/2] server: Add support for corking
...return 0; +} + /* Read buffer from conn->sockin and either succeed completely * (returns > 0), read an EOF (returns 0), or fail (returns -1). */ diff --git a/server/crypto.c b/server/crypto.c index 978a843..e4abca2 100644 --- a/server/crypto.c +++ b/server/crypto.c @@ -371,6 +371,24 @@ crypto_send (struct connection *conn, const void *vbuf, size_t len) return 0; } +/* Change the cork status to batch a group of 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 =...
2019 Jun 07
0
[nbdkit PATCH v2 2/2] server: Group related transmission send()s
...) { - r = send (sock, buf, len, 0); + r = send (sock, buf, len, f); if (r == -1) { if (errno == EINTR || errno == EAGAIN) continue; diff --git a/server/crypto.c b/server/crypto.c index 3f87944..3f3d96b 100644 --- a/server/crypto.c +++ b/server/crypto.c @@ -357,6 +357,9 @@ crypto_send (struct connection *conn, const void *vbuf, size_t len, int flags) assert (session != NULL); + if (flags & SEND_MORE) + gnutls_record_cork (session); + while (len > 0) { r = gnutls_record_send (session, buf, len); if (r < 0) { @@ -368,6 +371,10 @@ crypto_send (struct...
2018 Jun 14
4
[PATCH nbdkit 0/2] Fix a couple of problems found by Coverity.
There are a few other issues that Coverity found, but I believe all can be ignored ... except one: We don't set umask anywhere inside nbdkit. Coverity complains that this is a problem where we create temporary files, since the result of mkstemp depends implicitly on the umask value. I think we might consider setting umask anyway (eg. to 022) just to make plugin behaviour more predictable.
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
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status implementation. While the patches (especially the second one) are very large they are really just elementary code motion. Rich.
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...en) { + struct connection *conn = GET_CONN; gnutls_session_t session = conn->crypto_session; char *buf = vbuf; ssize_t r; @@ -355,8 +356,9 @@ crypto_recv (struct connection *conn, void *vbuf, size_t len) * (returns 0) or fail (returns -1). flags is ignored for now. */ static int -crypto_send (struct connection *conn, const void *vbuf, size_t len, int flags) +crypto_send (const void *vbuf, size_t len, int flags) { + struct connection *conn = GET_CONN; gnutls_session_t session = conn->crypto_session; const char *buf = vbuf; ssize_t r; @@ -392,8 +394,9 @@ crypto_send (struct...
2020 Feb 11
4
[PATCH nbdkit v2 0/3] server: Remove explicit connection parameter.
v1 was here: https://www.redhat.com/archives/libguestfs/2020-February/msg00081.html v2 replaces struct connection *conn = GET_CONN; with GET_CONN; which sets conn implicitly and asserts that it is non-NULL. If we actually want to test if conn is non-NULL or behave differently, then you must use threadlocal_get_conn() instead, and some existing uses do that. Rich.
2020 Feb 11
5
[PATCH nbdkit 0/3] server: Remove explicit connection parameter.
The third patch is a large but mechanical change which gets rid of passing around struct connection * entirely within the server, preferring instead to reference the connection through thread-local storage. I hope this is a gateway to simplifying other parts of the code. Rich.