diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx index 9a3bd5baf..8a60fcfa0 100644 --- a/src/input/AsyncInputStream.cxx +++ b/src/input/AsyncInputStream.cxx @@ -251,6 +251,14 @@ AsyncInputStream::DeferredResume() noexcept { const std::scoped_lock protect{mutex}; + if (postponed_exception) { + /* do not proceed, first the caller must handle the + pending error */ + caller_cond.notify_one(); + InvokeOnAvailable(); + return; + } + try { Resume(); } catch (...) { @@ -267,6 +275,14 @@ AsyncInputStream::DeferredSeek() noexcept if (seek_state != SeekState::SCHEDULED) return; + if (postponed_exception) { + /* do not proceed, first the caller must handle the + pending error */ + caller_cond.notify_one(); + InvokeOnAvailable(); + return; + } + try { Resume();