diff options
author | Johannes Winkelmann <jw@smts.ch> | 2006-02-23 14:18:42 +0000 |
---|---|---|
committer | Johannes Winkelmann <jw@smts.ch> | 2006-02-23 14:18:42 +0000 |
commit | b103cf5e680227d5214faba552fd6be8367a00aa (patch) | |
tree | 291fddef8614ca8e2d7076c194c2c83d4f54a0a9 /httpup.cpp | |
parent | 18c22c5a414a8beeac0d958ab39589c883ab06d4 (diff) | |
download | httpup-b103cf5e680227d5214faba552fd6be8367a00aa.tar.gz httpup-b103cf5e680227d5214faba552fd6be8367a00aa.tar.xz |
httpup: sync with bzr repo (0.4.0g)
Diffstat (limited to 'httpup.cpp')
-rw-r--r-- | httpup.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -27,6 +27,7 @@ const string HttpUp::REPOCURRENTFILEOLD = "REPO.CURRENT"; const string HttpUp::REPOCURRENTFILE = ".httpup-repo.current"; const string HttpUp::URLINFO = ".httpup-urlinfo"; +const int HttpUp::DEFAULT_TIMEOUT = 60; HttpUp::HttpUp(const HttpupArgparser& argParser, const string& url, const string& target, @@ -227,8 +228,18 @@ int HttpUp::exec(ExecType type) curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer); curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30); + long timeout = DEFAULT_TIMEOUT; + if (config.operationTimeout != "") { + char* end = 0; + long config_timeout = 0; + config_timeout = strtol(config.operationTimeout.c_str(), &end, 10); + if (*end == 0) { + timeout = config_timeout; + } + } + curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); + // proxy, proxy auth if (config.proxyHost != "") { |