# HG changeset patch # User Alain Mazy # Date 1665559328 -7200 # Node ID b52fe770aec0a40ff0b0d1b20d8d0cd93223cc63 # Parent cc1a8b3ff319e70b7de82561e7d2a93296d83da9 more logs in HttpClient diff -r cc1a8b3ff319 -r b52fe770aec0 OrthancFramework/Sources/HttpClient.cpp --- a/OrthancFramework/Sources/HttpClient.cpp Fri Sep 30 15:17:21 2022 +0200 +++ b/OrthancFramework/Sources/HttpClient.cpp Wed Oct 12 09:22:08 2022 +0200 @@ -46,7 +46,7 @@ extern "C" { - static CURLcode GetHttpStatus(CURLcode code, CURL* curl, long* status) + static CURLcode GetHttpStatus(CURLcode code, CURL* curl, long* status, const std::string& url) { if (code == CURLE_OK) { @@ -56,7 +56,8 @@ else { LOG(ERROR) << "Error code " << static_cast(code) - << " in libcurl: " << curl_easy_strerror(code); + << " in libcurl: " << curl_easy_strerror(code) + << " while accessing url: " << url; *status = 0; return code; } @@ -68,10 +69,10 @@ #if defined(__GNUC__) || defined(__clang__) __attribute__((noinline)) #endif -static CURLcode OrthancHttpClientPerformSSL(CURL* curl, long* status) +static CURLcode OrthancHttpClientPerformSSL(CURL* curl, long* status, const std::string& url) { #if ORTHANC_ENABLE_SSL == 1 - return GetHttpStatus(curl_easy_perform(curl), curl, status); + return GetHttpStatus(curl_easy_perform(curl), curl, status, url); #else throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, "Orthanc was compiled without SSL support, " @@ -1045,11 +1046,11 @@ if (boost::starts_with(url_, "https://")) { - code = OrthancHttpClientPerformSSL(pimpl_->curl_, &status); + code = OrthancHttpClientPerformSSL(pimpl_->curl_, &status, url_); } else { - code = GetHttpStatus(curl_easy_perform(pimpl_->curl_), pimpl_->curl_, &status); + code = GetHttpStatus(curl_easy_perform(pimpl_->curl_), pimpl_->curl_, &status, url_); } const boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();