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 | 5 | sink:: | |
17 | on_write( | ||
18 | buffers::const_buffer_span bs, | ||
19 | bool more) -> | ||
20 | results | ||
21 | { | ||
22 | 5 | auto it = bs.begin(); | |
23 | 5 | auto const end_ = bs.end(); | |
24 | 5 | results rv; | |
25 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
|
5 | if(it == end_) |
26 | 1 | return rv; | |
27 | do | ||
28 | { | ||
29 | 9 | buffers::const_buffer b(*it++); | |
30 |
1/2✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
|
9 | rv += on_write(b, |
31 |
3/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
|
9 | it != end_ || |
32 | 9 | more); | |
33 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 6 times.
|
9 | if(rv.ec.failed()) |
34 | 3 | return rv; | |
35 | } | ||
36 |
2/2✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
|
6 | while(it != end_); |
37 | 1 | return rv; | |
38 | } | ||
39 | |||
40 | } // http_proto | ||
41 | } // boost | ||
42 |