summary refs log tree commit diff stats
path: root/capital.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-03-13 16:29:54 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-03-13 16:29:54 -0400
commite9b7b5e84ea3c6715c472ef0e6df38d6b01f93f7 (patch)
treed2c902dd79413340bedd517934f25f9df53ac313 /capital.cpp
parent2c9182a094e4c622eeff315e2532dcb1c1359cb4 (diff)
downloadcapital-e9b7b5e84ea3c6715c472ef0e6df38d6b01f93f7.tar.gz
capital-e9b7b5e84ea3c6715c472ef0e6df38d6b01f93f7.tar.bz2
capital-e9b7b5e84ea3c6715c472ef0e6df38d6b01f93f7.zip
Added timeout to image downloads
Diffstat (limited to 'capital.cpp')
-rw-r--r--capital.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/capital.cpp b/capital.cpp index 3488c1d..dd7f129 100644 --- a/capital.cpp +++ b/capital.cpp
@@ -128,6 +128,8 @@ Magick::Image capital::getImageForNoun(verbly::word pictured) const
128 curl::curl_easy lsthandle(lstios); 128 curl::curl_easy lsthandle(lstios);
129 std::string lsturl = pictured.getNotion().getImageNetUrl(); 129 std::string lsturl = pictured.getNotion().getImageNetUrl();
130 lsthandle.add<CURLOPT_URL>(lsturl.c_str()); 130 lsthandle.add<CURLOPT_URL>(lsturl.c_str());
131 lsthandle.add<CURLOPT_CONNECTTIMEOUT>(30);
132 lsthandle.add<CURLOPT_TIMEOUT>(300);
131 133
132 try 134 try
133 { 135 {
@@ -186,6 +188,7 @@ Magick::Image capital::getImageForNoun(verbly::word pictured) const
186 imghandle.add<CURLOPT_HTTPHEADER>(headers.get()); 188 imghandle.add<CURLOPT_HTTPHEADER>(headers.get());
187 imghandle.add<CURLOPT_URL>(url.c_str()); 189 imghandle.add<CURLOPT_URL>(url.c_str());
188 imghandle.add<CURLOPT_CONNECTTIMEOUT>(30); 190 imghandle.add<CURLOPT_CONNECTTIMEOUT>(30);
191 imghandle.add<CURLOPT_TIMEOUT>(300);
189 192
190 try 193 try
191 { 194 {