include/boost/corosio/native/detail/reactor/reactor_op_complete.hpp
93.1% Lines (121/130)
93.8% List of functions (30/32)
48.2% Branches (216/448)
Functions (32)
Function
Calls
Lines
Branches
Blocks
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>&)
:39
5x
87.5%
37.5%
60.0%
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>&)
:39
10x
100.0%
–
66.0%
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>&)
:39
5x
100.0%
–
60.0%
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_dgram_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>&)
:39
10x
100.0%
–
66.0%
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::kqueue_local_stream_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::kqueue_local_stream_acceptor, boost::corosio::local_endpoint>&)
:39
3x
100.0%
–
66.0%
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>&)
:39
205051x
100.0%
75.0%
80.0%
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::select_local_stream_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::select_local_stream_acceptor, boost::corosio::local_endpoint>&)
:39
3x
100.0%
–
66.0%
void boost::corosio::detail::complete_io_op<boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_tcp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_stream_base_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_tcp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>&)
:39
189323x
0.0%
0.0%
80.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>&)
:102
0
92.3%
25.0%
0.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>&)
:102
5x
100.0%
–
77.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>&)
:102
0
100.0%
–
0.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_dgram_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>&)
:102
5x
100.0%
–
77.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::kqueue_local_stream_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::kqueue_local_stream_acceptor, boost::corosio::local_endpoint>&)
:102
2x
100.0%
–
77.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>&)
:102
5414x
100.0%
72.2%
88.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::select_local_stream_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::select_local_stream_acceptor, boost::corosio::local_endpoint>&)
:102
2x
100.0%
–
77.0%
void boost::corosio::detail::complete_connect_op<boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_tcp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_stream_connect_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_tcp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>&)
:102
1834x
0.0%
0.0%
88.0%
bool boost::corosio::detail::setup_accepted_socket<boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::kqueue_local_stream_acceptor>(boost::corosio::detail::kqueue_local_stream_acceptor*, int&, sockaddr_storage const&, unsigned int, boost::corosio::io_object::implementation**, std::__1::error_code*)
:154
2x
92.0%
50.0%
83.0%
bool boost::corosio::detail::setup_accepted_socket<boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::kqueue_tcp_acceptor>(boost::corosio::detail::kqueue_tcp_acceptor*, int&, sockaddr_storage const&, unsigned int, boost::corosio::io_object::implementation**, std::__1::error_code*)
:154
5406x
100.0%
–
83.0%
bool boost::corosio::detail::setup_accepted_socket<boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::select_local_stream_acceptor>(boost::corosio::detail::select_local_stream_acceptor*, int&, sockaddr_storage const&, unsigned int, boost::corosio::io_object::implementation**, std::__1::error_code*)
:154
2x
100.0%
–
83.0%
bool boost::corosio::detail::setup_accepted_socket<boost::corosio::detail::select_tcp_socket, boost::corosio::detail::select_tcp_acceptor>(boost::corosio::detail::select_tcp_acceptor*, int&, sockaddr_storage const&, unsigned int, boost::corosio::io_object::implementation**, std::__1::error_code*)
:154
1825x
100.0%
–
83.0%
void boost::corosio::detail::complete_accept_op<boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::kqueue_local_stream_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_stream_socket, boost::corosio::detail::kqueue_local_stream_acceptor, boost::corosio::local_endpoint>&)
:206
2x
82.8%
51.9%
61.0%
void boost::corosio::detail::complete_accept_op<boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_tcp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>&)
:206
5415x
100.0%
–
80.0%
void boost::corosio::detail::complete_accept_op<boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::select_local_stream_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_stream_socket, boost::corosio::detail::select_local_stream_acceptor, boost::corosio::local_endpoint>&)
:206
2x
100.0%
–
61.0%
void boost::corosio::detail::complete_accept_op<boost::corosio::detail::select_tcp_socket, boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_tcp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_stream_accept_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_tcp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>&)
:206
1828x
100.0%
–
80.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>&)
:257
1x
92.9%
56.2%
63.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>&)
:257
2x
100.0%
–
72.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>>(boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>&)
:257
1x
100.0%
–
63.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>>(boost::corosio::detail::reactor_dgram_recv_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>&)
:257
2x
100.0%
–
72.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>, boost::corosio::local_endpoint>(boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_local_datagram_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::local_endpoint>&, boost::corosio::local_endpoint*)
:290
1x
95.0%
60.7%
73.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>, boost::corosio::endpoint>(boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::kqueue_traits, boost::corosio::detail::kqueue_udp_socket, boost::corosio::detail::kqueue_tcp_acceptor, boost::corosio::endpoint>&, boost::corosio::endpoint*)
:290
10x
100.0%
–
80.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>, boost::corosio::local_endpoint>(boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_local_datagram_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::local_endpoint>&, boost::corosio::local_endpoint*)
:290
1x
100.0%
–
73.0%
void boost::corosio::detail::complete_datagram_op<boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>, boost::corosio::endpoint>(boost::corosio::detail::reactor_dgram_recv_from_op<boost::corosio::detail::select_traits, boost::corosio::detail::select_udp_socket, boost::corosio::detail::select_tcp_acceptor, boost::corosio::endpoint>&, boost::corosio::endpoint*)
:290
17x
100.0%
–
80.0%
| Line | Branch | TLA | Hits | Source Code |
|---|---|---|---|---|
| 1 | // | |||
| 2 | // Copyright (c) 2026 Steve Gerbino | |||
| 3 | // | |||
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |||
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |||
| 6 | // | |||
| 7 | // Official repository: https://github.com/cppalliance/corosio | |||
| 8 | // | |||
| 9 | ||||
| 10 | #ifndef BOOST_COROSIO_NATIVE_DETAIL_REACTOR_REACTOR_OP_COMPLETE_HPP | |||
| 11 | #define BOOST_COROSIO_NATIVE_DETAIL_REACTOR_REACTOR_OP_COMPLETE_HPP | |||
| 12 | ||||
| 13 | #include <boost/corosio/detail/dispatch_coro.hpp> | |||
| 14 | #include <boost/corosio/native/detail/endpoint_convert.hpp> | |||
| 15 | #include <boost/corosio/native/detail/make_err.hpp> | |||
| 16 | #include <boost/corosio/io/io_object.hpp> | |||
| 17 | ||||
| 18 | #include <coroutine> | |||
| 19 | #include <mutex> | |||
| 20 | #include <utility> | |||
| 21 | ||||
| 22 | #include <netinet/in.h> | |||
| 23 | #include <sys/socket.h> | |||
| 24 | #include <unistd.h> | |||
| 25 | ||||
| 26 | namespace boost::corosio::detail { | |||
| 27 | ||||
| 28 | /** Complete a base read/write operation. | |||
| 29 | ||||
| 30 | Translates the recorded errno and cancellation state into | |||
| 31 | an error_code, stores the byte count, then resumes the | |||
| 32 | caller via symmetric transfer. | |||
| 33 | ||||
| 34 | @tparam Op The concrete operation type. | |||
| 35 | @param op The operation to complete. | |||
| 36 | */ | |||
| 37 | template<typename Op> | |||
| 38 | void | |||
| 39 | 394410x | complete_io_op(Op& op) | ||
| 40 | { | |||
| 41 | 394410x | op.stop_cb.reset(); | ||
| 42 | 394410x | op.socket_impl_->desc_state_.scheduler_->reset_inline_budget(); | ||
| 43 | ||||
| 44 |
9/16✓ Branch 0 taken 64 times.
✓ Branch 1 taken 189259 times.
✓ Branch 2 taken 754 times.
✓ Branch 3 taken 204307 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 10 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 3 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 5 times.
|
394410x | if (op.cancelled.load(std::memory_order_acquire)) | |
| 45 | 818x | *op.ec_out = capy::error::canceled; | ||
| 46 |
10/16✓ Branch 0 taken 1 time.
✓ Branch 1 taken 189258 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 204305 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 5 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✓ Branch 11 taken 8 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 3 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 5 times.
|
393592x | else if (op.errn != 0) | |
| 47 | 5x | *op.ec_out = make_err(op.errn); | ||
| 48 |
16/32✓ Branch 0 taken 115196 times.
✓ Branch 1 taken 74062 times.
✓ Branch 2 taken 115196 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 118318 times.
✓ Branch 5 taken 85987 times.
✓ Branch 6 taken 118312 times.
✓ Branch 7 taken 6 times.
✓ Branch 8 taken 1 time.
✓ Branch 9 taken 2 times.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 5 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 8 times.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 time.
✓ Branch 25 taken 2 times.
✓ Branch 26 taken 1 time.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✓ Branch 29 taken 5 times.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
|
393587x | else if (op.is_read_operation() && op.bytes_transferred == 0) | |
| 49 | 6x | *op.ec_out = capy::error::eof; | ||
| 50 | else | |||
| 51 | 393581x | *op.ec_out = {}; | ||
| 52 | ||||
| 53 | 394410x | *op.bytes_out = op.bytes_transferred; | ||
| 54 | ||||
| 55 | 394410x | op.cont_op.cont.h = op.h; | ||
| 56 | 394410x | capy::executor_ref saved_ex(op.ex); | ||
| 57 | 394410x | auto prevent = std::move(op.impl_ptr); | ||
| 58 |
14/32✓ Branch 0 taken 189323 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 189323 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 205061 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 205061 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 5 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 10 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 10 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 3 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 3 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 5 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 5 times.
✗ Branch 31 not taken.
|
394410x | dispatch_coro(saved_ex, op.cont_op.cont).resume(); | |
| 59 | 394410x | } | ||
| 60 | ||||
| 61 | /** Complete a datagram recv operation (connected mode). | |||
| 62 | ||||
| 63 | Like complete_io_op but does not translate zero bytes into | |||
| 64 | EOF. Zero-length datagrams are valid and should be reported | |||
| 65 | as success with 0 bytes transferred. | |||
| 66 | ||||
| 67 | @param op The operation to complete. | |||
| 68 | */ | |||
| 69 | template<typename Op> | |||
| 70 | void | |||
| 71 | complete_dgram_recv_op(Op& op) | |||
| 72 | { | |||
| 73 | op.stop_cb.reset(); | |||
| 74 | op.socket_impl_->desc_state_.scheduler_->reset_inline_budget(); | |||
| 75 | ||||
| 76 | if (op.cancelled.load(std::memory_order_acquire)) | |||
| 77 | *op.ec_out = capy::error::canceled; | |||
| 78 | else if (op.errn != 0) | |||
| 79 | *op.ec_out = make_err(op.errn); | |||
| 80 | else | |||
| 81 | *op.ec_out = {}; | |||
| 82 | ||||
| 83 | *op.bytes_out = op.bytes_transferred; | |||
| 84 | ||||
| 85 | op.cont_op.cont.h = op.h; | |||
| 86 | capy::executor_ref saved_ex(op.ex); | |||
| 87 | auto prevent = std::move(op.impl_ptr); | |||
| 88 | dispatch_coro(saved_ex, op.cont_op.cont).resume(); | |||
| 89 | } | |||
| 90 | ||||
| 91 | /** Complete a connect operation with endpoint caching. | |||
| 92 | ||||
| 93 | On success, queries the local endpoint via getsockname and | |||
| 94 | caches both endpoints in the socket impl. Then resumes the | |||
| 95 | caller via symmetric transfer. | |||
| 96 | ||||
| 97 | @tparam Op The concrete connect operation type. | |||
| 98 | @param op The operation to complete. | |||
| 99 | */ | |||
| 100 | template<typename Op> | |||
| 101 | void | |||
| 102 | 7262x | complete_connect_op(Op& op) | ||
| 103 | { | |||
| 104 | 7262x | op.stop_cb.reset(); | ||
| 105 | 7262x | op.socket_impl_->desc_state_.scheduler_->reset_inline_budget(); | ||
| 106 | ||||
| 107 | 7262x | bool success = | ||
| 108 |
7/16✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1826 times.
✓ Branch 2 taken 7 times.
✓ Branch 3 taken 5412 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
7262x | (op.errn == 0 && !op.cancelled.load(std::memory_order_acquire)); | |
| 109 | ||||
| 110 |
12/32✓ Branch 0 taken 1825 times.
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1825 times.
✓ Branch 4 taken 5411 times.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 5411 times.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 5 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 5 times.
✓ Branch 24 taken 2 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 2 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
|
7262x | if (success && op.socket_impl_) | |
| 111 | { | |||
| 112 | using ep_type = decltype(op.target_endpoint); | |||
| 113 | 7245x | ep_type local_ep; | ||
| 114 | 7245x | sockaddr_storage local_storage{}; | ||
| 115 | 7245x | socklen_t local_len = sizeof(local_storage); | ||
| 116 |
10/32✗ Branch 0 not taken.
✓ Branch 1 taken 1825 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1825 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 5411 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 5411 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 5 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 5 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 2 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 2 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
|
14490x | if (::getsockname( | |
| 117 | 7245x | op.fd, reinterpret_cast<sockaddr*>(&local_storage), | ||
| 118 | 7245x | &local_len) == 0) | ||
| 119 | 7245x | local_ep = | ||
| 120 | 7245x | from_sockaddr_as(local_storage, local_len, ep_type{}); | ||
| 121 | 7245x | op.socket_impl_->set_endpoints(local_ep, op.target_endpoint); | ||
| 122 | 7245x | } | ||
| 123 | ||||
| 124 |
7/16✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1833 times.
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 5418 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
7262x | if (op.cancelled.load(std::memory_order_acquire)) | |
| 125 | 2x | *op.ec_out = capy::error::canceled; | ||
| 126 |
7/16✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1825 times.
✓ Branch 2 taken 7 times.
✓ Branch 3 taken 5411 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
7260x | else if (op.errn != 0) | |
| 127 | 15x | *op.ec_out = make_err(op.errn); | ||
| 128 | else | |||
| 129 | 7245x | *op.ec_out = {}; | ||
| 130 | ||||
| 131 | 7262x | op.cont_op.cont.h = op.h; | ||
| 132 | 7262x | capy::executor_ref saved_ex(op.ex); | ||
| 133 | 7262x | auto prevent = std::move(op.impl_ptr); | ||
| 134 |
10/32✓ Branch 0 taken 1834 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1834 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5419 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 5419 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 5 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 5 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 2 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 2 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
|
7262x | dispatch_coro(saved_ex, op.cont_op.cont).resume(); | |
| 135 | 7262x | } | ||
| 136 | ||||
| 137 | /** Construct and register a peer socket from an accepted fd. | |||
| 138 | ||||
| 139 | Creates a new socket impl via the acceptor's associated | |||
| 140 | socket service, registers it with the scheduler, and caches | |||
| 141 | the local and remote endpoints. | |||
| 142 | ||||
| 143 | @tparam SocketImpl The concrete socket implementation type. | |||
| 144 | @tparam AcceptorImpl The concrete acceptor implementation type. | |||
| 145 | @param acceptor_impl The acceptor that accepted the connection. | |||
| 146 | @param accepted_fd The accepted file descriptor (set to -1 on success). | |||
| 147 | @param peer_storage The peer address from accept(). | |||
| 148 | @param impl_out Output pointer for the new socket impl. | |||
| 149 | @param ec_out Output pointer for any error. | |||
| 150 | @return True on success, false on failure. | |||
| 151 | */ | |||
| 152 | template<typename SocketImpl, typename AcceptorImpl> | |||
| 153 | bool | |||
| 154 | 7235x | setup_accepted_socket( | ||
| 155 | AcceptorImpl* acceptor_impl, | |||
| 156 | int& accepted_fd, | |||
| 157 | sockaddr_storage const& peer_storage, | |||
| 158 | socklen_t peer_addrlen, | |||
| 159 | io_object::implementation** impl_out, | |||
| 160 | std::error_code* ec_out) | |||
| 161 | { | |||
| 162 | 7235x | auto* socket_svc = acceptor_impl->service().stream_service(); | ||
| 163 |
4/8✓ Branch 0 taken 1825 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5406 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
7235x | if (!socket_svc) | |
| 164 | { | |||
| 165 | ✗ | *ec_out = make_err(ENOENT); | ||
| 166 | ✗ | return false; | ||
| 167 | } | |||
| 168 | ||||
| 169 | 7235x | auto& impl = static_cast<SocketImpl&>(*socket_svc->construct()); | ||
| 170 | 7235x | impl.set_socket(accepted_fd); | ||
| 171 | ||||
| 172 | 7235x | impl.desc_state_.fd = accepted_fd; | ||
| 173 | { | |||
| 174 | 7235x | std::lock_guard lock(impl.desc_state_.mutex); | ||
| 175 | 7235x | impl.desc_state_.read_op = nullptr; | ||
| 176 | 7235x | impl.desc_state_.write_op = nullptr; | ||
| 177 | 7235x | impl.desc_state_.connect_op = nullptr; | ||
| 178 | 7235x | } | ||
| 179 | 7235x | socket_svc->scheduler().register_descriptor(accepted_fd, &impl.desc_state_); | ||
| 180 | ||||
| 181 | using ep_type = decltype(acceptor_impl->local_endpoint()); | |||
| 182 | 14470x | impl.set_endpoints( | ||
| 183 | 7235x | acceptor_impl->local_endpoint(), | ||
| 184 | 7235x | from_sockaddr_as( | ||
| 185 | 7235x | peer_storage, | ||
| 186 | 7235x | peer_addrlen, | ||
| 187 | 7235x | ep_type{})); | ||
| 188 | ||||
| 189 |
4/8✗ Branch 0 not taken.
✓ Branch 1 taken 1825 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 5406 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
|
7235x | if (impl_out) | |
| 190 | 7235x | *impl_out = &impl; | ||
| 191 | 7235x | accepted_fd = -1; | ||
| 192 | 7235x | return true; | ||
| 193 | 7235x | } | ||
| 194 | ||||
| 195 | /** Complete an accept operation. | |||
| 196 | ||||
| 197 | Sets up the peer socket on success, or closes the accepted | |||
| 198 | fd on failure. Then resumes the caller via symmetric transfer. | |||
| 199 | ||||
| 200 | @tparam SocketImpl The concrete socket implementation type. | |||
| 201 | @tparam Op The concrete accept operation type. | |||
| 202 | @param op The operation to complete. | |||
| 203 | */ | |||
| 204 | template<typename SocketImpl, typename Op> | |||
| 205 | void | |||
| 206 | 7247x | complete_accept_op(Op& op) | ||
| 207 | { | |||
| 208 | 7247x | op.stop_cb.reset(); | ||
| 209 | 7247x | op.acceptor_impl_->desc_state_.scheduler_->reset_inline_budget(); | ||
| 210 | ||||
| 211 | 7247x | bool success = | ||
| 212 |
4/8✗ Branch 0 not taken.
✓ Branch 1 taken 1828 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 5415 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
|
7247x | (op.errn == 0 && !op.cancelled.load(std::memory_order_acquire)); | |
| 213 | ||||
| 214 |
6/8✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1825 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 9 times.
✓ Branch 5 taken 5406 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
|
7247x | if (op.cancelled.load(std::memory_order_acquire)) | |
| 215 | 12x | *op.ec_out = capy::error::canceled; | ||
| 216 |
4/8✗ Branch 0 not taken.
✓ Branch 1 taken 1825 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 5406 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
|
7235x | else if (op.errn != 0) | |
| 217 | ✗ | *op.ec_out = make_err(op.errn); | ||
| 218 | else | |||
| 219 | 7235x | *op.ec_out = {}; | ||
| 220 | ||||
| 221 |
14/24✓ Branch 0 taken 1825 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 1825 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1825 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 5406 times.
✓ Branch 13 taken 9 times.
✓ Branch 14 taken 5406 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 17 taken 5406 times.
✓ Branch 18 taken 2 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 2 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 2 times.
|
7247x | if (success && op.accepted_fd >= 0 && op.acceptor_impl_) | |
| 222 | { | |||
| 223 |
4/8✓ Branch 0 taken 1825 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5406 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
7235x | if (!setup_accepted_socket<SocketImpl>( | |
| 224 | 7235x | op.acceptor_impl_, op.accepted_fd, op.peer_storage, | ||
| 225 | 7235x | op.peer_addrlen, op.impl_out, op.ec_out)) | ||
| 226 | ✗ | success = false; | ||
| 227 | 7235x | } | ||
| 228 | ||||
| 229 |
10/16✓ Branch 0 taken 1825 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 1825 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 5406 times.
✓ Branch 9 taken 9 times.
✓ Branch 10 taken 5406 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
|
7247x | if (!success || !op.acceptor_impl_) | |
| 230 | { | |||
| 231 |
2/8✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
|
12x | if (op.accepted_fd >= 0) | |
| 232 | { | |||
| 233 | ✗ | ::close(op.accepted_fd); | ||
| 234 | ✗ | op.accepted_fd = -1; | ||
| 235 | ✗ | } | ||
| 236 |
2/8✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 9 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
|
12x | if (op.impl_out) | |
| 237 | 12x | *op.impl_out = nullptr; | ||
| 238 | 12x | } | ||
| 239 | ||||
| 240 | 7247x | op.cont_op.cont.h = op.h; | ||
| 241 | 7247x | capy::executor_ref saved_ex(op.ex); | ||
| 242 | 7247x | auto prevent = std::move(op.impl_ptr); | ||
| 243 |
8/16✓ Branch 0 taken 1828 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1828 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 5415 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 5415 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
|
7247x | dispatch_coro(saved_ex, op.cont_op.cont).resume(); | |
| 244 | 7247x | } | ||
| 245 | ||||
| 246 | /** Complete a datagram operation (send_to or recv_from). | |||
| 247 | ||||
| 248 | For recv_from operations, writes the source endpoint from the | |||
| 249 | recorded sockaddr_storage into the caller's endpoint pointer. | |||
| 250 | Then resumes the caller via symmetric transfer. | |||
| 251 | ||||
| 252 | @tparam Op The concrete datagram operation type. | |||
| 253 | @param op The operation to complete. | |||
| 254 | */ | |||
| 255 | template<typename Op> | |||
| 256 | void | |||
| 257 | 6x | complete_datagram_op(Op& op) | ||
| 258 | { | |||
| 259 | 6x | op.stop_cb.reset(); | ||
| 260 | 6x | op.socket_impl_->desc_state_.scheduler_->reset_inline_budget(); | ||
| 261 | ||||
| 262 |
6/8✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
6x | if (op.cancelled.load(std::memory_order_acquire)) | |
| 263 | 2x | *op.ec_out = capy::error::canceled; | ||
| 264 |
4/8✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
4x | else if (op.errn != 0) | |
| 265 | ✗ | *op.ec_out = make_err(op.errn); | ||
| 266 | else | |||
| 267 | 4x | *op.ec_out = {}; | ||
| 268 | ||||
| 269 | 6x | *op.bytes_out = op.bytes_transferred; | ||
| 270 | ||||
| 271 | 6x | op.cont_op.cont.h = op.h; | ||
| 272 | 6x | capy::executor_ref saved_ex(op.ex); | ||
| 273 | 6x | auto prevent = std::move(op.impl_ptr); | ||
| 274 |
8/16✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 time.
✗ Branch 15 not taken.
|
6x | dispatch_coro(saved_ex, op.cont_op.cont).resume(); | |
| 275 | 6x | } | ||
| 276 | ||||
| 277 | /** Complete a datagram operation with source endpoint capture. | |||
| 278 | ||||
| 279 | For recv_from operations, writes the source endpoint from the | |||
| 280 | recorded sockaddr_storage into the caller's endpoint pointer. | |||
| 281 | Then resumes the caller via symmetric transfer. | |||
| 282 | ||||
| 283 | @tparam Op The concrete datagram operation type. | |||
| 284 | @param op The operation to complete. | |||
| 285 | @param source_out Optional pointer to store source endpoint | |||
| 286 | (non-null for recv_from, null for send_to). | |||
| 287 | */ | |||
| 288 | template<typename Op, typename Endpoint> | |||
| 289 | void | |||
| 290 | 29x | complete_datagram_op(Op& op, Endpoint* source_out) | ||
| 291 | { | |||
| 292 | 29x | op.stop_cb.reset(); | ||
| 293 | 29x | op.socket_impl_->desc_state_.scheduler_->reset_inline_budget(); | ||
| 294 | ||||
| 295 |
6/8✓ Branch 0 taken 5 times.
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 5 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
29x | if (op.cancelled.load(std::memory_order_acquire)) | |
| 296 | 10x | *op.ec_out = capy::error::canceled; | ||
| 297 |
4/8✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
✓ Branch 5 taken 5 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
19x | else if (op.errn != 0) | |
| 298 | ✗ | *op.ec_out = make_err(op.errn); | ||
| 299 | else | |||
| 300 | 19x | *op.ec_out = {}; | ||
| 301 | ||||
| 302 | 29x | *op.bytes_out = op.bytes_transferred; | ||
| 303 | ||||
| 304 |
16/24✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 11 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 11 times.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✓ Branch 12 taken 9 times.
✓ Branch 13 taken 1 time.
✓ Branch 14 taken 4 times.
✓ Branch 15 taken 5 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 4 times.
✓ Branch 18 taken 1 time.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 time.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 time.
|
29x | if (source_out && !op.cancelled.load(std::memory_order_acquire) && | |
| 305 | 17x | op.errn == 0) | ||
| 306 | 17x | *source_out = from_sockaddr_as( | ||
| 307 | 17x | op.source_storage, | ||
| 308 | 17x | op.source_addrlen, | ||
| 309 | 17x | Endpoint{}); | ||
| 310 | ||||
| 311 | 29x | op.cont_op.cont.h = op.h; | ||
| 312 | 29x | capy::executor_ref saved_ex(op.ex); | ||
| 313 | 29x | auto prevent = std::move(op.impl_ptr); | ||
| 314 |
8/16✓ Branch 0 taken 17 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 8 taken 10 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 10 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 time.
✗ Branch 15 not taken.
|
29x | dispatch_coro(saved_ex, op.cont_op.cont).resume(); | |
| 315 | 29x | } | ||
| 316 | ||||
| 317 | } // namespace boost::corosio::detail | |||
| 318 | ||||
| 319 | #endif // BOOST_COROSIO_NATIVE_DETAIL_REACTOR_REACTOR_OP_COMPLETE_HPP | |||
| 320 |