mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-28 08:26:16 +02:00
Reformat code
This commit is contained in:
parent
c07b56816d
commit
c1c521b260
2 changed files with 4 additions and 13 deletions
|
@ -232,25 +232,17 @@ void AirplayStream::pipeReadLine()
|
|||
boost::asio::async_read_until(*pipe_fd_, streambuf_pipe_, delimiter, [this, delimiter](const std::error_code& ec, std::size_t bytes_transferred) {
|
||||
if (ec)
|
||||
{
|
||||
if (ec.value() == boost::asio::error::eof)
|
||||
if ((ec.value() == boost::asio::error::eof) || (ec.value() == boost::asio::error::bad_descriptor))
|
||||
{
|
||||
// For some reason, EOF is returned until the first metadata is written to the pipe.
|
||||
// Is this a boost bug?
|
||||
// If shairport-sync has not finished setting up the pipe, bad file descriptor is returned.
|
||||
LOG(INFO, LOG_TAG) << "Waiting for metadata, retrying in 2500ms"
|
||||
<< "\n";
|
||||
wait(pipe_open_timer_, 2500ms, [this] { pipeReadLine(); });
|
||||
}
|
||||
if (ec.value() == boost::asio::error::bad_descriptor)
|
||||
{
|
||||
// If shairport-sync has not finished setting up the pipe, bad file descriptor is returned.
|
||||
// retry in a few seconds
|
||||
LOG(INFO, LOG_TAG) << "Waiting for metadata, retrying in 2500ms"
|
||||
<< "\n";
|
||||
wait(pipe_open_timer_, 2500ms, [this] { pipeReadLine(); });
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(ERROR, LOG_TAG) << "Error while reading from metadata pipe: " << ec.message() << "\n";
|
||||
LOG(ERROR, LOG_TAG) << "Error while reading from metadata pipe: " << ec.message() << "\n";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue