Skip to content

Commit

Permalink
Merge pull request #5513 from leoetlino/dns-timeout
Browse files Browse the repository at this point in the history
Analytics: Don't crash when a DNS resolve times out
  • Loading branch information
Tilka committed Jun 4, 2017
2 parents 0e6bd74 + 74f636d commit 78c0e8c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/Core/Common/Analytics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 78c0e8c

Please sign in to comment.