search for: exitlast_open

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

2020 Mar 04
0
[PATCH nbdkit 3/4] New filter: exitlast filter to exit on last client connection.
...+#include <stdatomic.h> +#else +/* Some old platforms lack atomic types, but 32 bit ints are usually + * "atomic enough". + */ +#define _Atomic /**/ +#endif + +/* Counts client connections. When this drops to zero we exit. */ +static _Atomic unsigned connections; + +static void * +exitlast_open (nbdkit_next_open *next, nbdkit_backend *nxdata, + int readonly) +{ + if (next (nxdata, readonly) == -1) + return NULL; + + connections++; + + return NBDKIT_HANDLE_NOT_NEEDED; +} + +static void +exitlast_close (void *handle) +{ + if (--connections == 0) { + nbdkit_debug (&qu...
2020 Mar 04
7
[PATCH nbdkit 0/4] server: Add nbdkit_shutdown() call and two new filters.
This adds a new nbdkit_shutdown() API whereby plugins and filters can request that the server shuts down (asynchronously) during the serving phase. Two new filters are added, one of which depends on this feature and the other not needing it but being somewhat related. Rich.
2020 Aug 07
0
[nbdkit PATCH 1/3] server: Implement nbdkit_is_tls for use during .open
...ng plugin. */ if (next (nxdata, 1, exportname) == -1) diff --git a/filters/exitlast/exitlast.c b/filters/exitlast/exitlast.c index 378cda75..4c879cc9 100644 --- a/filters/exitlast/exitlast.c +++ b/filters/exitlast/exitlast.c @@ -51,7 +51,7 @@ static _Atomic unsigned connections; static void * exitlast_open (nbdkit_next_open *next, nbdkit_backend *nxdata, - int readonly, const char *exportname) + int readonly, const char *exportname, int is_tls) { if (next (nxdata, readonly, exportname) == -1) return NULL; diff --git a/filters/ext2/ext2.c b/filters/ext2/ext2.c inde...
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...return NULL; return NBDKIT_HANDLE_NOT_NEEDED; diff --git a/filters/exitlast/exitlast.c b/filters/exitlast/exitlast.c index 51efda03..378cda75 100644 --- a/filters/exitlast/exitlast.c +++ b/filters/exitlast/exitlast.c @@ -51,9 +51,9 @@ static _Atomic unsigned connections; static void * exitlast_open (nbdkit_next_open *next, nbdkit_backend *nxdata, - int readonly) + int readonly, const char *exportname) { - if (next (nxdata, readonly) == -1) + if (next (nxdata, readonly, exportname) == -1) return NULL; connections++; diff --git a/filters/ext2/ext2.c b/fi...
2020 Aug 07
7
[nbdkit PATCH 0/3] Content differentiation during --tls=on
Patch 3 still needs tests added, but it is at least working from my simple command line tests. Eric Blake (3): server: Implement nbdkit_is_tls for use during .open server: Expose final thread_model to filter's .get_ready tlsdummy: New filter docs/nbdkit-filter.pod | 21 +- docs/nbdkit-plugin.pod | 34 ++- docs/nbdkit-tls.pod