GCC Code Coverage Report


Directory: libs/http_proto/include/boost/http_proto/
File: boost/http_proto/impl/source.ipp
Date: 2023-12-23 23:40:21
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 1 1 100.0%
Branches: 8 10 80.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 #ifndef BOOST_HTTP_PROTO_IMPL_SOURCE_IPP
11 #define BOOST_HTTP_PROTO_IMPL_SOURCE_IPP
12
13 #include <boost/http_proto/source.hpp>
14 #include <boost/buffers/mutable_buffer.hpp>
15 #include <boost/assert.hpp>
16
17 namespace boost {
18 namespace http_proto {
19
20 auto
21 9 source::
22 on_read(
23 buffers::mutable_buffer_span bs) ->
24 results
25 {
26 9 results rv;
27 9 auto it = bs.begin();
28 9 auto const end_ = bs.end();
29
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 8 times.
9 if(it == end_)
30 1 return rv;
31 5 do
32 {
33 13 buffers::mutable_buffer b(*it++);
34
1/2
✓ Branch 1 taken 13 times.
✗ Branch 2 not taken.
13 rv += on_read(b);
35
2/2
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 10 times.
13 if(rv.ec.failed())
36 3 return rv;
37
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 5 times.
10 if(rv.finished)
38 5 break;
39 }
40
1/2
✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
5 while(it != end_);
41 5 return rv;
42 }
43
44 } // http_proto
45 } // boost
46
47 #endif
48