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

Commit3513c16

Browse files
committed
Fix some borked uses of Boost.
1 parent91d0a73 commit3513c16

File tree

6 files changed

+71
-71
lines changed

6 files changed

+71
-71
lines changed

‎include/network/protocol/http/algorithms/linearize.hpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct linearize_header {
3131
};
3232

3333
template<classValueType>
34-
CONCEPT_REQUIRES(
34+
BOOST_CONCEPT_REQUIRES(
3535
((Header<ValueType>)),
3636
(string_type)
3737
)operator()(ValueType & header) {
@@ -46,7 +46,7 @@ struct linearize_header {
4646
};
4747

4848
template<classRequest,classOutputIterator>
49-
CONCEPT_REQUIRES(
49+
BOOST_CONCEPT_REQUIRES(
5050
((ClientRequest<Request>)),
5151
(OutputIterator)
5252
) linearize(
@@ -130,7 +130,7 @@ CONCEPT_REQUIRES(
130130
}
131131
typedef headers_wrapper::container_type headers_container;
132132
typedef headers_container::const_iterator headers_iterator;
133-
headers_containerconst & request_headers =boost::network::headers(request);
133+
headers_containerconst & request_headers =network::headers(request);
134134
headers_iterator iterator =boost::begin(request_headers),
135135
end =boost::end(request_headers);
136136
bool has_user_agent =false;
@@ -153,7 +153,7 @@ CONCEPT_REQUIRES(
153153
boost::copy(crlf, oi);
154154
}
155155
boost::copy(crlf, oi);
156-
auto body_data =boost::network::body(request);
156+
auto body_data =network::body(request);
157157
returnstd::copy(body_data.begin(), body_data.end(), oi);
158158
}
159159

‎include/network/protocol/http/client/connection/async_normal.ipp‎

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
3333
typedef http_async_connection_pimpl this_type;
3434

3535
http_async_connection_pimpl(
36-
shared_ptr<resolver_delegate> resolver_delegate,
37-
shared_ptr<connection_delegate> connection_delegate,
38-
asio::io_service & io_service,
36+
boost::shared_ptr<resolver_delegate> resolver_delegate,
37+
boost::shared_ptr<connection_delegate> connection_delegate,
38+
boost::asio::io_service & io_service,
3939
bool follow_redirect)
4040
:
4141
follow_redirect_(follow_redirect),
@@ -137,7 +137,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
137137
resolver_iterator iter =boost::begin(endpoint_range);
138138
NETWORK_MESSAGE("trying connection to:"
139139
<< iter->endpoint().address() <<":" << port);
140-
asio::ip::tcp::endpointendpoint(iter->endpoint().address(), port);
140+
boost::asio::ip::tcp::endpointendpoint(iter->endpoint().address(), port);
141141
connection_delegate_->connect(
142142
endpoint,
143143
this->host_,
@@ -181,7 +181,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
181181
if (!boost::empty(endpoint_range)) {
182182
resolver_iterator iter =boost::begin(endpoint_range);
183183
NETWORK_MESSAGE("trying:" << iter->endpoint().address() <<":" << port);
184-
asio::ip::tcp::endpointendpoint(iter->endpoint().address(), port);
184+
boost::asio::ip::tcp::endpointendpoint(iter->endpoint().address(), port);
185185
connection_delegate_->connect(endpoint,
186186
this->host_,
187187
request_strand_.wrap(
@@ -235,15 +235,15 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
235235
staticlong short_read_error =335544539;
236236
bool is_short_read_error =
237237
#ifdef NETWORK_ENABLE_HTTPS
238-
ec.category() == asio::error::ssl_category &&
238+
ec.category() ==boost::asio::error::ssl_category &&
239239
ec.value() == short_read_error
240240
#else
241241
false
242242
#endif
243243
;
244244
if (!ec || ec == boost::asio::error::eof || is_short_read_error) {
245245
NETWORK_MESSAGE("processing data chunk, no error encountered so far...");
246-
logic::tribool parsed_ok;
246+
boost::logic::tribool parsed_ok;
247247
size_t remainder;
248248
switch(state) {
249249
case version:
@@ -291,7 +291,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
291291
// in the buffer. We need this in the body processing to make sure
292292
// that the data remaining in the buffer is dealt with before
293293
// another call to get more data for the body is scheduled.
294-
fusion::tie(parsed_ok, remainder) =
294+
boost::fusion::tie(parsed_ok, remainder) =
295295
this->parse_headers(
296296
request_strand_.wrap(
297297
boost::bind(
@@ -511,17 +511,17 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
511511
}
512512
};
513513

514-
logic::triboolparse_version(
515-
function<void(system::error_code,size_t)> callback,
514+
boost::logic::triboolparse_version(
515+
boost::function<void(boost::system::error_code,size_t)> callback,
516516
size_t bytes) {
517-
logic::tribool parsed_ok;
517+
boost::logic::tribool parsed_ok;
518518
part_begin = part.begin();
519519
buffer_type::const_iterator part_end = part.begin();
520520
std::advance(part_end, bytes);
521521
boost::iterator_range<buffer_type::const_iterator>
522522
result_range,
523523
input_range =boost::make_iterator_range(part_begin, part_end);
524-
fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
524+
boost::fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
525525
response_parser::http_version_done,
526526
input_range);
527527
if (parsed_ok ==true) {
@@ -566,16 +566,16 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
566566
return parsed_ok;
567567
}
568568

569-
logic::triboolparse_status(
570-
function<void(system::error_code,size_t)> callback,
569+
boost::logic::triboolparse_status(
570+
boost::function<void(boost::system::error_code,size_t)> callback,
571571
size_t bytes) {
572-
logic::tribool parsed_ok;
572+
boost::logic::tribool parsed_ok;
573573
buffer_type::const_iterator part_end = part.begin();
574574
std::advance(part_end, bytes);
575575
boost::iterator_range< buffer_type::const_iterator>
576576
result_range,
577577
input_range =boost::make_iterator_range(part_begin, part_end);
578-
fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
578+
boost::fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
579579
response_parser::http_status_done,
580580
input_range);
581581
if (parsed_ok ==true) {
@@ -621,16 +621,16 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
621621
return parsed_ok;
622622
}
623623

624-
logic::triboolparse_status_message(
625-
function<void(system::error_code,size_t)> callback,
624+
boost::logic::triboolparse_status_message(
625+
boost::function<void(boost::system::error_code,size_t)> callback,
626626
size_t bytes) {
627-
logic::tribool parsed_ok;
627+
boost::logic::tribool parsed_ok;
628628
buffer_type::const_iterator part_end = part.begin();
629629
std::advance(part_end, bytes);
630630
boost::iterator_range< buffer_type::const_iterator>
631631
result_range,
632632
input_range =boost::make_iterator_range(part_begin, part_end);
633-
fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
633+
boost::fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
634634
response_parser::http_status_message_done,
635635
input_range);
636636
if (parsed_ok ==true) {
@@ -676,13 +676,13 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
676676
boost::iterator_range< std::string::const_iterator>
677677
input_range =boost::make_iterator_range(headers_part)
678678
, result_range;
679-
logic::tribool parsed_ok;
679+
boost::logic::tribool parsed_ok;
680680
response_parserheaders_parser(
681681
response_parser::http_header_line_done);
682682
std::multimap<std::string, std::string> headers;
683683
std::pair<std::string,std::string> header_pair;
684684
while (!boost::empty(input_range)) {
685-
fusion::tie(parsed_ok, result_range) =
685+
boost::fusion::tie(parsed_ok, result_range) =
686686
headers_parser.parse_until(
687687
response_parser::http_header_colon,
688688
input_range);
@@ -692,7 +692,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
692692
header_pair.first =std::string(boost::begin(result_range),
693693
boost::end(result_range));
694694
input_range.advance_begin(boost::distance(result_range));
695-
fusion::tie(parsed_ok, result_range) =
695+
boost::fusion::tie(parsed_ok, result_range) =
696696
headers_parser.parse_until(
697697
response_parser::http_header_line_done,
698698
input_range);
@@ -712,16 +712,16 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
712712
headers_promise.set_value(headers);
713713
}
714714

715-
fusion::tuple<logic::tribool,size_t>parse_headers(
716-
function<void(system::error_code,size_t)> callback,
715+
boost::fusion::tuple<boost::logic::tribool,size_t>parse_headers(
716+
boost::function<void(boost::system::error_code,size_t)> callback,
717717
size_t bytes) {
718-
logic::tribool parsed_ok;
718+
boost::logic::tribool parsed_ok;
719719
buffer_type::const_iterator part_end = part.begin();
720720
std::advance(part_end, bytes);
721721
boost::iterator_range<buffer_type::const_iterator>
722722
result_range,
723723
input_range =boost::make_iterator_range(part_begin, part_end);
724-
fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
724+
boost::fusion::tie(parsed_ok, result_range) = response_parser_.parse_until(
725725
response_parser::http_headers_done,
726726
input_range);
727727
if (parsed_ok ==true) {
@@ -759,7 +759,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
759759
callback
760760
);
761761
}
762-
returnfusion::make_tuple(
762+
returnboost::fusion::make_tuple(
763763
parsed_ok,
764764
std::distance(
765765
boost::end(result_range)
@@ -768,7 +768,7 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
768768
);
769769
}
770770

771-
voidparse_body(function<void(system::error_code,size_t)> callback, size_t bytes) {
771+
voidparse_body(boost::function<void(boost::system::error_code,size_t)> callback, size_t bytes) {
772772
// TODO: we should really not use a string for the partial body
773773
// buffer.
774774
partial_parsed.append(part_begin, bytes);
@@ -781,8 +781,8 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
781781

782782
bool follow_redirect_;
783783
boost::asio::io_service::strand request_strand_;
784-
shared_ptr<resolver_delegate> resolver_delegate_;
785-
shared_ptr<connection_delegate> connection_delegate_;
784+
boost::shared_ptr<resolver_delegate> resolver_delegate_;
785+
boost::shared_ptr<connection_delegate> connection_delegate_;
786786
boost::asio::streambuf command_streambuf;
787787
std::string method;
788788
response_parser response_parser_;
@@ -802,22 +802,22 @@ struct http_async_connection_pimpl : boost::enable_shared_from_this<http_async_c
802802

803803
// END OF PIMPL DEFINITION
804804

805-
http_async_connection::http_async_connection(shared_ptr<resolver_delegate> resolver_delegate,
806-
shared_ptr<connection_delegate> connection_delegate,
807-
asio::io_service & io_service,
805+
http_async_connection::http_async_connection(boost::shared_ptr<resolver_delegate> resolver_delegate,
806+
boost::shared_ptr<connection_delegate> connection_delegate,
807+
boost::asio::io_service & io_service,
808808
bool follow_redirects)
809809
: pimpl(new (std::nothrow) http_async_connection_pimpl(resolver_delegate,
810810
connection_delegate,
811811
io_service,
812812
follow_redirects)) {}
813813

814-
http_async_connection::http_async_connection(shared_ptr<http_async_connection_pimpl> new_pimpl)
814+
http_async_connection::http_async_connection(boost::shared_ptr<http_async_connection_pimpl> new_pimpl)
815815
: pimpl(new_pimpl) {}
816816

817817
http_async_connection::~http_async_connection() {}
818818

819819
http_async_connection *http_async_connection::clone()const {
820-
shared_ptr<http_async_connection_pimpl>new_pimpl(pimpl->clone());
820+
boost::shared_ptr<http_async_connection_pimpl>new_pimpl(pimpl->clone());
821821
returnnew (std::nothrow)http_async_connection(new_pimpl);
822822
}
823823

‎include/network/protocol/http/client/connection/async_resolver.ipp‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,34 @@
2424
#include<network/protocol/http/client/connection/async_resolver.hpp>
2525

2626
namespacenetwork {namespacehttp {
27-
structasync_resolver_pimpl : enable_shared_from_this<async_resolver_pimpl> {
27+
structasync_resolver_pimpl :boost::enable_shared_from_this<async_resolver_pimpl> {
2828
typedef resolver_delegate::resolve_completion_function resolve_completion_function;
29-
async_resolver_pimpl(asio::io_service & service,bool cache_resolved);
29+
async_resolver_pimpl(boost::asio::io_service & service,bool cache_resolved);
3030
voidresolve(std::stringconst & host,
3131
uint16_t port,
3232
resolve_completion_function once_resolved);
3333
voidclear_resolved_cache();
3434
private:
35-
asio::ip::udp::resolver resolver_;
35+
boost::asio::ip::udp::resolver resolver_;
3636
bool cache_resolved_;
37-
typedef asio::ip::udp::resolver::iterator
37+
typedefboost::asio::ip::udp::resolver::iterator
3838
resolver_iterator;
39-
typedef unordered_map<std::string, std::pair<resolver_iterator,resolver_iterator> >
39+
typedefboost::unordered_map<std::string, std::pair<resolver_iterator,resolver_iterator> >
4040
endpoint_cache;
4141
endpoint_cache endpoint_cache_;
42-
scoped_ptr<asio::io_service::strand> resolver_strand_;
42+
boost::scoped_ptr<boost::asio::io_service::strand> resolver_strand_;
4343

4444
voidhandle_resolve(std::stringconst & host,
4545
resolve_completion_function once_resolved,
46-
system::error_codeconst & ec,
46+
boost::system::error_codeconst & ec,
4747
resolver_iterator endpoint_iterator);
4848
};
4949

50-
async_resolver_pimpl::async_resolver_pimpl(asio::io_service & service,bool cache_resolved)
50+
async_resolver_pimpl::async_resolver_pimpl(boost::asio::io_service & service,bool cache_resolved)
5151
: resolver_(service),
5252
cache_resolved_(cache_resolved),
5353
endpoint_cache_(),
54-
resolver_strand_(new(std::nothrow) asio::io_service::strand(service))
54+
resolver_strand_(new(std::nothrow)boost::asio::io_service::strand(service))
5555
{
5656
// Do nothing
5757
}
@@ -65,7 +65,7 @@ void async_resolver_pimpl::resolve(std::string const & host,
6565
boost::uint16_t port,
6666
resolve_completion_function once_resolved) {
6767
if (!resolver_strand_.get())
68-
THROW_EXCEPTION(std::runtime_error(
68+
BOOST_THROW_EXCEPTION(std::runtime_error(
6969
"Uninitialized resolver strand, ran out of memory."));
7070

7171
if (cache_resolved_) {
@@ -78,8 +78,8 @@ void async_resolver_pimpl::resolve(std::string const & host,
7878
}
7979
}
8080

81-
std::string port_str = lexical_cast<std::string>(port);
82-
asio::ip::udp::resolver::queryquery(host, port_str);
81+
std::string port_str =boost::lexical_cast<std::string>(port);
82+
boost::asio::ip::udp::resolver::queryquery(host, port_str);
8383
resolver_.async_resolve(
8484
query,
8585
resolver_strand_->wrap(
@@ -110,19 +110,19 @@ void async_resolver_pimpl::handle_resolve(std::string const & host,
110110
}
111111
}
112112

113-
async_resolver::async_resolver(asio::io_service & service,bool cache_resolved)
113+
async_resolver::async_resolver(boost::asio::io_service & service,bool cache_resolved)
114114
: pimpl(new (std::nothrow) async_resolver_pimpl(service, cache_resolved))
115115
{}
116116

117117
voidasync_resolver::resolve(std::stringconst & host,
118118
uint16_t port,
119119
resolve_completion_function once_resolved) {
120-
ASSERT(pimpl.get() &&"Uninitialized pimpl, probably ran out of memory.");
120+
BOOST_ASSERT(pimpl.get() &&"Uninitialized pimpl, probably ran out of memory.");
121121
pimpl->resolve(host, port, once_resolved);
122122
}
123123

124124
voidasync_resolver::clear_resolved_cache() {
125-
ASSERT(pimpl.get() &&"Uninitialized pimpl, probably ran out of memory.");
125+
BOOST_ASSERT(pimpl.get() &&"Uninitialized pimpl, probably ran out of memory.");
126126
pimpl->clear_resolved_cache();
127127
}
128128

‎include/network/protocol/http/message/header.hpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ inline void swap(response_header & l, response_header & r) {
4444
}// namespace http
4545
}// namespace network
4646

47-
FUSION_ADAPT_STRUCT(
48-
boost::network::http::request_header,
47+
BOOST_FUSION_ADAPT_STRUCT(
48+
network::http::request_header,
4949
(std::string, name)
5050
(std::string, value)
5151
)
5252

53-
FUSION_ADAPT_STRUCT(
54-
boost::network::http::response_header,
53+
BOOST_FUSION_ADAPT_STRUCT(
54+
network::http::response_header,
5555
(std::string, name)
5656
(std::string, value)
5757
)

‎include/network/protocol/http/message/header_concept.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace network { namespace http {
1111

1212
template<classH>
1313
structHeader
14-
: DefaultConstructible<H>
15-
, Assignable<H>
16-
, CopyConstructible<H>
14+
:boost::DefaultConstructible<H>
15+
,boost::Assignable<H>
16+
,boost::CopyConstructible<H>
1717
{
1818

1919
BOOST_CONCEPT_USAGE(Header) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp