Line data Source code
1 : //
2 : // Copyright (c) 2019 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 : #ifndef BOOST_HTTP_PROTO_REQUEST_PARSER_HPP
11 : #define BOOST_HTTP_PROTO_REQUEST_PARSER_HPP
12 :
13 : #include <boost/http_proto/detail/config.hpp>
14 : #include <boost/http_proto/error.hpp>
15 : #include <boost/http_proto/method.hpp>
16 : #include <boost/http_proto/parser.hpp>
17 : #include <boost/http_proto/request_view.hpp>
18 : #include <cstddef>
19 : #include <utility>
20 :
21 : namespace boost {
22 : namespace http_proto {
23 :
24 : class BOOST_SYMBOL_VISIBLE
25 : request_parser
26 : : public parser
27 : {
28 : public:
29 : /** Configuration settings for parsing requests
30 : */
31 : struct config : config_base
32 : {
33 : /** Constructor
34 : */
35 23 : config() noexcept
36 23 : {
37 23 : body_limit = 64 * 1024;
38 23 : }
39 : };
40 :
41 : /** Constructor
42 : */
43 : BOOST_HTTP_PROTO_DECL
44 : explicit
45 : request_parser(context&);
46 :
47 : /** Return a read-only view to the parsed request headers.
48 :
49 : The returned view becomes invalid after calling
50 : @ref start or @ref reset.
51 :
52 : @par Preconditions
53 : This function can be called only after the
54 : header is fully parsed.
55 :
56 : @return A read-only view to the parsed request headers.
57 : */
58 : BOOST_HTTP_PROTO_DECL
59 : request_view
60 : get() const;
61 : };
62 :
63 : } // http_proto
64 : } // boost
65 :
66 : #endif
|