update boost
This commit is contained in:
@@ -224,11 +224,14 @@ public:
|
||||
*/
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler>
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
async_read_some(
|
||||
MutableBufferSequence const& buffers,
|
||||
ReadHandler&& handler);
|
||||
ReadHandler&& handler =
|
||||
net::default_completion_token_t<executor_type>{});
|
||||
|
||||
/** Write some data to the stream.
|
||||
|
||||
@@ -303,11 +306,14 @@ public:
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
class WriteHandler>
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler =
|
||||
net::default_completion_token_t<executor_type>
|
||||
>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
async_write_some(
|
||||
ConstBufferSequence const& buffers,
|
||||
WriteHandler&& handler);
|
||||
WriteHandler&& handler =
|
||||
net::default_completion_token_t<executor_type>{});
|
||||
};
|
||||
|
||||
} // http
|
||||
|
||||
@@ -35,7 +35,7 @@ is_icy(ConstBufferSequence const& buffers)
|
||||
char buf[3];
|
||||
auto const n = net::buffer_copy(
|
||||
net::mutable_buffer(buf, 3),
|
||||
buffers);
|
||||
buffers);
|
||||
if(n >= 1 && buf[0] != 'I')
|
||||
return false;
|
||||
if(n >= 2 && buf[1] != 'C')
|
||||
@@ -57,7 +57,7 @@ template<class Buffers, class Handler>
|
||||
class read_op
|
||||
: public beast::async_base<Handler,
|
||||
beast::executor_type<icy_stream>>
|
||||
, public net::coroutine
|
||||
, public asio::coroutine
|
||||
{
|
||||
icy_stream& s_;
|
||||
Buffers b_;
|
||||
@@ -95,10 +95,16 @@ public:
|
||||
{
|
||||
// Try to read the first three characters
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
s_.next_layer().async_read_some(
|
||||
net::mutable_buffer(
|
||||
s_.buf_ + s_.n_, 3 - s_.n_),
|
||||
std::move(*this));
|
||||
{
|
||||
BOOST_ASIO_HANDLER_LOCATION((
|
||||
__FILE__, __LINE__,
|
||||
"http::icy_stream::async_read_some"));
|
||||
|
||||
s_.next_layer().async_read_some(
|
||||
net::mutable_buffer(
|
||||
s_.buf_ + s_.n_, 3 - s_.n_),
|
||||
std::move(*this));
|
||||
}
|
||||
s_.n_ += static_cast<char>(bytes_transferred);
|
||||
if(ec)
|
||||
goto upcall;
|
||||
@@ -127,8 +133,14 @@ public:
|
||||
else
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
s_.next_layer().async_read_some(
|
||||
b_, std::move(*this));
|
||||
{
|
||||
BOOST_ASIO_HANDLER_LOCATION((
|
||||
__FILE__, __LINE__,
|
||||
"http::icy_stream::async_read_some"));
|
||||
|
||||
s_.next_layer().async_read_some(
|
||||
b_, std::move(*this));
|
||||
}
|
||||
}
|
||||
upcall:
|
||||
if(! cont)
|
||||
@@ -136,10 +148,16 @@ public:
|
||||
ec_ = ec;
|
||||
n_ = bytes_transferred;
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
s_.next_layer().async_read_some(
|
||||
net::mutable_buffer{},
|
||||
std::move(*this));
|
||||
ec = ec_;
|
||||
{
|
||||
BOOST_ASIO_HANDLER_LOCATION((
|
||||
__FILE__, __LINE__,
|
||||
"http::icy_stream::async_read_some"));
|
||||
|
||||
s_.next_layer().async_read_some(
|
||||
net::mutable_buffer{},
|
||||
std::move(*this));
|
||||
}
|
||||
BOOST_BEAST_ASSIGN_EC(ec, ec_);
|
||||
bytes_transferred = n_;
|
||||
}
|
||||
this->complete_now(ec, bytes_transferred);
|
||||
@@ -259,7 +277,7 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
template<class NextLayer>
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class ReadHandler>
|
||||
BOOST_BEAST_ASYNC_TPARAM2 ReadHandler>
|
||||
BOOST_BEAST_ASYNC_RESULT2(ReadHandler)
|
||||
icy_stream<NextLayer>::
|
||||
async_read_some(
|
||||
@@ -311,7 +329,7 @@ write_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
template<class NextLayer>
|
||||
template<
|
||||
class MutableBufferSequence,
|
||||
class WriteHandler>
|
||||
BOOST_BEAST_ASYNC_TPARAM2 WriteHandler>
|
||||
BOOST_BEAST_ASYNC_RESULT2(WriteHandler)
|
||||
icy_stream<NextLayer>::
|
||||
async_write_some(
|
||||
|
||||
Reference in New Issue
Block a user