# HG changeset patch # User Sebastien Jodogne # Date 1560757485 -7200 # Node ID 6add197274b1a8fede4206038f6be96c78841b2a # Parent 3ff4f07806ebfccc617d7518d119006af2f89c4f default value of HttpTimeout is now 60 seconds diff -r 3ff4f07806eb -r 6add197274b1 Core/HttpClient.cpp --- a/Core/HttpClient.cpp Sat Jun 15 18:06:08 2019 +0000 +++ b/Core/HttpClient.cpp Mon Jun 17 09:44:45 2019 +0200 @@ -46,6 +46,10 @@ #include +// Default timeout = 60 seconds (in Orthanc <= 1.5.6, it was 10 seconds) +static const unsigned int DEFAULT_HTTP_TIMEOUT = 60; + + #if ORTHANC_ENABLE_PKCS11 == 1 # include "Pkcs11.h" #endif @@ -818,8 +822,8 @@ // Set timeouts if (timeout_ <= 0) { - CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_TIMEOUT, 10)); /* default: 10 seconds */ - CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CONNECTTIMEOUT, 10)); /* default: 10 seconds */ + CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_TIMEOUT, DEFAULT_HTTP_TIMEOUT)); + CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CONNECTTIMEOUT, DEFAULT_HTTP_TIMEOUT)); } else { diff -r 3ff4f07806eb -r 6add197274b1 NEWS --- a/NEWS Sat Jun 15 18:06:08 2019 +0000 +++ b/NEWS Mon Jun 17 09:44:45 2019 +0200 @@ -24,6 +24,7 @@ * Anonymization: Preserve hierarchical relationships in (0008,1115) [] (0020,000e) * Allow the serialization of signed 16bpp images in PAM format * HTTP header "Accept-Encoding" is honored for streams without built-in support for compression +* The default HTTP timeout is now 60 seconds (instead of 10 seconds in previous versions) * Fix issue #136 (C-FIND request fails when found DICOM file does not have certain tags) * Fix issue #137 (C-STORE fails for unknown SOP Class although server is configured to accept any) * Fix issue #138 (POST to modalities/{name} accepts invalid characters) diff -r 3ff4f07806eb -r 6add197274b1 OrthancServer/main.cpp --- a/OrthancServer/main.cpp Sat Jun 15 18:06:08 2019 +0000 +++ b/OrthancServer/main.cpp Mon Jun 17 09:44:45 2019 +0200 @@ -1117,7 +1117,11 @@ lock.GetConfiguration().InterpretStringParameterAsPath (lock.GetConfiguration().GetStringParameter("HttpsCACertificates", ""))); HttpClient::SetDefaultVerbose(lock.GetConfiguration().GetBooleanParameter("HttpVerbose", false)); + + // The value "0" below makes the class HttpClient use its default + // value (DEFAULT_HTTP_TIMEOUT = 60 seconds in Orthanc 1.5.7) HttpClient::SetDefaultTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("HttpTimeout", 0)); + HttpClient::SetDefaultProxy(lock.GetConfiguration().GetStringParameter("HttpProxy", "")); DicomUserConnection::SetDefaultTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScuTimeout", 10));