search for: socket_send

Displaying 11 results from an estimated 11 matches for "socket_send".

2019 Jun 03
0
[PATCH libnbd discussion only 3/5] lib: Pass handle to socket recv and send calls.
...lude "internal.h" static ssize_t -socket_recv (struct socket *sock, void *buf, size_t len) +socket_recv (struct nbd_handle *h, struct socket *sock, void *buf, size_t len) { ssize_t r; @@ -41,7 +41,8 @@ socket_recv (struct socket *sock, void *buf, size_t len) } static ssize_t -socket_send (struct socket *sock, const void *buf, size_t len) +socket_send (struct nbd_handle *h, + struct socket *sock, const void *buf, size_t len) { ssize_t r; -- 2.21.0
2019 Jun 08
0
[PATCH libnbd 1/3] lib: socket: Add .send flags parameter.
...(*get_fd) (struct socket *sock); int (*close) (struct socket *sock); diff --git a/lib/socket.c b/lib/socket.c index 084398b..8555855 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -42,11 +42,11 @@ socket_recv (struct nbd_handle *h, struct socket *sock, void *buf, size_t len) static ssize_t socket_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; - r = send (sock->u.fd, buf, len, 0); + r = send (sock->u.fd, buf, len, flags); if (r == -1 && errn...
2019 Jun 27
3
[libnbd PATCH 0/2] socket handling cleanups
While working on a new test of what happens when the server goes away while commands are in flight, I managed to hit a race where I hit death from SIGPIPE instead of a clean transition to the DEAD state. I also found myself wanting to use nbd_poll from the test, but with a way to distinguish between the state machine progressing vs. hanging. Eric Blake (2): socket: Avoid SIGPIPE where possible
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
2019 Jun 04
0
[PATCH libnbd v2 3/4] api: Implement concurrent writer.
.../* Generic way to read into a buffer - set rbuf to point to a * buffer, rlen to the amount of data you expect, and in the state * machine call recv_into_rbuf. diff --git a/lib/socket.c b/lib/socket.c index f48e455..77a45cd 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -46,10 +46,29 @@ socket_send (struct nbd_handle *h, { ssize_t r; - r = send (sock->u.fd, buf, len, 0); - if (r == -1 && errno != EAGAIN && errno != EWOULDBLOCK) - set_error (errno, "send"); - return r; + if (!h->writer) { + r = send (sock->u.fd, buf, len, 0); + if (r == -1...
2019 Jun 03
1
Re: [PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...be non-zero"); > + return -1; > + } > + > + /* Ignore second and subsequent calls, record only the first error. */ > + if (h->writer_error == 0) > + h->writer_error = err; > + > + return 0; > +} > + > +++ b/lib/socket.c > @@ -46,10 +46,24 @@ socket_send (struct nbd_handle *h, > { > ssize_t r; > > - r = send (sock->u.fd, buf, len, 0); > - if (r == -1 && errno != EAGAIN && errno != EWOULDBLOCK) > - set_error (errno, "send"); > - return r; > + if (!h->writer) { > + r = send (s...
2019 Jun 03
0
[PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
.../* Generic way to read into a buffer - set rbuf to point to a * buffer, rlen to the amount of data you expect, and in the state * machine call recv_into_rbuf. diff --git a/lib/socket.c b/lib/socket.c index f48e455..c6fba6d 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -46,10 +46,24 @@ socket_send (struct nbd_handle *h, { ssize_t r; - r = send (sock->u.fd, buf, len, 0); - if (r == -1 && errno != EAGAIN && errno != EWOULDBLOCK) - set_error (errno, "send"); - return r; + if (!h->writer) { + r = send (sock->u.fd, buf, len, 0); + if (r == -1...
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.
2020 Mar 30
4
[libnbd PATCH 0/2] fix hangs against nbdkit 1.2
nbdkit 1.2 as a server waits for read() to see EOF, even after the client has sent NBD_CMD_DISC. That was fixed in mbdkit 1.4; and most modern NBD servers are smarter than this (they close() the write end of their traffic soon after NBD_CMD_DISC). But it's easy enough to revert nbdkit commit c70616f8 to get back to a server with the same behavior as the older nbdkit, at which point both
2014 Mar 15
1
Upgrading from 4.1.4 to 4.1.6 on FreeBSD 9.2
...ls.so: undefined reference to `tdb_wrap_open at SAMBA_4.1.4' /usr/local/lib/libsamba-credentials.so: undefined reference to `E_md4hash at SAMBA_4.1.4' /usr/local/lib/libsamdb.so: undefined reference to `samdb_search_dn at SAMBA_4.1.4' /usr/local/lib/libgensec.so: undefined reference to `socket_send at SAMBA_4.1.4' /usr/local/lib/libgensec.so: undefined reference to `socket_recv at SAMBA_4.1.4' /usr/local/lib/libsamba-credentials.so: undefined reference to `tdb_change_int32_atomic at SAMBA_4.1.4' /usr/local/lib/libsamba-credentials.so: undefined reference to `nt_errstr at SAMBA_4.1...
2019 Jun 04
9
[PATCH libnbd v2 0/4] api: Implement concurrent writer.
v1: https://www.redhat.com/archives/libguestfs/2019-June/msg00014.html I pushed a few bits which are uncontroversial. The main changes since v1 are: An extra patch removes the want_to_send / check for nbd_aio_is_ready in examples/threaded-reads-and-writes.c. This logic was wrong since commit 6af72b87 as was pointed out by Eric in his review. Comments and structure of