1111#define BOOST_BURL_DETAIL_PARSER_HPP
1212
1313#include < boost/burl/error.hpp>
14+ #include < boost/burl/head_parser.hpp>
1415#include < boost/burl/detail/circular_buffer.hpp>
1516
1617#include < boost/capy/buffers/buffer_copy.hpp>
1920#include < boost/capy/io_task.hpp>
2021#include < boost/capy/read.hpp>
2122#include < boost/http/concept/buffer_source.hpp>
22- #include < boost/http/message_base.hpp>
23- #include < boost/http/header_limits.hpp>
24- #include < boost/http/static_response.hpp>
25- #include < boost/http/static_request.hpp>
23+ #include < boost/http/metadata.hpp>
2624
2725#include < memory>
2826
@@ -56,7 +54,7 @@ class parser
5654
5755 struct config
5856 {
59- http:: header_limits hdr_limits;
57+ header_limits hdr_limits;
6058
6159 std::size_t in_buffer = 64 * 1024 ;
6260 std::size_t dec_buffer = 8 * 1024 ;
@@ -106,7 +104,7 @@ class parser
106104
107105 parser (
108106 config const & cfg,
109- http::detail::kind kind ,
107+ bool is_request ,
110108 capy::any_read_stream stream = {});
111109
112110 parser (parser&& other) noexcept = default;
@@ -124,10 +122,10 @@ class parser
124122 void
125123 start (bool head);
126124
127- http::static_response const &
125+ burl::response_head_base const &
128126 get_response () const ;
129127
130- http::static_request const &
128+ burl::request_head_base const &
131129 get_request () const ;
132130
133131private:
@@ -145,9 +143,6 @@ class parser
145143 std::size_t
146144 payload_rem () const noexcept ;
147145
148- std::size_t
149- table_reserve () const noexcept ;
150-
151146 capy::io_task<>
152147 refill ();
153148
@@ -165,31 +160,20 @@ class parser
165160 do_read_some (
166161 std::span<capy::mutable_buffer const > buffers);
167162
168- struct header_deleter
169- {
170- void
171- operator ()(
172- http::detail::header* h) const noexcept
173- {
174- ::operator delete (h);
175- }
176- };
177-
178- using header_ptr = std::unique_ptr<
179- http::detail::header, header_deleter>;
180-
181- http::header_limits hdr_limits_;
182163 capy::any_read_stream stream_;
183- header_ptr h_;
164+ std::unique_ptr<char []> buf_;
165+ head_parser hp_;
184166 decoder * dec_ = nullptr ;
185167 circular_buffer in_;
186168 circular_buffer out_;
187169 std::uint64_t chunk_rem_ = 0 ;
188170 std::uint64_t transferred_ = 0 ;
189171 std::uint64_t decoded_ = 0 ;
190172 std::uint64_t body_limit_ = 0 ;
173+ std::uint64_t payload_size_ = 0 ;
191174 std::error_code dec_err_;
192175 http::payload payload_ = http::payload::none;
176+ bool is_req_ = true ;
193177 bool head_ = false ;
194178 bool started_ = false ;
195179 bool got_header_ = false ;
0 commit comments