aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-05-21 19:00:47 +0200
committerMax Kellermann <max@duempel.org>2014-05-21 19:00:47 +0200
commit49695d47d3a55c5e184da3022acfc4b4755809ff (patch)
treed2b24b982aa38f6e55cec1af0cb3dad967105c40 /src
parent5cec477131fa9223977d590cb4fc4a98a06732ba (diff)
downloadmpd-49695d47d3a55c5e184da3022acfc4b4755809ff.tar.gz
mpd-49695d47d3a55c5e184da3022acfc4b4755809ff.tar.xz
mpd-49695d47d3a55c5e184da3022acfc4b4755809ff.zip
input/curl: relock mutex in error paths
Diffstat (limited to 'src')
-rw-r--r--src/input/plugins/CurlInputPlugin.cxx9
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();