@@ -21,10 +21,10 @@ namespace boost { namespace network { namespace http { namespace impl {
21
21
typedef typename resolver_base::resolver_type resolver_type;
22
22
typedef typename resolver_base::resolve_function resolve_function;
23
23
typedef typename string<Tag>::type string_type;
24
- typedef basic_request<Tag> request;
24
+ typedef basic_request<typename sync_only< Tag>::type > request;
25
25
typedef basic_response<Tag> response;
26
26
27
- static async_connection_base<Tag,version_major,version_minor> * new_connection (resolve_function resolve, boost::shared_ptr<resolver_type> resolver, bool follow_redirect, bool https) {
27
+ static boost::shared_ptr< async_connection_base<Tag,version_major,version_minor> > new_connection (resolve_function resolve, boost::shared_ptr<resolver_type> resolver, bool follow_redirect, bool https) {
28
28
if (https) {
29
29
#ifdef BOOST_NETWORK_ENABLE_HTTPS
30
30
// FIXME fill this up with the HTTPS implementation.
@@ -33,7 +33,10 @@ namespace boost { namespace network { namespace http { namespace impl {
33
33
throw std::runtime_error (" HTTPS not supported." );
34
34
#endif
35
35
}
36
- return dynamic_cast <async_connection_base<Tag,version_major,version_minor>*>(new http_async_connection<Tag,version_major,version_minor>(resolver, resolve, follow_redirect));
36
+ boost::shared_ptr<async_connection_base<Tag,version_major,version_minor> > temp;
37
+ temp.reset (new http_async_connection<Tag,version_major,version_minor>(resolver, resolve, follow_redirect));
38
+ assert (temp.get () != 0 );
39
+ return temp;
37
40
}
38
41
39
42
virtual response start (request const & request, string_type const & method, bool get_body) = 0;
0 commit comments