summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Analytics.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-06-03 14:09:14 +0200
committerLéo Lam <leo@innovatetechnologi.es>2017-06-03 14:09:14 +0200
commit74f636dfc41dee460b9f70adee063ee59166cef6 (patch)
treed318c64414b18f60cea7569fe6bc3082c98e3ac8 /Source/Core/Common/Analytics.cpp
parent4af514bb3c65789b00e9c144eaf79aea4380b4fd (diff)
Analytics: Don't crash when a DNS resolve times out
Diffstat (limited to 'Source/Core/Common/Analytics.cpp')
-rw-r--r--Source/Core/Common/Analytics.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/Common/Analytics.cpp b/Source/Core/Common/Analytics.cpp
index ed9f8cf112..2761e86943 100644
--- a/Source/Core/Common/Analytics.cpp
+++ b/Source/Core/Common/Analytics.cpp
@@ -192,6 +192,9 @@ HttpAnalyticsBackend::HttpAnalyticsBackend(const std::string& endpoint)
CURL* curl = curl_easy_init();
if (curl)
{
+ // libcurl may not have been built with async DNS support, so we disable
+ // signal handlers to avoid a possible and likely crash if a resolve times out.
+ curl_easy_setopt(curl, CURLOPT_NOSIGNAL, true);
curl_easy_setopt(curl, CURLOPT_URL, endpoint.c_str());
curl_easy_setopt(curl, CURLOPT_POST, true);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &DummyCurlWriteFunction);