Add handler tracking locations to icy_stream

This commit is contained in:
Richard Hodges
2020-08-25 13:48:25 +02:00
parent 11385141ea
commit 4357e8356e
2 changed files with 28 additions and 9 deletions

View File

@ -1,5 +1,6 @@
Version XXX:
* Add handler tracking locations to icy_stream.
* Add handler tracking locations to basic_stream.
* Add handler tracking locations to http operations.

View File

@ -95,10 +95,16 @@ public:
{
// Try to read the first three characters
BOOST_ASIO_CORO_YIELD
{
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,18 +133,30 @@ public:
else
{
BOOST_ASIO_CORO_YIELD
{
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)
{
ec_ = ec;
n_ = bytes_transferred;
BOOST_ASIO_CORO_YIELD
{
BOOST_ASIO_HANDLER_LOCATION((
__FILE__, __LINE__,
"http::icy_stream::async_read_some"));
s_.next_layer().async_read_some(
net::mutable_buffer{},
std::move(*this));
}
ec = ec_;
bytes_transferred = n_;
}