GCC Code Coverage Report


Directory: libs/http_proto/
File: src/source.cpp
Date: 2025-09-29 20:51:02
Exec Total Coverage
Lines: 15 17 88.2%
Functions: 1 1 100.0%
Branches: 9 12 75.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com)
3 // Copyright (c) 2025 Mohammad Nejati
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // Official repository: https://github.com/cppalliance/http_proto
9 //
10
11 #include <boost/http_proto/source.hpp>
12
13 namespace boost {
14 namespace http_proto {
15
16 auto
17 987 source::
18 on_read(
19 bool,
20 boost::span<buffers::mutable_buffer const> bs) ->
21 results
22 {
23 987 results rv;
24 987 auto it = bs.begin();
25 987 auto const end_ = bs.end();
26
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 987 times.
987 if(it == end_)
27 return rv;
28 do
29 {
30 1952 buffers::mutable_buffer b(*it++);
31
1/2
✓ Branch 1 taken 1952 times.
✗ Branch 2 not taken.
1952 auto rs = on_read(b);
32 1952 rv += rs;
33
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1948 times.
1952 if(rs.ec.failed())
34 4 return rv;
35
2/2
✓ Branch 0 taken 23 times.
✓ Branch 1 taken 1925 times.
1948 if(rs.finished)
36 23 break;
37 // source must fill the entire buffer
38 // if it is not finished
39
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1925 times.
1925 if(b.size() != rs.bytes)
40 detail::throw_logic_error();
41 }
42
2/2
✓ Branch 0 taken 965 times.
✓ Branch 1 taken 960 times.
1925 while(it != end_);
43 983 return rv;
44 }
45
46 } // http_proto
47 } // boost
48