diff options
author | waker <wakeroid@gmail.com> | 2011-02-14 20:05:51 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-02-14 20:32:22 +0100 |
commit | b1368454eaa75d734b15793b218f6fbb78e65f5b (patch) | |
tree | f2f4a4ec127f41d4ae2e0435d7cf1cbfd6e5e342 | |
parent | 675c85585e2e79416604f6ed6b5c95ff3fafa64c (diff) |
fixed vfs_curl stream status after handling abort signal
-rw-r--r-- | plugins/vfs_curl/vfs_curl.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c index 76598ed8..f9534299 100644 --- a/plugins/vfs_curl/vfs_curl.c +++ b/plugins/vfs_curl/vfs_curl.c @@ -626,10 +626,12 @@ http_thread_func (void *ctx) { continue; } if (fp->status != STATUS_SEEK) { + trace ("vfs_curl: break loop\n"); deadbeef->mutex_unlock (fp->mutex); break; } else { + trace ("vfs_curl: restart loop\n"); fp->skipbytes = 0; fp->status = STATUS_INITIAL; trace ("seeking to %d\n", fp->pos); @@ -657,12 +659,13 @@ http_thread_func (void *ctx) { deadbeef->mutex_lock (fp->mutex); if (fp->status == STATUS_ABORTED) { -// http_destroy (fp); - return; + trace ("vfs_curl: thread ended due to abort signal\n"); + } + else { + trace ("vfs_curl: thread ended normally\n"); } fp->status = STATUS_FINISHED; deadbeef->mutex_unlock (fp->mutex); - // fp->tid = 0; } static void @@ -729,7 +732,7 @@ http_read (void *ptr, size_t size, size_t nmemb, DB_FILE *stream) { { // wait until data is available while ((fp->remaining == 0 || fp->skipbytes > 0) && fp->status != STATUS_FINISHED) { -// trace ("vfs_curl: readwait..\n"); + trace ("vfs_curl: readwait, status: %d..\n", fp->status); deadbeef->mutex_lock (fp->mutex); if (fp->status == STATUS_READING) { struct timeval tm; |