Displaying 18 results from an estimated 18 matches for "raw_close".
Did you mean:
ax_close
2019 Jun 06
0
[nbdkit PATCH 1/2] server: Add support for corking
...nn);
/* Don't call these raw socket functions directly. Use conn->recv etc. */
static int raw_recv (struct connection *, void *buf, size_t len);
static int raw_send (struct connection *, const void *buf, size_t len);
+static int raw_cork (struct connection *conn, bool cork);
static void raw_close (struct connection *);
int
@@ -288,6 +291,15 @@ new_connection (int sockin, int sockout, int nworkers)
conn->send = raw_send;
conn->close = raw_close;
+ /* Install a cork handler, but only if corking works */
+#ifdef TCP_CORK
+ {
+ int opt = 0;
+ if (setsockopt (sockout, IPPR...
2019 Aug 27
1
[PATCH nbdkit] server: Try hard to maintain invariant that fds 0, 1 and 2 are always open.
...loexec (int fd);
extern int set_nonblock (int fd);
+extern void close_or_nullify_fd (int fd);
#endif /* NBDKIT_UTILS_H */
diff --git a/server/connections.c b/server/connections.c
index c173df8..f57ab3e 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -489,7 +489,7 @@ static void
raw_close (struct connection *conn)
{
if (conn->sockin >= 0)
- close (conn->sockin);
+ close_or_nullify_fd (conn->sockin);
if (conn->sockout >= 0 && conn->sockin != conn->sockout)
- close (conn->sockout);
+ close_or_nullify_fd (conn->sockout);
}
diff...
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 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 ++++--
2018 Jan 17
0
[PATCH 5/9] connections: Allow multiple handles to be stored in the connection object.
...read_mutex_t status_lock;
int status; /* 1 for more I/O with client, 0 for shutdown, -1 on error */
- void *handle;
void *crypto_session;
int nworkers;
+ void **handles;
+ size_t nr_handles;
+
uint64_t exportsize;
int readonly;
int can_flush;
@@ -100,16 +102,37 @@ static void raw_close (struct connection *);
/* Accessors for public fields in the connection structure.
* Everything else is private to this file.
*/
-void
-connection_set_handle (struct connection *conn, void *handle)
+int
+connection_set_handle (struct connection *conn, size_t i, void *handle)
{
- conn->han...
2020 Feb 12
0
[PATCH nbdkit 2/3] server: Rename ‘struct b_conn_handle’ to plain ‘struct handle’.
...server/connections.c b/server/connections.c
index 7e9584b3..d4cdf994 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -58,15 +58,6 @@ static int raw_send_socket (const void *buf, size_t len, int flags);
static int raw_send_other (const void *buf, size_t len, int flags);
static void raw_close (void);
-void *
-connection_get_handle (size_t i)
-{
- GET_CONN;
-
- assert (i < conn->nr_handles);
- return conn->handles[i].handle;
-}
-
int
connection_get_status (void)
{
@@ -258,7 +249,7 @@ new_connection (int sockin, int sockout, int nworkers)
}
conn->nr_handles = top...
2018 Jan 19
0
[nbdkit PATCH v2 08/13] connections: Allow multiple handles to be stored in the connection object.
...hread_mutex_t status_lock;
int status; /* 1 for more I/O with client, 0 for shutdown, -1 on error */
- void *handle;
void *crypto_session;
int nworkers;
+ void **handles;
+ size_t nr_handles;
+
uint64_t exportsize;
int readonly;
int can_flush;
@@ -100,16 +102,37 @@ static void raw_close (struct connection *);
/* Accessors for public fields in the connection structure.
* Everything else is private to this file.
*/
-void
-connection_set_handle (struct connection *conn, void *handle)
+int
+connection_set_handle (struct connection *conn, size_t i, void *handle)
{
- conn->han...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...cv (struct connection *, void *buf, size_t len);
-static int raw_send_socket (struct connection *, const void *buf, size_t len,
- int flags);
-static int raw_send_other (struct connection *, const void *buf, size_t len,
- int flags);
-static void raw_close (struct connection *);
+static int raw_recv ( void *buf, size_t len);
+static int raw_send_socket (const void *buf, size_t len, int flags);
+static int raw_send_other (const void *buf, size_t len, int flags);
+static void raw_close (void);
void *
-connection_get_handle (struct connection *conn,...
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.
2019 Aug 03
5
[nbdkit PATCH 0/3] More responsive shutdown
We noticed while writing various libnbd tests that when the delay
filter is in use, there are scenarios where we had to resort to
SIGKILL to get rid of nbdkit, because it was non-responsive to SIGINT.
I'm still trying to figure out the best way to add testsuite coverage
of this, but already proved to myself that it works from the command
line, under two scenarios that both used to cause long
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
It's confusing to use the same terminology for a single backend as for
the linked list of backends. In particular it's often not clear if
we're calling the next backend or the whole chain of backends.
---
server/internal.h | 14 ++++++++++--
server/connections.c | 20 ++++++++---------
server/locks.c | 2 +-
server/main.c
2020 Aug 18
15
[PATCH nbdkit 0/9] Port to Windows.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw
This is the port to Windows using native Windows APIs (not MSYS or
Cygwin).
This patch series is at the point where it basically now works. I can
run the server with the memory plugin, and access it remotely using
guestfish, creating filesystems and so on without any apparent
problems.
Nevertheless there are many
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 Aug 20
15
[PATCH nbdkit 0/13] Port to Windows without using a separate library.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw-nolib
After a lot of work I have made the port to Windows work without using
a separate library. Instead, on Windows only, we build an "import
library" (library of stubs) which resolves references to nbdkit_*
functions in the main program and fixes up the plugin, basically the
first technique outlined in
2019 Aug 30
15
[nbdkit PATCH 0/9] can_FOO caching, more filter validation
It's easy to use the sh script to demonstrate that nbdkit is
inefficiently calling into .get_size, .can_fua, and friends more than
necessary. We've also commented on the list in the past that it would
be nice to ensure that when filters call into next_ops, they are not
violating constraints (as we've have to fix several bugs in the past
where we did not have such checking to protect
2018 Jan 17
14
[PATCH 0/9] Add filters to nbdkit.
The first three patches are identical to:
https://www.redhat.com/archives/libguestfs/2018-January/msg00079.html
"[PATCH nbdkit v2 0/3] Refactor plugin_* functions into a backend"
The rest of the patches add filters using the new filter API
previously described here:
https://www.redhat.com/archives/libguestfs/2018-January/msg00073.html
This needs a lot more testing -- and tests --
2018 Jan 19
16
[nbdkit PATCH v2 00/13] Add filters + FUA support to nbdkit
A combination of the work that both Rich and I have been doing
lately, where filters use only the new API with flags on every
command that the client can send over the wire (we can then
add support for more flags in nbdkit without having to add new
callbacks, as NBD adds more flags upstream).
Eric Blake (4):
protocol: Split flags from cmd field in requests
backend: Pass flags argument through