From 49695d47d3a55c5e184da3022acfc4b4755809ff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 May 2014 19:00:47 +0200 Subject: input/curl: relock mutex in error paths --- src/input/plugins/CurlInputPlugin.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/input') diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 01c3c6838..dc26e0aa2 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -955,11 +955,14 @@ CurlInputStream::Seek(InputPlugin::offset_type new_offset, int whence, /* seek to EOF: simulate empty result; avoid triggering a "416 Requested Range Not Satisfiable" response */ + mutex.lock(); return true; } - if (!InitEasy(error)) + if (!InitEasy(error)) { + mutex.lock(); return false; + } /* send the "Range" header */ @@ -970,8 +973,10 @@ CurlInputStream::Seek(InputPlugin::offset_type new_offset, int whence, ready = false; - if (!input_curl_easy_add_indirect(this, error)) + if (!input_curl_easy_add_indirect(this, error)) { + mutex.lock(); return false; + } mutex.lock(); WaitReady(); -- cgit v1.2.3