summaryrefslogtreecommitdiff
path: root/plugins/vfs_curl
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-31 22:06:22 +0200
committerGravatar waker <wakeroid@gmail.com>2011-03-31 22:06:22 +0200
commit5c2f94c8bfa7b98b3c832d0ce11c6ecdbd474029 (patch)
treeeb92ff856f530485809ee0e2e0710f56f8d0155b /plugins/vfs_curl
parent57de90e3b8958b4d5edf1bd0145f98623768caa9 (diff)
thread-safe config access
Diffstat (limited to 'plugins/vfs_curl')
-rw-r--r--plugins/vfs_curl/vfs_curl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c
index 5a2d4ddd..528b3809 100644
--- a/plugins/vfs_curl/vfs_curl.c
+++ b/plugins/vfs_curl/vfs_curl.c
@@ -558,9 +558,10 @@ http_thread_func (void *ctx) {
curl_easy_setopt (curl, CURLOPT_RESUME_FROM, fp->pos);
}
if (deadbeef->conf_get_int ("network.proxy", 0)) {
- curl_easy_setopt (curl, CURLOPT_PROXY, deadbeef->conf_get_str ("network.proxy.address", ""));
+ deadbeef->conf_lock ();
+ curl_easy_setopt (curl, CURLOPT_PROXY, deadbeef->conf_get_str_fast ("network.proxy.address", ""));
curl_easy_setopt (curl, CURLOPT_PROXYPORT, deadbeef->conf_get_int ("network.proxy.port", 8080));
- const char *type = deadbeef->conf_get_str ("network.proxy.type", "HTTP");
+ const char *type = deadbeef->conf_get_str_fast ("network.proxy.type", "HTTP");
int curlproxytype = CURLPROXY_HTTP;
if (!strcasecmp (type, "HTTP")) {
curlproxytype = CURLPROXY_HTTP;
@@ -588,8 +589,8 @@ http_thread_func (void *ctx) {
#endif
curl_easy_setopt (curl, CURLOPT_PROXYTYPE, curlproxytype);
- const char *proxyuser = deadbeef->conf_get_str ("network.proxy.username", "");
- const char *proxypass = deadbeef->conf_get_str ("network.proxy.password", "");
+ const char *proxyuser = deadbeef->conf_get_str_fast ("network.proxy.username", "");
+ const char *proxypass = deadbeef->conf_get_str_fast ("network.proxy.password", "");
if (*proxyuser || *proxypass) {
#if LIBCURL_VERSION_MINOR >= 19 && LIBCURL_VERSION_PATCH >= 1
curl_easy_setopt (curl, CURLOPT_PROXYUSERNAME, proxyuser);
@@ -600,6 +601,7 @@ http_thread_func (void *ctx) {
curl_easy_setopt (curl, CURLOPT_PROXYUSERPWD, pwd);
#endif
}
+ deadbeef->conf_unlock ();
}
// fp->status = STATUS_INITIAL;
trace ("vfs_curl: calling curl_easy_perform (status=%d)...\n", fp->status);