summaryrefslogtreecommitdiff
path: root/plugins/vfs_curl
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-14 22:22:05 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-14 22:22:05 +0200
commit6c6a435e96b2064337357120a7e88ba7e685eb48 (patch)
tree3d8c8fe87dba076f4126945220e99aaa7bcf4691 /plugins/vfs_curl
parenta0099b998c6c8c546b7c5e72258f8eec2bfd0150 (diff)
fix possible vfs_curl segfault on abort request
Diffstat (limited to 'plugins/vfs_curl')
-rw-r--r--plugins/vfs_curl/vfs_curl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c
index e4fbd651..22b00216 100644
--- a/plugins/vfs_curl/vfs_curl.c
+++ b/plugins/vfs_curl/vfs_curl.c
@@ -435,6 +435,7 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream)
static int
http_curl_control (void *stream, double dltotal, double dlnow, double ultotal, double ulnow) {
HTTP_FILE *fp = (HTTP_FILE *)stream;
+ deadbeef->mutex_lock (fp->mutex);
struct timeval tm;
gettimeofday (&tm, NULL);
@@ -450,12 +451,15 @@ http_curl_control (void *stream, double dltotal, double dlnow, double ultotal, d
}
else if (fp->status == STATUS_SEEK) {
trace ("vfs_curl STATUS_SEEK in progress callback\n");
+ deadbeef->mutex_unlock (fp->mutex);
return -1;
}
if (fp->status == STATUS_ABORTED) {
trace ("vfs_curl STATUS_ABORTED in progress callback\n");
+ deadbeef->mutex_unlock (fp->mutex);
return -1;
}
+ deadbeef->mutex_unlock (fp->mutex);
return 0;
}