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

Commit79d3fd6

Browse files
committed
Merging from mikhailberis/0.9-devel.
2 parentsb46df4e +4ab77ee commit79d3fd6

File tree

47 files changed

+1992
-736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1992
-736
lines changed

‎CMakeLists.txt‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@ if (OpenSSL_FOUND)
2121
endif()
2222

2323
if (Boost_FOUND)
24+
if (MSVC)
25+
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
26+
endif(MSVC)
27+
if (WIN32)
28+
add_definitions(-D_WIN32_WINNT=0x0501)
29+
endif(WIN32)
2430
include_directories(${Boost_INCLUDE_DIRS})
2531
enable_testing()
2632
add_subdirectory(libs/network/src)
2733
add_subdirectory(libs/network/test)
28-
add_subdirectory(libs/mime/test)
34+
if (NOTMSVC)
35+
add_subdirectory(libs/mime/test)
36+
endif(NOTMSVC)
2937
add_subdirectory(libs/network/example)
30-
endif()
31-
38+
endif(Boost_FOUND)
3239

40+
enable_testing()

‎boost/network/protocol/http/client/connection/async_base.hpp‎

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,64 @@
88
// http://www.boost.org/LICENSE_1_0.txt)
99

1010
#include<boost/network/protocol/http/response.hpp>
11+
#include<boost/network/protocol/http/client/connection/connection_delegate_factory.hpp>
12+
#include<boost/network/protocol/http/traits/delegate_factory.hpp>
1113
#include<boost/network/protocol/http/client/connection/async_normal.hpp>
12-
#ifdef BOOST_NETWORK_ENABLE_HTTPS
13-
#include<boost/network/protocol/http/client/connection/async_ssl.hpp>
14-
#endif
1514

1615
namespaceboost {namespacenetwork {namespacehttp {namespaceimpl {
1716

18-
template<classTag,unsigned version_major,unsigned version_minor>
19-
structasync_connection_base {
20-
typedeftypename resolver_policy<Tag>::type resolver_base;
21-
typedeftypename resolver_base::resolver_type resolver_type;
22-
typedeftypename resolver_base::resolve_function resolve_function;
23-
typedeftypename string<Tag>::type string_type;
24-
typedef basic_request<Tag> request;
25-
typedef basic_response<Tag> response;
26-
typedef
27-
function<void(iterator_range<charconst *>const &, system::error_codeconst &)>
28-
body_callback_function_type;
29-
30-
static boost::shared_ptr<async_connection_base<Tag,version_major,version_minor> >new_connection(resolve_function resolve, resolver_type & resolver,bool follow_redirect,bool https, optional<string_type> certificate_filename=optional<string_type>(), optional<string_type>const & verify_path=optional<string_type>()) {
31-
boost::shared_ptr<async_connection_base<Tag,version_major,version_minor> > temp;
32-
if (https) {
33-
#ifdef BOOST_NETWORK_ENABLE_HTTPS
34-
temp.reset(new https_async_connection<Tag,version_major,version_minor>(resolver, resolve, follow_redirect, certificate_filename, verify_path));
35-
return temp;
36-
#else
37-
throwstd::runtime_error("HTTPS not supported.");
38-
#endif
39-
}
40-
temp.reset(new http_async_connection<Tag,version_major,version_minor>(resolver, resolve, follow_redirect));
41-
assert(temp.get() !=0);
42-
return temp;
43-
}
44-
45-
virtual responsestart(requestconst & request, string_typeconst & method,bool get_body, body_callback_function_type callback) = 0;
46-
47-
virtual~async_connection_base() {}
48-
49-
};
17+
template<classTag,unsigned version_major,unsigned version_minor>
18+
structasync_connection_base {
19+
typedef async_connection_base<Tag,version_major,version_minor> this_type;
20+
typedeftypename resolver_policy<Tag>::type resolver_base;
21+
typedeftypename resolver_base::resolver_type resolver_type;
22+
typedeftypename resolver_base::resolve_function resolve_function;
23+
typedeftypename string<Tag>::type string_type;
24+
typedef basic_request<Tag> request;
25+
typedef basic_response<Tag> response;
26+
typedef iterator_range<charconst *> char_const_range;
27+
typedef function<void(char_const_rangeconst &, system::error_codeconst &)>
28+
body_callback_function_type;
29+
typedef shared_ptr<this_type> connection_ptr;
30+
31+
// This is the factory function which constructs the appropriate async
32+
// connection implementation with the correct delegate chosen based on the
33+
// tag.
34+
static connection_ptrnew_connection(
35+
resolve_function resolve,
36+
resolver_type & resolver,
37+
bool follow_redirect,
38+
bool https,
39+
optional<string_type> certificate_filename=optional<string_type>(),
40+
optional<string_type>const & verify_path=optional<string_type>()) {
41+
typedef http_async_connection<Tag,version_major,version_minor>
42+
async_connection;
43+
typedeftypename delegate_factory<Tag>::type delegate_factory_type;
44+
connection_ptr temp;
45+
temp.reset(
46+
newasync_connection(
47+
resolver,
48+
resolve,
49+
follow_redirect,
50+
delegate_factory_type::new_connection_delegate(
51+
resolver.get_io_service(),
52+
https,
53+
certificate_filename,
54+
verify_path)));
55+
BOOST_ASSERT(temp.get() !=0);
56+
return temp;
57+
}
58+
59+
// This is the pure virtual entry-point for all asynchronous connections.
60+
virtual responsestart(
61+
requestconst & request,
62+
string_typeconst & method,
63+
bool get_body,
64+
body_callback_function_type callback) = 0;
65+
66+
virtual~async_connection_base() {}
67+
68+
};
5069

5170
}// namespace impl
5271

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp