| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | 5 | config() noexcept | |
| 36 | 5 | { | |
| 37 | 5 | body_limit = 64 * 1024; | |
| 38 | 5 | } | |
| 39 | }; | ||
| 40 | |||
| 41 | /** Constructor | ||
| 42 | */ | ||
| 43 | BOOST_HTTP_PROTO_DECL | ||
| 44 | explicit | ||
| 45 | request_parser(context&); | ||
| 46 | |||
| 47 | /** Prepare for the next message on the stream. | ||
| 48 | */ | ||
| 49 | void | ||
| 50 | 6118 | start() | |
| 51 | { | ||
| 52 | 6118 | start_impl(false); | |
| 53 | 6118 | } | |
| 54 | |||
| 55 | /** Return the parsed request headers. | ||
| 56 | */ | ||
| 57 | BOOST_HTTP_PROTO_DECL | ||
| 58 | request_view | ||
| 59 | get() const; | ||
| 60 | }; | ||
| 61 | |||
| 62 | } // http_proto | ||
| 63 | } // boost | ||
| 64 | |||
| 65 | #endif | ||
| 66 |