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

Added better IPv6 parsing to the URI, and cleaned up some warnings.#448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added better IPv6 parsing to the URI, and cleaned up some warnings.
  • Loading branch information
@glynos
glynos committedSep 18, 2014
commitbdbd612cd965ec6e6e632e2803647425f8cf3535
1 change: 0 additions & 1 deletionboost/network/message/directives/header.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,7 +55,6 @@ struct header_directive {

template <class Message>
void operator()(Message const& msg) const {
typedef typename Message::headers_container_type::value_type value_type;
directive_impl<Message>::eval(msg, _header_name, _header_value);
}

Expand Down
3 changes: 0 additions & 3 deletionsboost/network/message/message_concept.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,9 +34,6 @@ struct Message : DefaultConstructible<M>, CopyConstructible<M>, Assignable<M> {
typedef typename traits::source<M>::type source_type;
typedef typename traits::destination<M>::type destination_type;

typedef typename traits::header_key<M>::type header_key_type;
typedef typename traits::header_value<M>::type header_value_type;

headers_container_type headers_ = headers(message);
string_type body_ = body(message);
string_type source_ = source(message);
Expand Down
1 change: 0 additions & 1 deletionboost/network/message/modifiers/remove_header.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,6 @@ struct iequals_pred {
template <class Message, class KeyType, class Tag>
inline typename enable_if<is_pod<Tag>, void>::type remove_header(
Message& message, KeyType const& key, Tag) {
typedef typename Message::headers_container_type headers;
message.headers.erase(
boost::remove_if(message.headers, iequals_pred<KeyType>(key)),
message.headers.end());
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -222,7 +222,6 @@ struct async_connection
<< consts::space() << status << consts::space()
<< status_message(status) << consts::crlf();
if (!boost::empty(headers)) {
typedef typename Range::const_iterator iterator;
typedef typename string<Tag>::type string_type;
boost::transform(headers, std::ostream_iterator<string_type>(stream),
linearize_header<Tag>());
Expand Down
2 changes: 0 additions & 2 deletionsboost/network/uri/encode.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,8 +126,6 @@ template <class InputIterator, class OutputIterator>
OutputIterator encode(const InputIterator &in_begin,
const InputIterator &in_end,
const OutputIterator &out_begin) {
typedef typename boost::iterator_value<InputIterator>::type value_type;

InputIterator it = in_begin;
OutputIterator out = out_begin;
while (it != in_end) {
Expand Down
49 changes: 36 additions & 13 deletionsboost/network/uri/uri.ipp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,19 +84,42 @@ struct uri_grammar
ipvfuture %=
qi::lit('v') >> +qi::xdigit >> '.' >> +(unreserved | sub_delims | ':');

ipv6address %=
qi::raw[qi::repeat(6)[h16 >> ':'] >> ls32 |
"::" >> qi::repeat(5)[h16 >> ':'] >> ls32 |
qi::raw[h16] >> "::" >> qi::repeat(4)[h16 >> ':'] >> ls32 |
qi::raw[+(*(h16 >> ':')) >> h16] >> "::" >>
qi::repeat(3)[h16 >> ':'] >> ls32 |
qi::raw[qi::repeat(2)[*(h16 >> ':')] >> h16] >> "::" >>
qi::repeat(2)[h16 >> ':'] >> ls32 |
qi::raw[qi::repeat(3)[*(h16 >> ':')] >> h16] >> "::" >> h16 >>
':' >> ls32 |
qi::raw[qi::repeat(4)[*(h16 >> ':')] >> h16] >> "::" >> ls32 |
qi::raw[qi::repeat(5)[*(h16 >> ':')] >> h16] >> "::" >> h16 |
qi::raw[qi::repeat(6)[*(h16 >> ':')] >> h16] >> "::"];
ipv6address %= qi::raw
[qi::repeat(6)[h16 >> ':'] >> ls32 |
"::" >> qi::repeat(5)[h16 >> ':'] >> ls32 |
-qi::raw[h16] >> "::" >> qi::repeat(4)[h16 >> ':'] >> ls32 |
-qi::raw[h16] >> "::" >> qi::repeat(3)[h16 >> ':'] >> ls32 |
-qi::raw[h16] >> "::" >> qi::repeat(2)[h16 >> ':'] >> ls32 |
-qi::raw[h16] >> "::" >> h16 >> ':' >> ls32 |
-qi::raw[h16] >> "::" >> ls32 | -qi::raw[h16] >> "::" >> h16 |
-qi::raw[h16] >> "::" |
-qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >>
qi::repeat(3)[h16 >> ':'] >> ls32 |
-qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >>
qi::repeat(2)[h16 >> ':'] >> ls32 |
-qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> h16 >>
':' >> ls32 |
-qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
-qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" >> h16 |
-qi::raw[qi::repeat(1)[(h16 >> ':')] >> h16] >> "::" |
-qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >>
qi::repeat(2)[h16 >> ':'] >> ls32 |
-qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> h16 >>
':' >> ls32 |
-qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
-qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" >> h16 |
-qi::raw[qi::repeat(2)[(h16 >> ':')] >> h16] >> "::" |
-qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> h16 >>
':' >> ls32 |
-qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
-qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" >> h16 |
-qi::raw[qi::repeat(3)[(h16 >> ':')] >> h16] >> "::" |
-qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" >> ls32 |
-qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" >> h16 |
-qi::raw[qi::repeat(4)[(h16 >> ':')] >> h16] >> "::" |
-qi::raw[qi::repeat(5)[(h16 >> ':')] >> h16] >> "::" >> h16 |
-qi::raw[qi::repeat(5)[(h16 >> ':')] >> h16] >> "::" |
-qi::raw[qi::repeat(6)[(h16 >> ':')] >> h16] >> "::"];

// ls32 = ( h16 ":" h16 ) / IPv4address
ls32 %= (h16 >> ':' >> h16) | ipv4address;
Expand Down
5 changes: 5 additions & 0 deletionslibs/network/test/uri/uri_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -561,3 +561,8 @@ BOOST_AUTO_TEST_CASE(issue_364_test) {
uri::schemes::http(instance) << uri::host("my.awesome.server.com");
BOOST_CHECK_EQUAL("my.awesome.server.com", uri::authority(instance));
}

BOOST_AUTO_TEST_CASE(issue_447_test) {
uri::uri instance("http://[www.foo.com/");
BOOST_REQUIRE(!uri::valid(instance));
}

[8]ページ先頭

©2009-2025 Movatter.jp