diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-09-02 22:57:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-09-02 22:57:44 +0100 |
| commit | 0390c42a7fc648a116ac3fd0417eac92dfe79f6d (patch) | |
| tree | 987ab31b4e47654b5fa9d53b8eb229b5e1e1a6ee /src/lib/internet.cc | |
| parent | 8407612363705f757d3ab26d6e119171c217b00a (diff) | |
Add a reasonably low timeout to curl fetches.
Diffstat (limited to 'src/lib/internet.cc')
| -rw-r--r-- | src/lib/internet.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/internet.cc b/src/lib/internet.cc index c28e650fd..1c61e96e3 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -56,6 +56,8 @@ get_from_zip_url (string url, string file, function<void (boost::filesystem::pat curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, get_from_zip_url_data); curl_easy_setopt (curl, CURLOPT_WRITEDATA, f); curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV, 0); + /* Maximum time is 20s */ + curl_easy_setopt (curl, CURLOPT_TIMEOUT, 20); CURLcode const cr = curl_easy_perform (curl); @@ -117,6 +119,8 @@ ftp_ls (string url) url += "/"; } curl_easy_setopt (curl, CURLOPT_URL, url.c_str ()); + /* 20s timeout */ + curl_easy_setopt (curl, CURLOPT_TIMEOUT, 20); string ls_raw; struct curl_slist* commands = 0; |
