Skip to content

Commit 616ba6b

Browse files
committed
Changing tags::http to become tags::http_default_8bit_tcp_resolve, introducing tags::http_default_8bit_udp_resolve.
1 parent ddd7889 commit 616ba6b

34 files changed

+119
-72
lines changed

boost/network/protocol/http/client.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace boost { namespace network { namespace http {
4646

4747
boost::system::error_code error = boost::asio::error::host_not_found;
4848

49-
tcp::resolver::iterator endpoint_iterator, end;
49+
typename resolver_base::resolver_type::iterator endpoint_iterator, end;
5050
boost::tie(endpoint_iterator, end) = resolve(resolver_, hostname, port);
5151

5252
while (error && endpoint_iterator != end) {
@@ -287,7 +287,7 @@ namespace boost { namespace network { namespace http {
287287

288288
};
289289

290-
typedef basic_client<tags::http, 1, 0> client;
290+
typedef basic_client<tags::http_default_8bit_tcp_resolve, 1, 0> client;
291291

292292
} // namespace http
293293

boost/network/protocol/http/client_fwd.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace boost { namespace network { namespace http {
1919
template <class Tag, unsigned version_major, unsigned version_minor>
2020
class basic_client;
2121

22-
typedef basic_client<tags::http, 1, 0> client;
22+
typedef basic_client<tags::http_default_8bit_tcp_resolve, 1, 0> client;
2323

2424
} // namespace http
2525

boost/network/protocol/http/errors.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace boost { namespace network { namespace http { namespace errors {
1414

15-
template <class Tag=tags::http>
15+
template <class Tag=tags::http_default_8bit_tcp_resolve>
1616
struct connection_timeout_exception :
1717
std::runtime_error
1818
{

boost/network/protocol/http/message.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace boost { namespace network { namespace http {
6868
static bool const base64_encode(string_type const &input, string_type & output);
6969
};
7070

71-
typedef message_impl<tags::http> message;
71+
typedef message_impl<tags::http_default_8bit_tcp_resolve> message;
7272

7373
} // namespace http
7474

boost/network/protocol/http/policies/sync_resolver.hpp

+12-9
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88

99
#include <utility>
1010
#include <boost/asio.hpp>
11+
#include <boost/network/protocol/http/traits/resolver.hpp>
1112

1213
namespace boost { namespace network { namespace http { namespace policies {
1314

1415
template <class Tag>
1516
struct sync_resolver {
1617

17-
typedef boost::asio::ip::tcp::resolver resolver_type;
18+
typedef typename resolver<Tag>::type resolver_type;
19+
typedef typename resolver_type::iterator resolver_iterator;
20+
typedef typename resolver_type::query resolver_query;
1821

1922
protected:
2023

2124
typedef std::pair<
22-
boost::asio::ip::tcp::resolver::iterator,
23-
boost::asio::ip::tcp::resolver::iterator
25+
resolver_iterator,
26+
resolver_iterator
2427
> resolver_iterator_pair;
2528
typedef typename string<Tag>::type string_type;
2629
typedef std::map<string_type, resolver_iterator_pair> resolved_cache;
@@ -41,13 +44,13 @@ namespace boost { namespace network { namespace http { namespace policies {
4144
hostname,
4245
std::make_pair(
4346
resolver_.resolve(
44-
boost::asio::ip::tcp::resolver::query(
47+
resolver_query(
4548
hostname,
4649
port,
47-
boost::asio::ip::tcp::resolver_query::numeric_service
50+
resolver_query::numeric_service
4851
)
4952
)
50-
, boost::asio::ip::tcp::resolver::iterator()
53+
, resolver_iterator()
5154
)
5255
)
5356
);
@@ -57,14 +60,14 @@ namespace boost { namespace network { namespace http { namespace policies {
5760

5861
return std::make_pair(
5962
resolver_.resolve(
60-
boost::asio::ip::tcp::resolver::query(
63+
resolver_query(
6164
hostname,
6265
port,
63-
boost::asio::ip::tcp::resolver_query::numeric_service
66+
resolver_query::numeric_service
6467
)
6568
)
6669
,
67-
boost::asio::ip::tcp::resolver::iterator()
70+
resolver_iterator()
6871
);
6972
};
7073

boost/network/protocol/http/request.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace boost { namespace network { namespace http {
2828

2929
namespace boost { namespace network { namespace http {
3030

31-
typedef basic_request<tags::http> request;
31+
typedef basic_request<tags::http_default_8bit_tcp_resolve> request;
3232
typedef basic_request<tags::pod> request_pod;
3333

3434
} // namespace http

boost/network/protocol/http/response.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace boost { namespace network { namespace http {
6565
lhs.swap(rhs);
6666
}
6767

68-
typedef basic_response<tags::http> response;
68+
typedef basic_response<tags::http_default_8bit_tcp_resolve> response;
6969

7070
} // namespace http
7171

boost/network/protocol/http/traits/impl/content.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct content<tags::http> {
15+
struct content<tags::http_default_8bit_tcp_resolve> {
1616
static char const * const type_html() {
1717
static char const * const TYPE_HTML = "text/html";
1818
return TYPE_HTML;

boost/network/protocol/http/traits/impl/cookie_name.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct cookie_name<tags::http> {
15+
struct cookie_name<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/cookie_value.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct cookie_value<tags::http> {
15+
struct cookie_value<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u * 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/delimiters.ipp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace boost { namespace network { namespace http {
1313

14-
// specialize on the tags::http type
14+
// specialize on the tags::http_default_8bit_tcp_resolve type
1515
template <>
16-
struct delimiters<tags::http> {
16+
struct delimiters<tags::http_default_8bit_tcp_resolve> {
1717
static char const * const string_crlf() {
1818
static char const * const CRLF = "\x0D\x0A";
1919
return CRLF;

boost/network/protocol/http/traits/impl/header_name.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct header_name<tags::http> {
15+
struct header_name<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/header_value.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct header_value<tags::http> {
15+
struct header_value<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u * 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/headers.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct headers_<tags::http> {
15+
struct headers_<tags::http_default_8bit_tcp_resolve> {
1616
static char const * const host() {
1717
static char const * const HOST = "Host";
1818
return HOST;

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace boost { namespace network {
1717

1818
template <>
19-
struct headers_container<tags::http> {
19+
struct headers_container<tags::http_default_8bit_tcp_resolve> {
2020

2121
// Moving implementation from original
2222
// message_traits implementation by
@@ -25,15 +25,15 @@ namespace boost { namespace network {
2525
// returns true if str1 < str2 (ignoring case)
2626
struct is_less_ignore_case {
2727
inline bool operator() (
28-
string<tags::http>::type const & str1,
29-
string<tags::http>::type const & str2) const {
28+
string<tags::http_default_8bit_tcp_resolve>::type const & str1,
29+
string<tags::http_default_8bit_tcp_resolve>::type const & str2) const {
3030
return to_lower_copy(str1) < to_lower_copy(str2);
3131
};
3232
};
3333

3434
typedef std::multimap<
35-
string<tags::http>::type,
36-
string<tags::http>::type,
35+
string<tags::http_default_8bit_tcp_resolve>::type,
36+
string<tags::http_default_8bit_tcp_resolve>::type,
3737
is_less_ignore_case> type;
3838
};
3939

boost/network/protocol/http/traits/impl/method.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct method<tags::http> {
15+
struct method<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/post_content.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct post_content<tags::http> {
15+
struct post_content<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u * 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/query_name.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct query_name<tags::http> {
15+
struct query_name<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/query_string.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct query_string<tags::http> {
15+
struct query_string<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u * 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/query_value.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct query_value<tags::http> {
15+
struct query_value<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u * 1024u;
1717
};
1818

boost/network/protocol/http/traits/impl/request_methods.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct request_methods<tags::http> {
15+
struct request_methods<tags::http_default_8bit_tcp_resolve> {
1616
static char const * const head() {
1717
static char const * const HEAD = "HEAD";
1818
return HEAD;

boost/network/protocol/http/traits/impl/resource.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct resource<tags::http> {
15+
struct resource<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u * 256u;
1717
};
1818

boost/network/protocol/http/traits/impl/response_code.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace boost { namespace network { namespace http {
1414

15-
/* This glob doesn't have a specialization on the tags::http
15+
/* This glob doesn't have a specialization on the tags::http_default_8bit_tcp_resolve
1616
* yet because it doesn't need to define different behaviour/types
1717
* on different message tags -- for example, it doesn't need to
1818
* determine the type or change the values of the data no matter

boost/network/protocol/http/traits/impl/response_message.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct response_message<tags::http> {
15+
struct response_message<tags::http_default_8bit_tcp_resolve> {
1616
static char const * const ok() {
1717
static char const * const OK = "OK";
1818
return OK;

boost/network/protocol/http/traits/impl/status_message.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace boost { namespace network { namespace http {
1313

1414
template <>
15-
struct status_message<tags::http> {
15+
struct status_message<tags::http_default_8bit_tcp_resolve> {
1616
static boost::uint32_t const MAX = 1024u;
1717
};
1818

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_TRAITS_RESOLVER_20091214
2+
#define BOOST_NETWORK_PROTOCOL_HTTP_TRAITS_RESOLVER_20091214
3+
4+
// Copyright Dean Michael Berris 2009.
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
#include <boost/network/tags.hpp>
10+
11+
namespace boost { namespace network { namespace http {
12+
13+
template <class Tag>
14+
struct unsupported_tag;
15+
16+
template <class Tag>
17+
struct resolver {
18+
typedef unsupported_tag<Tag> type;
19+
};
20+
21+
template <>
22+
struct resolver<tags::http_default_8bit_tcp_resolve> {
23+
typedef boost::asio::ip::tcp::resolver type;
24+
};
25+
26+
template <>
27+
struct resolver<tags::http_default_8bit_udp_resolve> {
28+
typedef boost::asio::ip::udp::resolver type;
29+
};
30+
31+
} // namespace http
32+
33+
} // namespace network
34+
35+
} // namespace boost
36+
37+
#endif // BOOST_NETWORK_PROTOCOL_HTTP_TRAITS_RESOLVER_20091214
38+

boost/network/protocol/http/traits/resolver_policy.hpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ namespace boost { namespace network { namespace http {
2020
};
2121

2222
template <>
23-
struct resolver_policy<tags::http> {
24-
typedef policies::sync_resolver<tags::http> type;
23+
struct resolver_policy<tags::http_default_8bit_tcp_resolve> {
24+
typedef policies::sync_resolver<tags::http_default_8bit_tcp_resolve> type;
25+
};
26+
27+
template <>
28+
struct resolver_policy<tags::http_default_8bit_udp_resolve> {
29+
typedef policies::sync_resolver<tags::http_default_8bit_udp_resolve> type;
2530
};
2631

2732
} // namespace http

boost/network/tags.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace tags {
1515

1616
struct default_string;
1717
struct default_wstring;
18-
struct http;
18+
struct http_default_8bit_tcp_resolve;
19+
struct http_default_8bit_udp_resolve;
1920
struct pod;
2021

2122
typedef default_string default_;

boost/network/traits/ostringstream.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace boost { namespace network {
3131
};
3232

3333
template <>
34-
struct ostringstream<tags::http> {
34+
struct ostringstream<tags::http_default_8bit_tcp_resolve> {
3535
typedef std::ostringstream type;
3636
};
3737

boost/network/traits/string.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace boost { namespace network {
3434
};
3535

3636
template <>
37-
struct string<tags::http> {
37+
struct string<tags::http_default_8bit_tcp_resolve> {
3838
typedef std::string type;
3939
};
4040

0 commit comments

Comments
 (0)