input/async: skip resume and seek if there is a pending error

The resume/seek was received asynchronously and meanwhile an error
might have occurred that needs to be handled.

This fixes another NFS-related crash bug.
This commit is contained in:
Max Kellermann 2025-01-30 16:11:27 +01:00
parent d1e5c90c3b
commit 5b001957c7

@ -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();