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

Commit8d827a0

Browse files
committed
Closes#313 -- make all client implementations use a non-case-sensitive multimap.
1 parenta50660e commit8d827a0

File tree

2 files changed

+41
-33
lines changed

2 files changed

+41
-33
lines changed

‎boost/network/protocol/http/traits/impl/headers_container.ipp

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
11

2-
// Copyright Dean Michael Berris 2008.
2+
// Copyright 2013 Google, Inc.
3+
// Copyright 2008 Dean Michael Berris <dberris@google.com>
34
// Distributed under the Boost Software License, Version 1.0.
4-
//(See accompanying file LICENSE_1_0.txt or copy at
5-
//http://www.boost.org/LICENSE_1_0.txt)
5+
// (See accompanying file LICENSE_1_0.txt or copy at
6+
// http://www.boost.org/LICENSE_1_0.txt)
67

78
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_TRAITS_HEADERS_CONTAINER_IPP
89
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_TRAITS_HEADERS_CONTAINER_IPP
910

11+
#include<boost/utility/enable_if.hpp>
1012
#include<boost/network/traits/headers_container.hpp>
1113
#include<boost/network/protocol/http/tags.hpp>
1214
#include<boost/algorithm/string/case_conv.hpp>
1315
#include<map>
1416
#include<string>
1517

16-
namespaceboost {namespacenetwork {
17-
18-
template<>
19-
structheaders_container<http::tags::http_default_8bit_tcp_resolve> {
20-
21-
// Moving implementation from original
22-
// message_traits implementation by
23-
// Atomic Labs, Inc.
24-
// --
25-
// returns true if str1 < str2 (ignoring case)
26-
structis_less_ignore_case {
27-
inlinebooloperator() (
28-
string<http::tags::http_default_8bit_tcp_resolve>::typeconst & str1,
29-
string<http::tags::http_default_8bit_tcp_resolve>::typeconst & str2)const {
30-
returnto_lower_copy(str1) <to_lower_copy(str2);
31-
};
18+
namespaceboost {namespacenetwork {namespaceimpl {
19+
20+
template<classTag>
21+
structheaders_container_impl<Tag,typename enable_if<typename Tag::is_client>::type> {
22+
// Moving implementation from original
23+
// message_traits implementation by
24+
// Atomic Labs, Inc.
25+
// --
26+
// returns true if str1 < str2 (ignoring case)
27+
structis_less_ignore_case {
28+
inlinebooloperator() (
29+
string<http::tags::http_default_8bit_tcp_resolve>::typeconst & str1,
30+
string<http::tags::http_default_8bit_tcp_resolve>::typeconst & str2)const {
31+
returnto_lower_copy(str1) <to_lower_copy(str2);
3232
};
33-
34-
typedef std::multimap<
35-
string<http::tags::http_default_8bit_tcp_resolve>::type,
36-
string<http::tags::http_default_8bit_tcp_resolve>::type,
37-
is_less_ignore_case> type;
3833
};
3934

40-
}// namespace network
35+
typedef std::multimap<
36+
string<http::tags::http_default_8bit_tcp_resolve>::type,
37+
string<http::tags::http_default_8bit_tcp_resolve>::type,
38+
is_less_ignore_case> type;
39+
};
4140

41+
}// namespace impl
42+
}// namespace network
4243
}// namespace boost
4344

4445
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_TRAITS_HEADERS_CONTAINER_IPP

‎boost/network/traits/headers_container.hpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
// Copyright (c) Glyn Matthews 2009.
1+
// Copyright (c) Glyn Matthews 2009.
2+
// Copyright 2013 Google, Inc.
3+
// Copyright 2013 Dean Michael Berris <dberris@google.com>
24
// Distributed under the Boost Software License, Version 1.0.
3-
//(See accompanying file LICENSE_1_0.txt or copy at
4-
//http://www.boost.org/LICENSE_1_0.txt)
5+
// (See accompanying file LICENSE_1_0.txt or copy at
6+
// http://www.boost.org/LICENSE_1_0.txt)
57

68

7-
#ifndef__BOOST_NETWORK_TRAITS_HEADERS_CONTAINER_INC__
8-
#define__BOOST_NETWORK_TRAITS_HEADERS_CONTAINER_INC__
9+
#ifndefBOOST_NETWORK_TRAITS_HEADERS_CONTAINER_INC
10+
#defineBOOST_NETWORK_TRAITS_HEADERS_CONTAINER_INC
911

1012
#include<map>
1113
#include<boost/network/tags.hpp>
1214
#include<boost/network/traits/string.hpp>
1315

14-
namespaceboost {namespacenetwork {
16+
namespaceboost {namespacenetwork {namespaceimpl {
1517

16-
template<classTag>
17-
structheaders_container {
18+
template<classTag,classEnable =void>
19+
structheaders_container_impl {
1820
typedef std::multimap<
1921
typename string<Tag>::type,
2022
typename string<Tag>::type
2123
> type;
2224
};
2325

26+
}// namespace impl
27+
28+
template<classTag>
29+
structheaders_container : impl::headers_container_impl<Tag> {};
30+
2431
}// namespace network
2532
}// namespace boost
2633

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp