GCC Code Coverage Report


Directory: libs/http_proto/
File: src/file_sink.cpp
Date: 2025-09-21 18:08:15
Exec Total Coverage
Lines: 11 12 91.7%
Functions: 3 4 75.0%
Branches: 5 6 83.3%

Line Branch Exec Source
1 //
2 // Copyright (c) 2022 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/file_sink.hpp>
12
13 namespace boost {
14 namespace http_proto {
15
16 2 file_sink::
17 2 file_sink(file&& f) noexcept
18 2 : f_(std::move(f))
19 {
20 2 }
21
22 file_sink::
23 file_sink(file_sink&&) noexcept = default;
24
25 2 file_sink::
26 ~file_sink() = default;
27
28 auto
29 5 file_sink::
30 on_write(
31 buffers::const_buffer b,
32 bool more) -> results
33 {
34 5 results rv;
35 5 rv.bytes = f_.write(
36 b.data(), b.size(), rv.ec);
37
5/6
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 4 times.
5 if(!more && !rv.ec)
38 1 f_.close(rv.ec);
39 5 return rv;
40 }
41
42 } // http_proto
43 } // boost
44