From 63fe4d1d179eb7095d82a5d0cb2c2379faf0455f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 16 May 2019 22:05:25 +0200 Subject: [PATCH 1/2] input/buffered: wake up client thread on seek error --- src/input/BufferedInputStream.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/input/BufferedInputStream.cxx b/src/input/BufferedInputStream.cxx index 7ac4f0a2c..69fb0c064 100644 --- a/src/input/BufferedInputStream.cxx +++ b/src/input/BufferedInputStream.cxx @@ -187,6 +187,8 @@ BufferedInputStream::RunThread() noexcept own InputStream interface) is in "read" mode */ read_error = std::current_exception(); + client_cond.signal(); + InvokeOnAvailable(); } } else if (!idle && !read_error && input->IsAvailable() && !input->IsEOF()) { From ca5a400dbe52efd6856f1264b7199cac77286e63 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 16 May 2019 22:08:33 +0200 Subject: [PATCH 2/2] input/buffered: rethrow read_error in Check() --- src/input/BufferedInputStream.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/input/BufferedInputStream.cxx b/src/input/BufferedInputStream.cxx index 69fb0c064..4c8374bd9 100644 --- a/src/input/BufferedInputStream.cxx +++ b/src/input/BufferedInputStream.cxx @@ -59,6 +59,9 @@ BufferedInputStream::~BufferedInputStream() noexcept void BufferedInputStream::Check() { + if (read_error) + std::rethrow_exception(read_error); + if (input) input->Check(); }