summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/process_url.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/process_url.c b/src/process_url.c
index 9b1fa86..135c181 100644
--- a/src/process_url.c
+++ b/src/process_url.c
@@ -387,7 +387,6 @@ static int merge_and_cleanup(curl_conf_t **p_curl_c) {
}
append_log("Download %s finished.\n", curl_conf->outfn);
// Reset stat
- corrupted = false;
curl_c->success_thrd = 0;
curl_c->total_thrd = 0;
free_and_nullify((void **)&curl_c->URL);
@@ -544,11 +543,12 @@ void poll_status(status_t *stat) {
}
merge_and_cleanup(&curl_conf);
// Perform the callback
- if (is_empty_queue(&dl_queue) && callback_g) {
+ if (is_empty_queue(&dl_queue) && callback_g && !corrupted) {
thrd_t cb_thrd;
thrd_create(&cb_thrd, callback_g, p_callback_struct_g);
thrd_detach(cb_thrd);
}
+ corrupted = false;
}
mtx_unlock(&mtx);
}