diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-01-29 09:36:18 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-01-29 09:36:18 -0500 |
commit | f994e72eb3a80c629060c3e1f448b304b58b7844 (patch) | |
tree | 90abd5f0888f565c7d0cff6a8abb5f6974f2114e /difference.cpp | |
parent | 4a80d9699abd48aaaa84ea7fd5d74f88d504ee30 (diff) | |
download | difference-f994e72eb3a80c629060c3e1f448b304b58b7844.tar.gz difference-f994e72eb3a80c629060c3e1f448b304b58b7844.tar.bz2 difference-f994e72eb3a80c629060c3e1f448b304b58b7844.zip |
Added timeout to image downloads
Diffstat (limited to 'difference.cpp')
-rw-r--r-- | difference.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/difference.cpp b/difference.cpp index 9fd3320..9c060d4 100644 --- a/difference.cpp +++ b/difference.cpp | |||
@@ -165,6 +165,8 @@ std::pair<Magick::Image, Magick::Image> | |||
165 | curl::curl_easy lsthandle(lstios); | 165 | curl::curl_easy lsthandle(lstios); |
166 | std::string lsturl = pictured.getNotion().getImageNetUrl(); | 166 | std::string lsturl = pictured.getNotion().getImageNetUrl(); |
167 | lsthandle.add<CURLOPT_URL>(lsturl.c_str()); | 167 | lsthandle.add<CURLOPT_URL>(lsturl.c_str()); |
168 | lsthandle.add<CURLOPT_CONNECTTIMEOUT>(30); | ||
169 | lsthandle.add<CURLOPT_TIMEOUT>(300); | ||
168 | 170 | ||
169 | try | 171 | try |
170 | { | 172 | { |
@@ -277,6 +279,7 @@ Magick::Image difference::getImageAtUrl(std::string url) const | |||
277 | imghandle.add<CURLOPT_HTTPHEADER>(headers.get()); | 279 | imghandle.add<CURLOPT_HTTPHEADER>(headers.get()); |
278 | imghandle.add<CURLOPT_URL>(url.c_str()); | 280 | imghandle.add<CURLOPT_URL>(url.c_str()); |
279 | imghandle.add<CURLOPT_CONNECTTIMEOUT>(30); | 281 | imghandle.add<CURLOPT_CONNECTTIMEOUT>(30); |
282 | imghandle.add<CURLOPT_TIMEOUT>(300); | ||
280 | 283 | ||
281 | try | 284 | try |
282 | { | 285 | { |