diff --git a/src/client/http/Request.cpp b/src/client/http/Request.cpp index 946e659a8..e4afe4b56 100644 --- a/src/client/http/Request.cpp +++ b/src/client/http/Request.cpp @@ -159,6 +159,9 @@ namespace http curl_easy_setopt(easy, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(easy, CURLOPT_MAXREDIRS, 10L); + curl_easy_setopt(easy, CURLOPT_ERRORBUFFER, error_buffer); + error_buffer[0] = 0; + curl_easy_setopt(easy, CURLOPT_TIMEOUT, timeout); curl_easy_setopt(easy, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(easy, CURLOPT_URL, uri.c_str()); diff --git a/src/client/http/Request.h b/src/client/http/Request.h index 53e486464..fe8478518 100644 --- a/src/client/http/Request.h +++ b/src/client/http/Request.h @@ -25,6 +25,7 @@ namespace http ByteString response_body; CURL *easy; + char error_buffer[CURL_ERROR_SIZE]; volatile curl_off_t rm_total; volatile curl_off_t rm_done; diff --git a/src/client/http/RequestManager.cpp b/src/client/http/RequestManager.cpp index f3330cf56..00295b4a4 100644 --- a/src/client/http/RequestManager.cpp +++ b/src/client/http/RequestManager.cpp @@ -3,6 +3,8 @@ #include "Config.h" #include "Platform.h" +#include + const int curl_multi_wait_timeout_ms = 100; const long curl_max_host_connections = 6; @@ -142,6 +144,11 @@ namespace http break; } + if (finish_with >= 600) + { + std::cerr << request->error_buffer << std::endl; + } + request->status = finish_with; } };