search for: set_request_structured_repli

Displaying 14 results from an estimated 14 matches for "set_request_structured_repli".

2020 Sep 05
1
Re: libnbd completion callback question
...te what I mean. Proof that common clients have a memory leak (rather than a risk of a double free error), and thus that this is worth fixing by guaranteeing closure cleanup even on client-side failures: $ export count=10 $ nbdkit null 1m --run 'export uri; /usr/bin/time -v nbdsh -c " h.set_request_structured_replies(False) def f (c, o, e, err): pass import os h.connect_uri(os.environ[\"uri\"]) for _ in range(int(os.environ[\"count\"])): try: h.block_status(512, 0, f) except nbd.Error as ex: pass print(\"got here\") "' 2>&1 | grep '\(here\|r...
2019 Sep 04
2
[libnbd PATCH] api: Add way to avoid structured replies
...t_sr; char **request_meta_contexts; /* Global flags from the server. */ diff --git a/generator/generator b/generator/generator index 1cc5c19..5c32afa 100755 --- a/generator/generator +++ b/generator/generator @@ -1243,6 +1243,36 @@ Get the current TLS PSK filename."; }; *) + "set_request_structured_replies", { + default_call with + args = [Bool "request"]; ret = RErr; + permitted_states = [ Created ]; + first_version = (1, 2); + shortdesc = "control use of structured replies"; + longdesc = "\ +By default, libnbd tries to negotiate structured replies w...
2020 Sep 05
2
libnbd completion callback question
I noticed while reading the code that we have a documentation hole that may cause memory leaks for clients that are unaware, in relation to completion callbacks. The situation arises as follows: for all commands with a completion callback, I checked that the code has clean semantics: either nbd_aio_FOO() returns -1 and we never call the callback cleanup, or nbd_aio_FOO() returns a cookie and
2019 Sep 05
0
Re: [libnbd PATCH] api: Add way to avoid structured replies
...et_request_sr' if > the existing name choice seems too long. There's not really a limit on the length of API names, and in this case the longer name explains what the option does more clearly. Anyway this looks fine to me. ACK I have one comment unrelated to the patch: > + "set_request_structured_replies", { > + default_call with > + args = [Bool "request"]; ret = RErr; > + permitted_states = [ Created ]; > + first_version = (1, 2); I just know that we're going to end up adding new APIs and forgetting to set the first_version field. There are various t...
2020 Sep 07
4
[libnbd PATCH v2 0/3] Improve type-safety of ocaml/golang getters
Well, the golang changes (patch 1 and 2/3 of v1) were already committed, all that was left was the OCaml changes. I'm a lot happier with how things turned out with an UNKNOWN constructor in the OCaml variants. Eric Blake (3): tests: Enhance coverage of enum/flag range checking ocaml: Support unknown values for Enum/Flags ocaml: Typesafe returns for REnum/RFlags generator/OCaml.ml
2019 Sep 17
1
[libnbd PATCH] api: Add nbd_get_structured_replies_negotiated
...mpted"; longdesc = "\ Return the state of the request structured replies flag on this -handle. Note that this only reports whether the client attempts -to negotiate structured replies, and not whether the server was -able to honor that request"; - see_also = ["L<nbd_set_request_structured_replies(3)>"]; +handle. + +B<Note:> If you want to find out if structured replies were actually +negotiated on a particular connection use +C<nbd_get_structured_replies_negotiated> instead."; + see_also = ["L<nbd_set_request_structured_replies(3)>"; +...
2019 Sep 17
3
[PATCH libnbd 1/2] api: Add new API to read whether TLS was negotiated.
...ed, and in +C<LIBNBD_TLS_DISABLE> mode TLS is not tried."; + see_also = ["L<nbd_set_tls(3)>"; "L<nbd_get_tls(3)>"]; }; "set_tls_certificates", { @@ -2527,6 +2552,7 @@ let first_version = [ "can_fast_zero", (1, 2); "set_request_structured_replies", (1, 2); "get_request_structured_replies", (1, 2); + "get_tls_negotiated", (1, 2); (* These calls are proposed for a future version of libnbd, but * have not been added to any released version so far. diff --git a/generator/states-newstyle-opt-starttls.c b/g...
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
...uest_structured_replies(3)>"; + "L<nbd_set_handshake_flags(3)>"; "L<nbd_can_meta_context(3)>"; "L<nbd_can_df(3)>"]; }; @@ -1277,6 +1285,66 @@ able to honor that request"; see_also = ["L<nbd_set_request_structured_replies(3)>"]; }; + "set_handshake_flags", { + default_call with + args = [ Flags ("flags", handshake_flags) ]; ret = RErr; + permitted_states = [ Created ]; + shortdesc = "control use of handshake flags"; + longdesc = "\ +By default, libnbd...
2020 Sep 06
0
[libnbd PATCH 3/3] ocaml: Typesafe returns for REnum/RFlags
...est_120_set_non_defaults.ml +++ b/ocaml/tests/test_120_set_non_defaults.ml @@ -28,14 +28,14 @@ let () = if NBD.supports_tls nbd then ( NBD.set_tls nbd NBD.TLS.ALLOW; let tls = NBD.get_tls nbd in - assert (tls = 1); (* XXX Add REnum *) + assert (tls = NBD.TLS.ALLOW); ); NBD.set_request_structured_replies nbd false; let sr = NBD.get_request_structured_replies nbd in assert (sr = false); NBD.set_handshake_flags nbd []; let flags = NBD.get_handshake_flags nbd in - assert (flags = 0); (* XXX Add RFlags *) + assert (flags = []); NBD.set_opt_mode nbd true; let opt = NBD.get_opt_mode...
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...- assert (tls = 0); (* XXX Add REnum, to get NBD.TLS.DISABLE? *) + assert (tls = NBD.TLS.DISABLE); if NBD.supports_tls nbd then ( NBD.set_tls nbd NBD.TLS.ALLOW; let tls = NBD.get_tls nbd in - assert (tls = 1); (* XXX Add REnum *) + assert (tls = NBD.TLS.ALLOW); ); NBD.set_request_structured_replies nbd false; let sr = NBD.get_request_structured_replies nbd in @@ -46,10 +46,11 @@ let () = with NBD.Error _ -> (); let flags = NBD.get_handshake_flags nbd in - assert (flags = 3); (* XXX Add RFlags, to get NBD.HANDSHAKE_FLAG list? *) + assert (flags = [ NBD.HANDSHAKE_FLAG.FIXED...
2019 Sep 17
0
[PATCH libnbd 2/2] api: New API for reading NBD protocol.
...Other strings might +be returned in future. Most modern NBD servers use C<\"newstyle-fixed\">. +" +^ non_blocking_test_call_description + }; + "get_size", { default_call with args = []; ret = RInt64; @@ -2553,6 +2577,7 @@ let first_version = [ "set_request_structured_replies", (1, 2); "get_request_structured_replies", (1, 2); "get_tls_negotiated", (1, 2); + "get_protocol", (1, 2); (* These calls are proposed for a future version of libnbd, but * have not been added to any released version so far. diff --git a/generat...
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...ags() == nbd.HANDSHAKE_FLAG_MASK assert h.get_opt_mode() is False diff --git a/python/t/120-set-non-defaults.py b/python/t/120-set-non-defaults.py index 3963021..3da0c23 100644 --- a/python/t/120-set-non-defaults.py +++ b/python/t/120-set-non-defaults.py @@ -34,11 +34,10 @@ if h.supports_tls(): h.set_request_structured_replies(False) assert h.get_request_structured_replies() is False try: - h.set_handshake_flags(nbd.HANDSHAKE_FLAG_NO_ZEROES << 1) + h.set_handshake_flags(nbd.HANDSHAKE_FLAG_MASK + 1) assert False except nbd.Error: - assert h.get_handshake_flags() == (nbd.HANDSHAKE_FLAG_NO_ZEROES |...
2020 Sep 06
8
[libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
Natural fallout after my recent testsuite additions that fixed a couple of ocaml bugs in the setters. However, on at least the OCaml code, I'm not sure what we should do if a newer libnbd ever returns a bit that an older NBD.mli was not expecting at the time the OCaml compiler ran (see below). I'm also not sure if there is a more efficient way to avoid outputting Val_FOO() converters for
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2: - now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE - four flags instead of two: STRICT_FLAGS is new (patch 4), and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5) - various refactorings for more shared code and less duplication Eric Blake (5): api: Add xxx_MASK constant for each Flags type generator: Refactor filtering of accepted OFlags api: Add