diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-05-14 22:22:05 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-05-14 22:22:05 +0200 |
commit | 6c6a435e96b2064337357120a7e88ba7e685eb48 (patch) | |
tree | 3d8c8fe87dba076f4126945220e99aaa7bcf4691 /plugins | |
parent | a0099b998c6c8c546b7c5e72258f8eec2bfd0150 (diff) |
fix possible vfs_curl segfault on abort request
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/artwork/artwork.c | 6 | ||||
-rw-r--r-- | plugins/vfs_curl/vfs_curl.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index da4b1a8f..ef2d0e00 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -487,9 +487,9 @@ artwork_load (DB_functions_t *api) { void artwork_reset (int fast) { if (fast) { - if (current_file) { - deadbeef->fabort (current_file); - } +// if (current_file) { +// deadbeef->fabort (current_file); +// } deadbeef->mutex_lock (mutex); while (queue && queue->next) { cover_query_t *next = queue->next->next; 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; } |