aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/plugins/CurlInputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-05-11 15:34:48 +0200
committerMax Kellermann <max@duempel.org>2014-05-11 15:34:48 +0200
commit6773adc7716eea7656c4590b54f7c99840ff4087 (patch)
treeb71756798018721f3aa472ce1b81aa14e84239b8 /src/input/plugins/CurlInputPlugin.cxx
parentee2afb35dd715d9f34a938cd54ed02a3c0091a78 (diff)
downloadmpd-6773adc7716eea7656c4590b54f7c99840ff4087.tar.gz
mpd-6773adc7716eea7656c4590b54f7c99840ff4087.tar.xz
mpd-6773adc7716eea7656c4590b54f7c99840ff4087.zip
InputStream: convert to class
Diffstat (limited to '')
-rw-r--r--src/input/plugins/CurlInputPlugin.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx
index 37509e998..5f8b9150a 100644
--- a/src/input/plugins/CurlInputPlugin.cxx
+++ b/src/input/plugins/CurlInputPlugin.cxx
@@ -497,8 +497,7 @@ CurlInputStream::RequestDone(CURLcode result, long status)
status);
}
- base.ready = true;
- base.cond.broadcast();
+ base.SetReady();
}
static void
@@ -833,7 +832,7 @@ CurlInputStream::HeaderReceived(const char *name, std::string &&value)
} else if (StringEqualsCaseASCII(name, "content-length")) {
base.size = base.offset + ParseUint64(value.c_str());
} else if (StringEqualsCaseASCII(name, "content-type")) {
- base.mime = std::move(value);
+ base.SetMimeType(std::move(value));
} else if (StringEqualsCaseASCII(name, "icy-name") ||
StringEqualsCaseASCII(name, "ice-name") ||
StringEqualsCaseASCII(name, "x-audiocast-name")) {
@@ -987,7 +986,7 @@ CurlInputStream::InitEasy(Error &error)
curl_easy_setopt(easy, CURLOPT_PROXYUSERPWD, proxy_auth_str);
}
- CURLcode code = curl_easy_setopt(easy, CURLOPT_URL, base.uri.c_str());
+ CURLcode code = curl_easy_setopt(easy, CURLOPT_URL, base.GetURI());
if (code != CURLE_OK) {
error.Format(curl_domain, code,
"curl_easy_setopt() failed: %s",
@@ -1091,9 +1090,7 @@ CurlInputStream::Seek(InputPlugin::offset_type offset, int whence,
return false;
base.mutex.lock();
-
- while (!base.ready)
- base.cond.wait(base.mutex);
+ base.WaitReady();
if (postponed_error.IsDefined()) {
error = std::move(postponed_error);