Merge pull request #625 from jonahquark81/master

Minor tweaks to resolve #623 & #624
This commit is contained in:
Johannes Pohl 2020-05-31 13:43:38 +02:00 committed by GitHub
commit c07b56816d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -240,9 +240,17 @@ void AirplayStream::pipeReadLine()
<< "\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;
}