search for: 145e8c1

Displaying 5 results from an estimated 5 matches for "145e8c1".

Did you mean: 14581
2019 Jun 06
1
[libnbd PATCH] tls: Check for pending bytes in gnutls buffers
...cause it was an interesting problem. (Sad when my writeup is three times longer than the patch itself...) generator/states.c | 5 +++++ lib/crypto.c | 7 +++++++ lib/internal.h | 1 + 3 files changed, 13 insertions(+) diff --git a/generator/states.c b/generator/states.c index bce4f85..145e8c1 100644 --- a/generator/states.c +++ b/generator/states.c @@ -113,6 +113,11 @@ send_from_wbuf (struct nbd_handle *h) READY: if (h->cmds_to_issue) SET_NEXT_STATE (%ISSUE_COMMAND.START); + else { + assert (h->sock); + if (h->sock->ops->pending && h->sock->...
2019 Jun 08
0
[PATCH libnbd 1/3] lib: socket: Add .send flags parameter.
...ptimization flags such as MSG_MORE for socket layers which can handle this. --- generator/states.c | 2 +- lib/crypto.c | 2 +- lib/internal.h | 2 +- lib/socket.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generator/states.c b/generator/states.c index 145e8c1..e879a83 100644 --- a/generator/states.c +++ b/generator/states.c @@ -92,7 +92,7 @@ send_from_wbuf (struct nbd_handle *h) if (h->wlen == 0) return 0; /* move to next state */ - r = h->sock->ops->send (h, h->sock, h->wbuf, h->wlen); + r = h->sock...
2019 Jun 09
0
[PATCH libnbd] states: In recv_into_rbuf and send_from_wbuf loop until EAGAIN.
...ately available to receive/send we would return to poll. Instead of this, loop until the socket returns EAGAIN. --- generator/states.c | 91 ++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/generator/states.c b/generator/states.c index 145e8c1..cde934a 100644 --- a/generator/states.c +++ b/generator/states.c @@ -46,43 +46,40 @@ recv_into_rbuf (struct nbd_handle *h) void *rbuf; size_t rlen; - if (h->rlen == 0) - return 0; /* move to next state */ + while (h->rlen > 0) { + /* As a special case h-&...
2019 Jun 09
2
[PATCH libnbd] states: In recv_into_rbuf and send_from_wbuf loop until EAGAIN.
I thought this should produce a fairly dramatic performance gain. In fact I couldn't measure any performance difference at all. I think what's happening is we're actually paying an extra syscall (to discover the socket would block) and then doing the poll anyway. So I don't know if it's worth having this patch. It could be argued that it makes the code shorter (therefore
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.