]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/net: fix dangling addrvec in bind(), the repeat_until_value() part. 43243/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 20 Sep 2021 13:59:30 +0000 (13:59 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 21 Sep 2021 13:57:40 +0000 (13:57 +0000)
commit71626b4729c26ba9d88f194510e44b5d64a6fa3c
treeaff30050d302eadd2d752c9c4eb51ce115d707b9
parent3d244a2396db9d7283bb47c60e6167b234363776
crimson/net: fix dangling addrvec in bind(), the repeat_until_value() part.

This is a follow-up to commit 480273082718230d64d2c068db1b22f44997bdc8.

`seastar::do_with()` doesn't extend the life-time of the callable's

```cpp
auto
do_with_impl(T1&& rv1, T2&& rv2, More&&... more) {
    // ...
    auto&& just_values = cherry_pick_tuple(idx(), std::move(all));
    auto&& just_func = std::move(std::get<nr>(std::move(all)));
    // ...
    auto task = std::apply(
        [](auto&&... x) {
            return std::make_unique<internal::do_with_state<value_tuple, ret_type>>(std::forward<decltype(x)>(x)...);
        },
        std::move(just_values));
    auto fut = std::apply(just_func, task->data());
    // ...
}
```

closure. This means the `addrs` needs to be captured by value also
by the lambda passed to `repeat_until_value()`.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/net/SocketMessenger.cc