Add a way to set context mode when creating context
create_context has distinct default mode for blocking and Runtime_lock.
Also add tests for Runtime_lock
This addresses issue #122
@anmonteiro This PR coould be extended with a set_mode function ?
can you move the tests to a separate PR?
I don't know if this is what you asked in the other PR but I'd prefer:
* 1 PR for `modes` handling * 1 PR with tests for `Runtime_lock`
done
Antonio Nuno Monteiro writes:
@anmonteiro commented on this pull request.
@@ -77,6 +77,26 @@ type verify_error = | Error_v_keyusage_no_certsign | Error_v_application_verification
+module Modes = struct
we can probably make it non-allocating if it's just pattern matches to convert to int, no?
You allocate when you build the list of modes. And moreover, you need to convert the OCaml constant to the proper power of 2. I really think the proposed pattern for C <-> OCaml constant is better. I even usually use cpp to generate the ml file, making the pattern type safe by design.
-- Christophe Raffalli tél: +689 87 23 11 48 web: http://raffalli.eu
Ce mail est signé avec pgp (Pièce jointe signature.asc, clef sur https://raffalli.eu/pgp) This mail is signed with pgp (Attachment signature.asc, key on https://raffalli.eu/pgp)
I have investigate async mode more. It seems that openssl can do async computation even when the user does not require async_job manually, if async mode is enabled (the doc is not really clear).