GCC Code Coverage Report


Directory: ./
File: libs/http_proto/src/sink.cpp
Date: 2025-12-25 12:14:37
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 1 1 100.0%
Branches: 12 13 92.3%

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/http_proto
8 //
9
10 #include <boost/http_proto/sink.hpp>
11
12 namespace boost {
13 namespace http_proto {
14
15 auto
16 18441 sink::
17 on_write(
18 boost::span<buffers::const_buffer const> bs,
19 bool more) ->
20 results
21 {
22 18441 auto it = bs.begin();
23 18441 auto const end_ = bs.end();
24 18441 results rv;
25
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 18440 times.
18441 if(it == end_)
26 1 return rv;
27 do
28 {
29 36881 buffers::const_buffer b(*it++);
30
2/2
✓ Branch 1 taken 18682 times.
✓ Branch 2 taken 18199 times.
36881 if(b.size() == 0)
31 18682 continue;
32
1/1
✓ Branch 1 taken 18199 times.
18199 rv += on_write(
33 b,
34
3/4
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 18197 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
36398 it != end_ || more);
35
2/2
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 18196 times.
18199 if(rv.ec.failed())
36 3 return rv;
37 }
38
2/2
✓ Branch 0 taken 18441 times.
✓ Branch 1 taken 18437 times.
36878 while(it != end_);
39 18437 return rv;
40 }
41
42 } // http_proto
43 } // boost
44