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

Commit030de04

Browse files
author
Dean Michael Berris
committed
More GCC changes, integrating HTTP incremental parser to the HTTP client.
1 parentf7679a7 commit030de04

File tree

19 files changed

+519
-143
lines changed

19 files changed

+519
-143
lines changed

‎boost/network/message/directives/source.hpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include<boost/network/message/directives/detail/string_directive.hpp>
1111
#include<boost/network/message/directives/detail/string_value.hpp>
1212

13+
#include<boost/network/support/is_default_string.hpp>
14+
1315
namespaceboost {namespacenetwork {
1416

1517
namespaceimpl {
@@ -26,8 +28,8 @@ namespace boost { namespace network {
2628
voidoperator()(typename detail::string_value<typename Message::tag>::typeconst & source)const {
2729
message_.source(source);
2830
}
29-
template<classT>voidoperator()(Tconst &)const {
30-
//FIXME -- fail here!
31+
template<classT>voidoperator()(Tconst & source)const {
32+
//fail at compile time?
3133
}
3234
};
3335

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#include<boost/network/protocol/http/client/facade.hpp>
2727
#include<boost/network/protocol/http/client/pimpl.hpp>
2828

29+
#include<boost/network/support/sync_only.hpp>
30+
31+
2932
namespaceboost {namespacenetwork {namespacehttp {
3033

3134
template<classTag,unsigned version_major,unsigned version_minor>
@@ -36,7 +39,7 @@ namespace boost { namespace network { namespace http {
3639
typedef basic_client_impl<Tag,version_major,version_minor> pimpl_type;
3740
typedef basic_client_facade<Tag, basic_client<Tag,version_major,version_minor> > base_facade_type;
3841
public:
39-
typedef basic_request<Tag> request;
42+
typedef basic_request<typename sync_only<Tag>::type> request;
4043
typedef basic_response<Tag> response;
4144
typedeftypename string<Tag>::type string_type;
4245
typedef Tag tag_type;
@@ -87,7 +90,7 @@ namespace boost { namespace network { namespace http {
8790

8891
friendstructbasic_client_facade<Tag,basic_client<Tag,version_major,version_minor> > ;
8992

90-
basic_response<Tag>constrequest_skeleton(basic_request<Tag>const & request_, string_type method,bool get_body) {
93+
basic_response<Tag>constrequest_skeleton(requestconst & request_, string_type method,bool get_body) {
9194
return pimpl->request_skeleton(request_, method, get_body);
9295
}
9396

‎boost/network/protocol/http/client/async_impl.hpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include<boost/asio/strand.hpp>
1111
#include<boost/thread/thread.hpp>
1212
#include<boost/bind.hpp>
13+
#include<boost/network/support/sync_only.hpp>
1314

1415
namespaceboost {namespacenetwork {namespacehttp {
1516

@@ -55,7 +56,7 @@ namespace boost { namespace network { namespace http {
5556
}
5657

5758
basic_response<Tag>constrequest_skeleton(
58-
basic_request<Tag>const & request_,
59+
basic_request<typename sync_only<Tag>::type>const & request_,
5960
string_typeconst & method,
6061
bool get_body
6162
)

‎boost/network/protocol/http/client/facade.hpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include<boost/network/protocol/http/request.hpp>
1010
#include<boost/network/protocol/http/response.hpp>
11+
#include<boost/network/support/sync_only.hpp>
1112

1213
namespaceboost {namespacenetwork {namespacehttp {
1314

@@ -21,7 +22,7 @@ namespace boost { namespace network { namespace http {
2122
structbasic_client_facade {
2223

2324
typedeftypename string<Tag>::type string_type;
24-
typedef basic_request<Tag> request;
25+
typedef basic_request<typename sync_only<Tag>::type> request;
2526
typedef basic_response<Tag> response;
2627

2728
basic_client_facade()

‎boost/network/protocol/http/client/pimpl.hpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include<boost/network/protocol/http/traits/connection_policy.hpp>
1717
#include<boost/network/protocol/http/client/async_impl.hpp>
18+
#include<boost/network/support/sync_only.hpp>
1819

1920
namespaceboost {namespacenetwork {namespacehttp {
2021

@@ -46,7 +47,7 @@ namespace boost { namespace network { namespace http {
4647

4748
~sync_client() {}
4849

49-
basic_response<Tag>constrequest_skeleton(basic_request<Tag>const & request_, string_type method,bool get_body) {
50+
basic_response<Tag>constrequest_skeleton(basic_request<typename sync_only<Tag>::type>const & request_, string_type method,bool get_body) {
5051
typename connection_base::connection_ptr connection_;
5152
connection_ =connection_base::get_connection(resolver_, request_);
5253
return connection_->send_request(method, request_, get_body);

‎boost/network/protocol/http/detail/connection_helper.hpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include<boost/network/protocol/http/traits/connection_keepalive.hpp>
1212
#include<boost/asio/streambuf.hpp>
1313
#include<boost/network/traits/string.hpp>
14+
#include<boost/network/support/sync_only.hpp>
1415

1516
namespaceboost {namespacenetwork {namespacehttp {namespacedetail {
1617

@@ -20,7 +21,7 @@ namespace boost { namespace network { namespace http { namespace detail {
2021

2122
typedeftypename string<Tag>::type string_type;
2223

23-
voidcreate_request(boost::asio::streambuf & request_buffer, string_typeconst & method, basic_request<Tag> request_)const {
24+
voidcreate_request(boost::asio::streambuf & request_buffer, string_typeconst & method, basic_request<typename sync_only<Tag>::type> request_)const {
2425
// TODO make this use Boost.Karma instead of an ad-hoc implementation
2526
std::ostreamrequest_stream(&request_buffer);
2627

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ namespace boost { namespace network { namespace http { namespace impl {
2121
typedeftypename resolver_base::resolver_type resolver_type;
2222
typedeftypename resolver_base::resolve_function resolve_function;
2323
typedeftypename string<Tag>::type string_type;
24-
typedef basic_request<Tag> request;
24+
typedef basic_request<typename sync_only<Tag>::type> request;
2525
typedef basic_response<Tag> response;
2626

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+
staticboost::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) {
2828
if (https) {
2929
#ifdef BOOST_NETWORK_ENABLE_HTTPS
3030
// FIXME fill this up with the HTTPS implementation.
@@ -33,7 +33,10 @@ namespace boost { namespace network { namespace http { namespace impl {
3333
throwstd::runtime_error("HTTPS not supported.");
3434
#endif
3535
}
36-
returndynamic_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;
3740
}
3841

3942
virtual responsestart(requestconst & request, string_typeconst & method,bool get_body) = 0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp