]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rbd: avoid get_callback_adapter() for tcp_stream::async_connect()
authorCasey Bodley <cbodley@redhat.com>
Tue, 15 Feb 2022 23:12:00 +0000 (18:12 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 16 Feb 2022 19:53:46 +0000 (14:53 -0500)
commitc2e34c7513bff1d3aba2996b6e38d15af10ffca1
treee2c3d9d54bb9ce295449b638269fbdd8a0db3215
parent88eb23e585da3fda0e43c96161eccf1b45ac3bf0
rbd: avoid get_callback_adapter() for tcp_stream::async_connect()

works around a compilation failure in c++20 (with gcc 11.2 and boost
1.76) when choosing between two overloads of
`boost::beast::tcp_stream::async_connect()`

`get_callback_adapter()` returns a variadic lambda that matches the
concept for both overloads (`completion_token_for<ConnectHandler>`
and `completion_token_for<RangeConnectHandler>`), but compilation of
the wrapped lambda fails for the `ConnectHandler` overload because it
expects two arguments instead of one

instead of using `get_callback_adapter()` to convert the first argument
from `boost::system::error_code` to `int` for the wrapped lambda, do
this in the lambda itself

Fixes: https://tracker.ceph.com/issues/54303
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/librbd/migration/HttpClient.cc