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

Commitc0e214b

Browse files
omalashenkodeanberris
authored andcommitted
Fixed async_connection::write() SFINAE-isation
Overloaded function selection based on ConstBufferSeq::value_type.http_server_async_less_copy test fixed accordingly.
1 parenta912ab9 commitc0e214b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

‎boost/network/protocol/http/server/async_connection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,15 @@ namespace boost { namespace network { namespace http {
216216
}
217217

218218
template<classRange,classCallback>
219-
typename disable_if<is_base_of<asio::const_buffer, Range>,void>::type
219+
typename disable_if<is_base_of<asio::const_buffer,typenameRange::value_type>,void>::type
220220
write(Rangeconst & range, Callbackconst & callback) {
221221
lock_guardlock(headers_mutex);
222222
if (error_encountered)boost::throw_exception(boost::system::system_error(*error_encountered));
223223
write_impl(boost::make_iterator_range(range), callback);
224224
}
225225

226226
template<classConstBufferSeq,classCallback>
227-
typename enable_if<is_base_of<asio::const_buffer, ConstBufferSeq>,void>::type
227+
typename enable_if<is_base_of<asio::const_buffer,typenameConstBufferSeq::value_type>,void>::type
228228
write(ConstBufferSeqconst & seq, Callbackconst & callback)
229229
{
230230
write_vec_impl(seq, callback,shared_array_list(),shared_buffers());

‎libs/network/test/http/server_async_less_copy.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#defineBOOST_TEST_MODULE HTTP Asynchronous Server Tests
88

9+
#include<vector>
10+
911
#include<boost/config/warning_disable.hpp>
1012
#include<boost/network/include/http/server.hpp>
1113
#include<boost/network/utils/thread_pool.hpp>
@@ -51,9 +53,9 @@ struct async_hello_world {
5153
staticcharconst * hello_world ="Hello, World!";
5254
connection->set_status(server::connection::ok);
5355
connection->set_headers(boost::make_iterator_range(headers, headers+3));
54-
connection->write(
55-
boost::asio::const_buffers_1(hello_world,13)
56-
,boost::bind(&async_hello_world::error,this, _1));
56+
std::vector<boost::asio::const_buffer> iovec;
57+
iovec.push_back(boost::asio::const_buffer(hello_world,13));
58+
connection->write(iovec,boost::bind(&async_hello_world::error,this, _1));
5759
}
5860
}
5961

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp