Skip to content

Commit d6f6506

Browse files
committed
More fixes towards a working HTTP asynchronous client implementation.
1 parent 0084d96 commit d6f6506

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

boost/network/protocol/http/impl/async_connection_base.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@ namespace boost { namespace network { namespace http { namespace impl {
1919
struct async_connection_base {
2020
typedef typename resolver_policy<Tag>::type resolver_base;
2121
typedef typename resolver_base::resolver_type resolver_type;
22+
typedef typename resolver_base::resolve_function resolve_function;
2223
typedef typename string<Tag>::type string_type;
2324
typedef basic_request<Tag> request;
2425
typedef basic_response<Tag> response;
2526

26-
static async_connection_base<Tag,version_major,version_minor> * new_connection(boost::shared_ptr<resolver_type> resolver, bool https) {
27+
static async_connection_base<Tag,version_major,version_minor> * new_connection(resolve_function resolve, boost::shared_ptr<resolver_type> resolver, bool https) {
2728
if (https) {
2829
#ifdef BOOST_NETWORK_ENABLE_HTTPS
2930
return dynamic_cast<async_connection_base<Tag,version_major,version_minor>*>(new https_async_connection<Tag,version_major,version_minor>(resolver));
3031
#else
3132
throw std::runtime_error("HTTPS not supported.");
3233
#endif
3334
}
34-
return dynamic_cast<async_connection_base<Tag,version_major,version_minor>*>(new http_async_connection<Tag,version_major,version_minor>(resolver));
35+
return dynamic_cast<async_connection_base<Tag,version_major,version_minor>*>(new http_async_connection<Tag,version_major,version_minor>(resolve, resolver));
3536
}
3637

3738
virtual response start(request const & request, string_type const & method, bool get_body) = 0;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// http://www.boost.org/LICENSE_1_0.txt)
88

99
#include <boost/enable_shared_from_this.hpp>
10+
#include <boost/asio/placeholders.hpp>
1011

1112
namespace boost { namespace network { namespace http { namespace policies {
1213

@@ -41,7 +42,7 @@ namespace boost { namespace network { namespace http { namespace policies {
4142
if (cache_resolved_) {
4243
endpoint_cache::iterator iter =
4344
endpoint_cache_.find(boost::to_lower_copy(host));
44-
if (iter != resolved_map_.end()) {
45+
if (iter != endpoint_cache_.end()) {
4546
boost::system::error_code ignored;
4647
once_resolved(ignored, iter->second);
4748
return;

0 commit comments

Comments
 (0)