Mercurial > hg > orthanc
comparison Core/HttpClient.cpp @ 3428:6add197274b1
default value of HttpTimeout is now 60 seconds
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 17 Jun 2019 09:44:45 +0200 |
parents | 2cd0369a156f |
children | 96780208dbd7 |
comparison
equal
deleted
inserted
replaced
3427:3ff4f07806eb | 3428:6add197274b1 |
---|---|
44 #include <curl/curl.h> | 44 #include <curl/curl.h> |
45 #include <boost/algorithm/string/predicate.hpp> | 45 #include <boost/algorithm/string/predicate.hpp> |
46 #include <boost/thread/mutex.hpp> | 46 #include <boost/thread/mutex.hpp> |
47 | 47 |
48 | 48 |
49 // Default timeout = 60 seconds (in Orthanc <= 1.5.6, it was 10 seconds) | |
50 static const unsigned int DEFAULT_HTTP_TIMEOUT = 60; | |
51 | |
52 | |
49 #if ORTHANC_ENABLE_PKCS11 == 1 | 53 #if ORTHANC_ENABLE_PKCS11 == 1 |
50 # include "Pkcs11.h" | 54 # include "Pkcs11.h" |
51 #endif | 55 #endif |
52 | 56 |
53 | 57 |
816 } | 820 } |
817 | 821 |
818 // Set timeouts | 822 // Set timeouts |
819 if (timeout_ <= 0) | 823 if (timeout_ <= 0) |
820 { | 824 { |
821 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_TIMEOUT, 10)); /* default: 10 seconds */ | 825 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_TIMEOUT, DEFAULT_HTTP_TIMEOUT)); |
822 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CONNECTTIMEOUT, 10)); /* default: 10 seconds */ | 826 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CONNECTTIMEOUT, DEFAULT_HTTP_TIMEOUT)); |
823 } | 827 } |
824 else | 828 else |
825 { | 829 { |
826 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_TIMEOUT, timeout_)); | 830 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_TIMEOUT, timeout_)); |
827 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CONNECTTIMEOUT, timeout_)); | 831 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CONNECTTIMEOUT, timeout_)); |