kopia lustrzana https://gitlab.com/tomaszg/geostat
Add timeout of 5s to Okapi connections
rodzic
120f083749
commit
f13f9782a1
|
@ -58,10 +58,11 @@ std::string Okapi::curl_post(const std::string& url, const std::string& post) co
|
|||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&output);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK) {
|
||||
Debug(1) << "curl_easy_perform() failed: " << curl_easy_strerror(res) << '\n';
|
||||
Debug(1) << "Connection failed: " << curl_easy_strerror(res) << '\n';
|
||||
curl_easy_cleanup(curl);
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue