diff options
| author | Tilka <tilkax@gmail.com> | 2017-06-04 01:21:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-04 01:21:44 +0100 |
| commit | 78c0e8c80989a553806edc95da10ebc724750ccb (patch) | |
| tree | 319859c4c0028b978e5df7bf4db7ce1981d408ca /Source/Core/Common/Analytics.cpp | |
| parent | 0e6bd74ed626dd25a85682b90426c26cb10d6a16 (diff) | |
| parent | 74f636dfc41dee460b9f70adee063ee59166cef6 (diff) | |
Merge pull request #5513 from leoetlino/dns-timeout
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.cpp | 3 |
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); |
