File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010#ifndef BOOST_HTTP_PROTO_IMPL_SINK_HPP
1111#define BOOST_HTTP_PROTO_IMPL_SINK_HPP
1212
13- #include < boost/buffers/mutable_buffer .hpp>
13+ #include < boost/buffers/buffer .hpp>
1414#include < boost/buffers/range.hpp>
1515#include < boost/http_proto/detail/except.hpp>
1616#include < boost/assert.hpp>
@@ -58,11 +58,10 @@ write_impl(
5858 while (
5959 p != tmp_end &&
6060 it != end_);
61- rv += on_write (
62- buffers::const_buffer_span (
61+ rv += on_write (boost::span<
62+ buffers::const_buffer const > (
6363 tmp, p - tmp),
64- it != end_ ||
65- more);
64+ it != end_ || more);
6665 if (rv.ec .failed ())
6766 return rv;
6867 }
Original file line number Diff line number Diff line change 1111#define BOOST_BUFFERS_IMPL_SOURCE_HPP
1212
1313#include < boost/http_proto/detail/except.hpp>
14- #include < boost/buffers/range.hpp>
15- #include < boost/buffers/type_traits.hpp>
1614#include < boost/assert.hpp>
1715
1816namespace boost {
@@ -60,8 +58,8 @@ read_impl(
6058 while (
6159 p != tmp_end &&
6260 it != end_);
63- rv += on_read (
64- buffers::mutable_buffer_span (
61+ rv += on_read (boost::span<
62+ buffers::mutable_buffer const > (
6563 tmp, p - tmp));
6664 if (rv.ec .failed ())
6765 return rv;
Original file line number Diff line number Diff line change 1818#include < boost/http_proto/header_limits.hpp>
1919#include < boost/http_proto/sink.hpp>
2020
21- #include < boost/buffers/any_dynamic_buffer.hpp>
22- #include < boost/buffers/mutable_buffer_pair.hpp>
23- #include < boost/buffers/mutable_buffer_span.hpp>
24- #include < boost/buffers/type_traits.hpp>
21+ #include < boost/buffers/dynamic_buffer.hpp>
22+ #include < boost/buffers/buffer_pair.hpp>
23+ #include < boost/core/span.hpp>
2524#include < boost/rts/context_fwd.hpp>
2625
2726#include < cstddef>
@@ -77,12 +76,12 @@ class parser
7776 /* * The type of buffer returned from @ref prepare.
7877 */
7978 using mutable_buffers_type =
80- buffers::mutable_buffer_span ;
79+ boost::span< buffers::mutable_buffer const > ;
8180
8281 /* * The type of buffer returned from @ref pull_body.
8382 */
8483 using const_buffers_type =
85- buffers::const_buffer_span ;
84+ boost::span< buffers::const_buffer const > ;
8685
8786 // --------------------------------------------
8887 //
Original file line number Diff line number Diff line change 1515#include < boost/http_proto/detail/workspace.hpp>
1616#include < boost/http_proto/source.hpp>
1717
18- #include < boost/buffers/const_buffer_span.hpp>
19- #include < boost/buffers/mutable_buffer_pair.hpp>
20- #include < boost/buffers/type_traits.hpp>
18+ #include < boost/buffers/buffer_pair.hpp>
19+ #include < boost/core/span.hpp>
2120#include < boost/rts/context_fwd.hpp>
2221#include < boost/system/result.hpp>
2322
@@ -65,7 +64,7 @@ class serializer
6564 area.
6665 */
6766 using const_buffers_type =
68- buffers::const_buffer_span ;
67+ boost::span< buffers::const_buffer const > ;
6968
7069 /* * Constructor.
7170
Original file line number Diff line number Diff line change 1111#define BOOST_HTTP_PROTO_SINK_HPP
1212
1313#include < boost/http_proto/detail/config.hpp>
14- #include < boost/buffers/const_buffer_span .hpp>
15- #include < boost/buffers/type_traits .hpp>
14+ #include < boost/buffers/buffer .hpp>
15+ #include < boost/core/span .hpp>
1616#include < boost/system/error_code.hpp>
1717#include < cstddef>
1818#include < type_traits>
@@ -192,7 +192,7 @@ struct BOOST_SYMBOL_VISIBLE
192192 virtual
193193 results
194194 on_write (
195- buffers::const_buffer_span bs,
195+ boost::span< const buffers::const_buffer> bs,
196196 bool more);
197197
198198private:
@@ -214,7 +214,7 @@ struct BOOST_SYMBOL_VISIBLE
214214
215215 results
216216 write_impl (
217- buffers::const_buffer_span const & bs,
217+ boost::span< const buffers::const_buffer> const & bs,
218218 bool more)
219219 {
220220 return on_write (bs, more);
Original file line number Diff line number Diff line change 1111#define BOOST_HTTP_PROTO_SOURCE_HPP
1212
1313#include < boost/http_proto/detail/config.hpp>
14- #include < boost/buffers/mutable_buffer_span .hpp>
15- #include < boost/buffers/type_traits .hpp>
14+ #include < boost/buffers/buffer .hpp>
15+ #include < boost/core/span .hpp>
1616#include < boost/system/error_code.hpp>
1717#include < cstddef>
1818#include < type_traits>
@@ -195,7 +195,7 @@ struct BOOST_SYMBOL_VISIBLE
195195 virtual
196196 results
197197 on_read (
198- buffers::mutable_buffer_span bs);
198+ boost::span< buffers::mutable_buffer const > bs);
199199
200200private:
201201 results
@@ -207,7 +207,7 @@ struct BOOST_SYMBOL_VISIBLE
207207
208208 results
209209 read_impl (
210- buffers::mutable_buffer_span const & bs)
210+ boost::span< buffers::mutable_buffer const > const & bs)
211211 {
212212 return on_read (bs);
213213 }
Original file line number Diff line number Diff line change 1111#define BOOST_HTTP_PROTO_STRING_BODY_HPP
1212
1313#include < boost/http_proto/detail/config.hpp>
14- #include < boost/buffers/const_buffer .hpp>
14+ #include < boost/buffers/buffer .hpp>
1515#include < string>
1616#include < utility>
1717
Original file line number Diff line number Diff line change 1212
1313#include < boost/http_proto/detail/except.hpp>
1414
15- #include < boost/buffers/sans_prefix .hpp>
15+ #include < boost/buffers/slice .hpp>
1616
1717namespace boost {
1818namespace http_proto {
@@ -38,7 +38,7 @@ consume(std::size_t n)
3838 auto * p = base_ + pos_;
3939 if (n < p->size ())
4040 {
41- *p = buffers::sans_prefix (*p, n);
41+ buffers::trim_front (*p, n);
4242 return ;
4343 }
4444 n -= p->size ();
Original file line number Diff line number Diff line change 1111#ifndef BOOST_HTTP_PROTO_DETAIL_ARRAY_OF_BUFFERS_HPP
1212#define BOOST_HTTP_PROTO_DETAIL_ARRAY_OF_BUFFERS_HPP
1313
14- #include < boost/buffers/const_buffer.hpp>
14+ #include < boost/assert.hpp>
15+ #include < boost/buffers/buffer.hpp>
1516
1617#include < cstdint>
1718
Original file line number Diff line number Diff line change 1+ //
2+ // Copyright (c) 2025 Mohammad Nejati
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+ #ifndef BOOST_HTTP_PROTO_DETAIL_BUFFER_UTILS_HPP
11+ #define BOOST_HTTP_PROTO_DETAIL_BUFFER_UTILS_HPP
12+
13+ #include < boost/buffers/buffer.hpp>
14+ #include < boost/buffers/slice.hpp>
15+ #include < boost/core/span.hpp>
16+
17+ namespace boost {
18+ namespace http_proto {
19+ namespace detail {
20+
21+ template <
22+ typename BufferSequence,
23+ typename Buffer = typename BufferSequence::value_type>
24+ boost::span<Buffer const >
25+ make_span (BufferSequence const & mbp)
26+ {
27+ return { mbp.begin (), mbp.end () };
28+ }
29+
30+ template <typename BufferSequence>
31+ BufferSequence
32+ prefix (
33+ BufferSequence cbp,
34+ std::size_t n)
35+ {
36+ buffers::keep_front (cbp, n);
37+ return cbp;
38+ }
39+
40+ } // detail
41+ } // http_proto
42+ } // boost
43+
44+ #endif
You can’t perform that action at this time.
0 commit comments