diff options
author | Max Kellermann <max@duempel.org> | 2014-05-21 19:00:47 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-05-21 19:00:47 +0200 |
commit | 49695d47d3a55c5e184da3022acfc4b4755809ff (patch) | |
tree | d2b24b982aa38f6e55cec1af0cb3dad967105c40 /src/input | |
parent | 5cec477131fa9223977d590cb4fc4a98a06732ba (diff) | |
download | mpd-49695d47d3a55c5e184da3022acfc4b4755809ff.tar.gz mpd-49695d47d3a55c5e184da3022acfc4b4755809ff.tar.xz mpd-49695d47d3a55c5e184da3022acfc4b4755809ff.zip |
input/curl: relock mutex in error paths
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/plugins/CurlInputPlugin.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
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(); |