Commit Graph

6 Commits

Author SHA1 Message Date
Anthony Ramine 9cf03ae4c1 Move async callbacks infra to boring itself
This helps drive async callbacks from outside tokio-boring, such as in quiche.

Not a breaking change because every public item in tokio-boring is preserved as is.
2023-11-27 11:53:35 +01:00
Anthony Ramine c38ed71511 Use replace_ex_data more
Setting callbacks multiple times on a SslContextBuilder causes the previous callback
installed to leak, using replace_ex_data internally prevents that.

We also start using it in tokio-boring in with_ex_data_future, my understanding
is that the futures currently in use are never installed twice by that function
but that could change in the future with the addition of more async callbacks.
2023-11-23 11:07:17 +01:00
Anthony Ramine 7c5fdfa0a8 Remove Sync trait bounds on callback futures
They are unnecessary as we ever only retrieve the futures from ex data
to poll them, thus when we have mutable access to them, so Send is all we need.
2023-11-03 13:31:11 +00:00
Anthony Ramine 1ca7f76607 Introduce set_async_get_session_callback 2023-10-25 10:25:55 +01:00
Anthony Ramine ea96015b66 Remove futures from ex data slots once they resolve 2023-10-10 09:22:36 +01:00
Anthony Ramine 907eaf079c Introduce async callbacks
We introduce tokio_boring::SslContextBuilderExt, with 2 methods:

* set_async_select_certificate_callback
* set_async_private_key_method
2023-10-10 09:22:36 +01:00