mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Disallow curl from using signals
If libcurl is built with the default DNS resolver then it will handle a timeout by using SIGALRM, though since we are using threads, and signals are not compatible with threads, this may have led to a crash in Curl_resolv_timeout (for users where a DNS lookup could take longer than the timeout, presumably 300 seconds).
This commit is contained in:
@@ -150,6 +150,7 @@ namespace network
|
||||
curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_easy_setopt(handle, CURLOPT_FAILONERROR, true);
|
||||
curl_easy_setopt(handle, CURLOPT_ENCODING, "");
|
||||
curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1);
|
||||
|
||||
std::string const userAgent = request._user_agent == NULL_STR ? create_agent_info_string() : request._user_agent;
|
||||
curl_easy_setopt(handle, CURLOPT_USERAGENT, userAgent.c_str());
|
||||
|
||||
@@ -131,6 +131,7 @@ namespace network
|
||||
curl_easy_setopt(handle, CURLOPT_FAILONERROR, true);
|
||||
curl_easy_setopt(handle, CURLOPT_ENCODING, "");
|
||||
curl_easy_setopt(handle, CURLOPT_USERAGENT, create_agent_info_string().c_str());
|
||||
curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1);
|
||||
|
||||
char errorbuf[CURL_ERROR_SIZE];
|
||||
curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errorbuf);
|
||||
|
||||
@@ -58,6 +58,7 @@ long post_to_server (std::string const& url, std::map<std::string, std::string>
|
||||
|
||||
curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errorbuf);
|
||||
curl_easy_setopt(handle, CURLOPT_FAILONERROR, true);
|
||||
curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1);
|
||||
|
||||
if(headersOut)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user