search for: preconnect

Displaying 20 results from an estimated 79 matches for "preconnect".

Did you mean: reconnect
2020 Feb 10
1
[nbdkit PATCH] ocaml: Support .preconnect callback
...nc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -98,6 +98,8 @@ type 'a plugin = { thread_model : (unit -> thread_model) option; can_fast_zero : ('a -> bool) option; + + preconnect : (bool -> unit) option; } let default_callbacks = { @@ -145,6 +147,8 @@ let default_callbacks = { thread_model = None; can_fast_zero = None; + + preconnect = None; } external set_name : string -> unit = "ocaml_nbdkit_set_name" "noalloc" @@ -192,6 +196,8 @@ e...
2020 Feb 25
6
[PATCH nbdkit 0/5] server: Add .get_ready callback.
I like this change. I think we were overloading the config_complete method before to do two different things (complete configuration; do any allocation/housekeeping necessary before we can start serving). The only questions in my mind are whether we want this before 1.18, and whether the name ("get_ready") is a good one. Rich.
2004 Dec 13
1
MYSQL cmd - preconnect?
hi is it possible to have asterisk connect to mysql with a username/password in some config file and then, afterwards, just use a global handle to the db? I don't see the point of connecting every time I need to query it ... roy
2020 Jun 22
4
[PATCH nbdkit 1/2] server: Add .after_fork callback, mainly for plugins to create threads.
...00f8e70d..510781e1 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -128,23 +128,23 @@ which is required. F<nbdkit-filter.h> defines some function types (C<nbdkit_next_config>, C<nbdkit_next_config_complete>, C<nbdkit_next_get_ready>, -C<nbdkit_next_preconnect>, C<nbdkit_next_open>) and a structure called -C<struct nbdkit_next_ops>. These abstract the next plugin or filter -in the chain. There is also an opaque pointer C<nxdata> which must be -passed along when calling these functions. The value of C<nxdata> -passed to C<...
2020 Feb 22
2
Re: Plans for nbdkit 1.18 release?
Eric: Did you want to take this one any further? It might be one that we save for > 1.18: https://www.redhat.com/archives/libguestfs/2020-February/thread.html#00206 Another thing I've been thinking about for some time is splitting .config_complete into .config_complete + .get_ready (new name TBD). At the moment .config_complete is both the place where we finish processing config, and
2020 Feb 22
1
Re: Plans for nbdkit 1.18 release?
...er.pod index 4105b8b7..a9dffb56 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -127,22 +127,24 @@ which is required. =head1 NEXT PLUGIN F<nbdkit-filter.h> defines some function types (C<nbdkit_next_config>, -C<nbdkit_next_config_complete>, C<nbdkit_next_preconnect>, -C<nbdkit_next_open>) and a structure called C<struct nbdkit_next_ops>. -These abstract the next plugin or filter in the chain. There is also -an opaque pointer C<nxdata> which must be passed along when calling -these functions. The value of C<nxdata> passed to C<....
2020 Mar 04
2
[PATCH nbdkit] server: Only display "close: " debug message if callback is called.
For example if .preconnect fails, it printed the debug messages: debug: preconnect: ... debug: close: ... This confused me into thinking that the close callback was actually being called without a corresponding open. In fact it is not called in this case. Suppress the debug message unless the callback is actually bei...
2020 Sep 01
0
[nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...+ name : string; + description : string; +} +(** The type of the export list returned by [.list_exports]. *) + type thread_model = | THREAD_MODEL_SERIALIZE_CONNECTIONS | THREAD_MODEL_SERIALIZE_ALL_REQUESTS @@ -78,10 +84,13 @@ type 'a plugin = { after_fork : (unit -> unit) option; preconnect : (bool -> unit) option; + list_exports : (bool -> bool -> export list) option; + default_export : (bool -> bool -> string) option; open_connection : (bool -> 'a) option; (* required *) close : ('a -> unit) option; get_size : ('a -> int64) op...
2020 Sep 21
0
[nbdkit PATCH v3 14/14] ocaml: Implement .list_exports and friends
...: string; + description : string option; +} +(** The type of the export list returned by [.list_exports]. *) + type thread_model = | THREAD_MODEL_SERIALIZE_CONNECTIONS | THREAD_MODEL_SERIALIZE_ALL_REQUESTS @@ -78,10 +84,13 @@ type 'a plugin = { after_fork : (unit -> unit) option; preconnect : (bool -> unit) option; + list_exports : (bool -> bool -> export list) option; + default_export : (bool -> bool -> string) option; open_connection : (bool -> 'a) option; (* required *) close : ('a -> unit) option; get_size : ('a -> int64) op...
2020 Feb 12
2
[nbdkit PATCH] filters: Remove most next_* wrappers
...' for filters. With this in place, we can now delete most of the next_* wrappers, by pointing to corresponding backend_* functions instead; the few exceptions are .config and .config_complete (the public API returns an integer, but the backend code exits on failure and thus returns void), and .preconnect (we don't have a backend_preconnect function). Signed-off-by: Eric Blake <eblake@redhat.com> --- The alternative to the #ifdef'd typedef is to touch all of the filters/*.c files to change 'void *nxdata' to 'struct backend *nxdata'. include/nbdkit-filter.h | 119 +++...
2020 Aug 25
0
[nbdkit PATCH 1/5] api: Add .default_export
...sts to the corresponding C<.close>, with all intermediate functions (such as C<.pread>) receiving the same value for convenience; the only exceptions where C<nxdata> is not reused are C<.config>, -C<.config_complete>, C<.get_ready>, C<.after_fork>, C<.preconnect> and -C<.list_exports>, which are called outside the lifetime of a -connection. +C<.config_complete>, C<.get_ready>, C<.after_fork>, C<.preconnect>, +C<.list_exports>, and C<.default_export>, which are called outside +the lifetime of a connection. =hea...
2020 Aug 25
2
Re: [RFC nbdkit PATCH] protocol: Alter .list_exports, add .default_export
...ike ondemand), this is trivial: return a > compile-time constant string. But for others (like sh and eval), > there's a lifetime issue: this callback is used _before_ .open, ergo > there is no handle struct that it can be associated with. What's > more, this is called _after_ .preconnect, which means it is logical > to expect that the default export name might change over time > (consider a plugin that advertises the largest file in a directory > as its default, but where the directory can change _which_ file is > largest between when the first client connects and when...
2020 Feb 12
0
[PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...open, and serves as - * a stable ‘void *nxdata’ in the filter API. - */ -struct b_h { - struct backend *b; - void *handle; -}; - /* Note this frees the whole chain. */ static void filter_free (struct backend *b) @@ -186,20 +176,19 @@ filter_config_complete (struct backend *b) static int next_preconnect (void *nxdata, int readonly) { - struct b_h *b_h = nxdata; - return b_h->b->preconnect (b_h->b, readonly); + struct backend *b_next = nxdata; + return b_next->preconnect (b_next, readonly); } static int filter_preconnect (struct backend *b, int readonly) { struct backend_f...
2020 Aug 06
6
[nbdkit PATCH v2 0/5] .list_exports
Since v1: - patch 1: check size limits - patch 2: better handling of default export name canonicalization - patch 3: support filters as well as plugins - patch 4: new - patch 5: rewrite sh parser, fix testsuite to actually work and cover more cases (now that libnbd.git is fixed) Eric Blake (4): server: Add exports list functions server: Prepare to use export list from plugin log: Add
2020 Aug 24
3
[RFC nbdkit PATCH] protocol: Alter .list_exports, add .default_export
...default_only, + int readonly, int is_tls, struct nbdkit_exports *exports); This intercepts the plugin C<.list_exports> method and can be used to filter which exports are advertised. +The C<readonly> parameter matches what is passed to <.preconnect> and +C<.open>, and may be changed by the filter when calling into the +plugin. The C<is_tls> parameter informs the filter whether TLS +negotiation has been completed by the client, but is not passed on to +C<next> because it cannot be altered. + It is possible for filters to...
2020 Feb 27
3
[PATCH nbdkit] server: When using --run, wait for captive nbdkit to exit.
I'd like to propose we backport this to 1.18 and some earlier stable branches too. Rich.
2020 Jul 31
6
[RFC nbdkit PATCH 0/4] Progress towards .list_exports
This takes Rich's API proposal and starts fleshing it out with enough meat that I was able to test 'nbdkit eval' advertising multiple exports with descriptions paired with 'qemu-nbd --list'. Eric Blake (3): server: Add exports list functions server: Prepare to use export list from plugin sh, eval: Add .list_exports support Richard W.M. Jones (1): server: Implement
2020 Feb 11
1
Re: [PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...* a stable ‘void *nxdata’ in the filter API. > */ > -struct b_conn { > +struct b_h { > struct backend *b; > - struct connection *conn; > void *handle; > }; > > @@ -186,22 +186,22 @@ filter_config_complete (struct backend *b) > static int > next_preconnect (void *nxdata, int readonly) > { > - struct b_conn *b_conn = nxdata; > - return b_conn->b->preconnect (b_conn->b, b_conn->conn, readonly); > + struct b_h *b_h = nxdata; > + return b_h->b->preconnect (b_h->b, readonly); > } None of the next_*() wrapper...
2020 Jul 31
0
[nbdkit PATCH 3/4] server: Implement list_exports.
...it-plugin.h | 3 +++ server/plugins.c | 10 +++++-- 4 files changed, 69 insertions(+), 8 deletions(-) diff --git a/docs/nbdkit-plugin.pod b/docs/nbdkit-plugin.pod index f8e9962a..7ce89e9e 100644 --- a/docs/nbdkit-plugin.pod +++ b/docs/nbdkit-plugin.pod @@ -152,6 +152,9 @@ the plugin: │ preconnect │ │ └──────┬─────┘ │ ┌──────┴─────┐ │ + │list_exports│ │ + └──────┬─────┘ │ + ┌──────┴─────┐ │ │ open │ │ └──────┬─────┘ │ ┌──────┴─────┐ NBD opti...
2020 Mar 04
2
[PATCH nbdkit v2] New filter: limit: Limit number of clients that can connect.
...ts against. However malicious clients could still play tricks at the TCP level (eg. half-opened connections), connect as many times as they want to the server, and have as many NBD negotiations going on (albeit slowly). It would be possible to mitigate this further in the filter by counting "preconnected" clients separately, but the filter does not do this at present. Most likely if you were serious about this you'd want some other kind of protection outside the server. I'll note here that nbdkit has no time limit on NBD protocol negotiation. Possibly it should. $ nbdkit null $ t...