Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99c777c

Browse files
committed
Removed some headers that looked redundant.
1 parent5f6ab56 commit99c777c

File tree

3 files changed

+55
-130
lines changed

3 files changed

+55
-130
lines changed

‎boost/network/protocol/http/server/impl/parsers.ipp

Lines changed: 0 additions & 75 deletions
This file was deleted.

‎boost/network/protocol/http/server/request.hpp

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
1+
// Copyright 2013 Google, Inc.
12
// Copyright 2010 Dean Michael Berris.
23
// Distributed under the Boost Software License, Version 1.0.
34
// (See accompanying file LICENSE_1_0.txt or copy at
45
// http://www.boost.org/LICENSE_1_0.txt)
56

6-
#ifdef BOOST_NETWORK_NO_LIB
7-
#undef BOOST_NETWORK_NO_LIB
8-
#endif
7+
#include<tuple>
8+
#include<vector>
9+
#defineBOOST_SPIRIT_UNICODE
10+
#include<boost/spirit/include/qi.hpp>
11+
#include<boost/fusion/include/std_tuple.hpp>
12+
#include<boost/network/protocol/http/message/header.hpp>
913

10-
#include<boost/network/protocol/http/server/impl/parsers.ipp>
14+
namespaceboost {
15+
namespacespirit {
16+
namespacetraits {
17+
18+
typedef std::basic_string<uint32_t> u32_string;
19+
20+
template<>// <typename Attrib, typename T, typename Enable>
21+
structassign_to_container_from_value<std::string, u32_string,void> {
22+
staticvoidcall(u32_stringconst& val, std::string& attr) {
23+
u32_to_u8_iterator<u32_string::const_iterator> begin = val.begin(),
24+
end = val.end();
25+
for (; begin != end; ++begin) attr += *begin;
26+
}
27+
};
28+
29+
}// namespace traits
30+
}// namespace spirit
31+
}// namespace boost
32+
33+
namespaceboost {
34+
namespacenetwork {
35+
namespacehttp {
36+
37+
voidparse_version(
38+
std::stringconst& partial_parsed,
39+
std::tuple<std::uint8_t, std::uint8_t>& version_pair) {
40+
usingnamespaceboost::spirit::qi;
41+
parse(partial_parsed.begin(), partial_parsed.end(),
42+
(lit("HTTP/") >> ushort_ >>'.' >> ushort_), version_pair);
43+
}
44+
45+
voidparse_headers(
46+
std::stringconst& input, std::vector<request_header_narrow>& container) {
47+
usingnamespaceboost::spirit::qi;
48+
u8_to_u32_iterator<std::string::const_iterator> begin = input.begin(),
49+
end = input.end();
50+
typedef as<boost::spirit::traits::u32_string> as_u32_string;
51+
parse(begin, end,
52+
*(+((alnum | punct) -':') >>lit(":") >>
53+
as_u32_string()[+((unicode::alnum | space | punct) -'\r' -'\n')] >>
54+
lit("\r\n")) >>
55+
lit("\r\n"),
56+
container);
57+
}
58+
59+
}// namespace http
60+
}// namespace network
61+
}// namespace boost

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp