Refactor: Modernize asio TLS Stream#3764
Conversation
Co-Authored-By: Fabian Albert <fabian.albert@rohde-schwarz.com>
This is the first version of boost asio to handle C++20 concepts correctly.
Co-Authored-By: Fabian Albert <fabian.albert@rohde-schwarz.com>
Co-Authored-By: Fabian Albert <fabian.albert@rohde-schwarz.com>
|
|
||
| #include <boost/version.hpp> | ||
| #if BOOST_VERSION >= 106600 | ||
| #if BOOST_VERSION >= 107300 |
There was a problem hiding this comment.
My main concern here is this increases the required Boost version (which is fine) but also it's hard for downstream users to know if the asio integration works for their botan+boost combination. They can test if it's available, using the usual feature macro - but they don't know if it will work if they include the header.
Maybe we should define somewhere (in an existing or new header) what our minimum boost version is, wrt this asio integration, which would allow applications to check for availability. (Or maybe you have some better idea of how to address this)
There was a problem hiding this comment.
That's indeed a valid point. I'll make a proposal in a follow-up PR.
randombit
left a comment
There was a problem hiding this comment.
lgtm modulo this thing with the versioning; doesn't have to be addressed here - it was always an issue and increasing the Boost version just makes the issue more immediate.
This updates the asio stream for C++20:
Additionally, it now allows applications to (optionally) override the
TLS::Callbacksobject. This wasn't possible before and therefore limited the customizability of the asio stream significantly.Re: co-routines: Given a recent-enough toolchain and boost version, one can actually do: