search for: limit_config

Displaying 4 results from an estimated 4 matches for "limit_config".

2020 Mar 04
2
[PATCH nbdkit v2] New filter: limit: Limit number of clients that can connect.
This is a second version of the limit filter. v1 was posted here: https://www.redhat.com/archives/libguestfs/2020-March/msg00015.html I didn't bother to repost the other three patches because they are the same. The difference is this version of the filter takes security more seriously. It shouldn't be possible for malicious clients to connect more than limit=N times to the plugin now,
2020 Mar 04
0
[PATCH nbdkit v2] New filter: limit: Limit number of clients that can connect.
...;pthread.h> + +#include <nbdkit-filter.h> + +#include "cleanup.h" + +/* Counts client connections. */ +static unsigned connections; +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + +/* Client limit (0 = filter is disabled). */ +static unsigned limit = 1; + +static int +limit_config (nbdkit_next_config *next, nbdkit_backend *nxdata, + const char *key, const char *value) +{ + if (strcmp (key, "limit") == 0) { + if (nbdkit_parse_unsigned ("limit", value, &limit) == -1) + return -1; + return 0; + } + + return next (nxdata, key, v...
2020 Mar 06
1
Re: [PATCH nbdkit v2] New filter: limit: Limit number of clients that can connect.
...> +++ b/filters/limit/limit.c > + > +/* Counts client connections. */ > +static unsigned connections; > +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; > + > +/* Client limit (0 = filter is disabled). */ > +static unsigned limit = 1; > + > +static int > +limit_config (nbdkit_next_config *next, nbdkit_backend *nxdata, > + const char *key, const char *value) > +{ > + if (strcmp (key, "limit") == 0) { > + if (nbdkit_parse_unsigned ("limit", value, &limit) == -1) > + return -1; > + return 0; > +...
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.