forked from boostorg/beast
Use bind_front_handler:
The implementation uses bind_front_handler to reduce the resources consumed when instantiating templates during compilation.
This commit is contained in:
1 parent
d581bcc348
commit
15dd535c24
12 files changed
+29
-25
No files matched your search
@@ -263,7 +263,7 @@ async_read_some(
|
||||
if(in_->fc->fail(ec))
|
||||
return boost::asio::post(
|
||||
in_->ioc.get_executor(),
|
||||
bind_handler(
|
||||
bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
ec,
|
||||
0));
|
||||
@@ -281,7 +281,7 @@ async_read_some(
|
||||
++in_->nread;
|
||||
boost::asio::post(
|
||||
in_->ioc.get_executor(),
|
||||
bind_handler(
|
||||
bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
error_code{},
|
||||
bytes_transferred));
|
||||
@@ -297,7 +297,7 @@ async_read_some(
|
||||
ec = boost::asio::error::connection_reset;
|
||||
boost::asio::post(
|
||||
in_->ioc.get_executor(),
|
||||
bind_handler(
|
||||
bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
ec,
|
||||
0));
|
||||
@@ -380,7 +380,7 @@ async_write_some(ConstBufferSequence const& buffers,
|
||||
if(! out)
|
||||
return boost::asio::post(
|
||||
in_->ioc.get_executor(),
|
||||
bind_handler(
|
||||
bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
boost::asio::error::connection_reset,
|
||||
0));
|
||||
@@ -391,7 +391,7 @@ async_write_some(ConstBufferSequence const& buffers,
|
||||
if(in_->fc->fail(ec))
|
||||
return boost::asio::post(
|
||||
in_->ioc.get_executor(),
|
||||
bind_handler(
|
||||
bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
ec,
|
||||
0));
|
||||
@@ -407,7 +407,7 @@ async_write_some(ConstBufferSequence const& buffers,
|
||||
++in_->nwrite;
|
||||
boost::asio::post(
|
||||
in_->ioc.get_executor(),
|
||||
bind_handler(
|
||||
bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
error_code{},
|
||||
bytes_transferred));
|
||||
@@ -447,7 +447,7 @@ TeardownHandler&& handler)
|
||||
s.in_->fc->fail(ec))
|
||||
return boost::asio::post(
|
||||
s.get_executor(),
|
||||
bind_handler(std::move(handler), ec));
|
||||
bind_front_handler(std::move(handler), ec));
|
||||
s.close();
|
||||
if( s.in_->fc &&
|
||||
s.in_->fc->fail(ec))
|
||||
@@ -457,7 +457,7 @@ TeardownHandler&& handler)
|
||||
|
||||
boost::asio::post(
|
||||
s.get_executor(),
|
||||
bind_handler(std::move(handler), ec));
|
||||
bind_front_handler(std::move(handler), ec));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -513,7 +513,7 @@ class stream::read_op : public stream::read_op_base
|
||||
++s.nread;
|
||||
boost::asio::post(
|
||||
s.ioc.get_executor(),
|
||||
bind_handler(
|
||||
bind_front_handler(
|
||||
std::move(h),
|
||||
error_code{},
|
||||
bytes_transferred));
|
||||
@@ -532,7 +532,7 @@ class stream::read_op : public stream::read_op_base
|
||||
ec = boost::asio::error::connection_reset;
|
||||
boost::asio::post(
|
||||
s.ioc.get_executor(),
|
||||
bind_handler(std::move(h), ec, 0));
|
||||
bind_front_handler(std::move(h), ec, 0));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user