LCOV - code coverage report
Current view: top level - http_proto/impl - source.ipp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 15 15 100.0 %
Date: 2023-02-27 20:43:06 Functions: 1 1 100.0 %

          Line data    Source code
       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           9 :     if(it == end_)
      30           1 :         return rv;
      31           5 :     do
      32             :     {
      33          13 :         buffers::mutable_buffer b(*it++);
      34          13 :         rv += on_read(b);
      35          13 :         if(rv.ec.failed())
      36           3 :             return rv;
      37          10 :         if(rv.finished)
      38           5 :             break;
      39             :     }
      40           5 :     while(it != end_);
      41           5 :     return rv;
      42             : }
      43             : 
      44             : } // http_proto
      45             : } // boost
      46             : 
      47             : #endif

Generated by: LCOV version 1.15