11 #ifndef HTTP_SERVER4_REQUEST_PARSER_HPP 12 #define HTTP_SERVER4_REQUEST_PARSER_HPP 15 #include <boost/logic/tribool.hpp> 16 #include <boost/tuple/tuple.hpp> 32 template <
typename InputIterator>
34 InputIterator
begin, InputIterator
end)
38 boost::tribool result = consume(req, *begin++);
39 if (result || !result)
40 return boost::make_tuple(result, begin);
42 boost::tribool result = boost::indeterminate;
43 return boost::make_tuple(result, begin);
48 static std::string content_length_name_;
51 std::size_t content_length_;
54 boost::tribool consume(
request& req,
char input);
57 static bool is_char(
int c);
60 static bool is_ctl(
int c);
63 static bool is_tspecial(
int c);
66 static bool is_digit(
int c);
69 static bool tolower_compare(
char a,
char b);
72 bool headers_equal(
const std::string& a,
const std::string& b);
78 #endif // HTTP_SERVER4_REQUEST_PARSER_HPP SocketService Iterator begin
Provides support for implementing stackless coroutines.
boost::tuple< boost::tribool, InputIterator > parse(request &req, InputIterator begin, InputIterator end)
A request received from a client.
asio::basic_streambuf< Allocator > & b
Parser for incoming requests.
SocketService Iterator Iterator end