summary refs log tree commit diff stats
path: root/grunge.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-03-13 16:39:39 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-03-13 16:39:39 -0400
commit31a8d2f8541384cfecfecfa5b872edb424b1ec14 (patch)
tree72a2debbe0086bfd1723fe7bc4fec2f85fef9621 /grunge.cpp
parent4c18bf69e2816729b8bbdfe45b923ffa41565f18 (diff)
downloadgrunge-31a8d2f8541384cfecfecfa5b872edb424b1ec14.tar.gz
grunge-31a8d2f8541384cfecfecfa5b872edb424b1ec14.tar.bz2
grunge-31a8d2f8541384cfecfecfa5b872edb424b1ec14.zip
Added timeout to image downloads
Diffstat (limited to 'grunge.cpp')
-rw-r--r--grunge.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/grunge.cpp b/grunge.cpp index 251be99..bc3c560 100644 --- a/grunge.cpp +++ b/grunge.cpp
@@ -158,6 +158,8 @@ Magick::Image grunge::getImageForNoun(verbly::word pictured) const
158 curl::curl_easy lsthandle(lstios); 158 curl::curl_easy lsthandle(lstios);
159 std::string lsturl = pictured.getNotion().getImageNetUrl(); 159 std::string lsturl = pictured.getNotion().getImageNetUrl();
160 lsthandle.add<CURLOPT_URL>(lsturl.c_str()); 160 lsthandle.add<CURLOPT_URL>(lsturl.c_str());
161 lsthandle.add<CURLOPT_CONNECTTIMEOUT>(30);
162 lsthandle.add<CURLOPT_TIMEOUT>(300);
161 163
162 try 164 try
163 { 165 {
@@ -215,6 +217,7 @@ Magick::Image grunge::getImageForNoun(verbly::word pictured) const
215 imghandle.add<CURLOPT_HTTPHEADER>(headers.get()); 217 imghandle.add<CURLOPT_HTTPHEADER>(headers.get());
216 imghandle.add<CURLOPT_URL>(url.c_str()); 218 imghandle.add<CURLOPT_URL>(url.c_str());
217 imghandle.add<CURLOPT_CONNECTTIMEOUT>(30); 219 imghandle.add<CURLOPT_CONNECTTIMEOUT>(30);
220 imghandle.add<CURLOPT_TIMEOUT>(300);
218 221
219 try 222 try
220 { 223 {