GCC Code Coverage Report


Directory: libs/http_proto/
File: libs/http_proto/src/source.cpp
Date: 2024-04-24 06:37:24
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 1 1 100.0%
Branches: 9 10 90.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com)
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/buffers
8 //
9
10 #include <boost/http_proto/source.hpp>
11 #include <boost/buffers/mutable_buffer.hpp>
12 #include <boost/assert.hpp>
13
14 namespace boost {
15 namespace http_proto {
16
17 auto
18 22 source::
19 on_read(
20 buffers::mutable_buffer_span bs) ->
21 results
22 {
23 22 results rv;
24 22 auto it = bs.begin();
25 22 auto const end_ = bs.end();
26
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 21 times.
22 if(it == end_)
27 1 return rv;
28 16 do
29 {
30 37 buffers::mutable_buffer b(*it++);
31
1/2
✓ Branch 1 taken 37 times.
✗ Branch 2 not taken.
37 rv += on_read(b);
32
2/2
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 34 times.
37 if(rv.ec.failed())
33 3 return rv;
34
2/2
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 27 times.
34 if(rv.finished)
35 7 break;
36 }
37
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 11 times.
27 while(it != end_);
38 18 return rv;
39 }
40
41 } // http_proto
42 } // boost
43