src/detail/can_reuse_conn.cpp

100.0% Lines (10/10) 100.0% List of functions (1/1) 100.0% Branches (8/8)
can_reuse_conn.cpp
f(x) Functions (1)
Line Branch TLA Hits Source Code
1 //
2 // Copyright (c) 2026 Mohammad Nejati
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/burl
8 //
9
10 #include "can_reuse_conn.hpp"
11
12 namespace boost
13 {
14 namespace burl
15 {
16 namespace detail
17 {
18
19 bool
20 110x can_reuse_conn(response_parser& parser) noexcept
21 {
22
2/2
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 109 times.
110x if(!parser.got_header())
23 1x return false;
24
25
2/2
✓ Branch 2 taken 12 times.
✓ Branch 3 taken 97 times.
109x if(!parser.get().keep_alive())
26 12x return false;
27
28
2/2
✓ Branch 1 taken 30 times.
✓ Branch 2 taken 67 times.
97x if(!parser.got_body())
29 30x return false;
30
31
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 63 times.
67x if(parser.has_buffered_data())
32 4x return false;
33
34 63x return true;
35 }
36
37 } // namespace detail
38 } // namespace burl
39 } // namespace boost
40