From 40c750fac90f508799005f6e15d3f06a95acfd43 Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Sat, 4 Sep 2021 13:37:45 +0100 Subject: [PATCH] moved the location of error string --- src/network.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/network.c b/src/network.c index b45cf37..6d9d03b 100644 --- a/src/network.c +++ b/src/network.c @@ -285,15 +285,14 @@ void transfer_blocking(CURL *curl) PTHREAD_MUTEX_LOCK(&transfer_lock); CURLMcode res = curl_multi_add_handle(curl_multi, curl); + if (res > 0) { + lprintf(error, "%d, %s\n", res, curl_multi_strerror(res)); + } lprintf(network_lock_debug, "thread %x: unlocking transfer_lock;\n", pthread_self()); PTHREAD_MUTEX_UNLOCK(&transfer_lock); - if (res > 0) { - lprintf(error, "%d, %s\n", res, curl_multi_strerror(res)); - } - while (ts->transferring) { curl_multi_perform_once(); } @@ -306,14 +305,13 @@ void transfer_nonblocking(CURL *curl) PTHREAD_MUTEX_LOCK(&transfer_lock); CURLMcode res = curl_multi_add_handle(curl_multi, curl); + if (res > 0) { + lprintf(error, "%s\n", curl_multi_strerror(res)); + } lprintf(network_lock_debug, "thread %x: unlocking transfer_lock;\n", pthread_self()); PTHREAD_MUTEX_UNLOCK(&transfer_lock); - - if (res > 0) { - lprintf(error, "%s\n", curl_multi_strerror(res)); - } } int HTTP_temp_failure(HTTPResponseCode http_resp)