summaryrefslogtreecommitdiff
path: root/src/lib/update_checker.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-03-30 01:25:25 +0200
committerCarl Hetherington <cth@carlh.net>2023-03-30 01:25:25 +0200
commit0fab37d3b61eb150b3de4a4000b8156e6e53574b (patch)
tree52bd6813733b2bfcc9a818bae96c2735028fe23f /src/lib/update_checker.cc
parentab09ce82e22e62e6142c7edb67c96c8b3b80179c (diff)
Use CURLOPT_NOSIGNAL to fix crashes on update check (#2495).
Without this, it's possible to come back from curl_easy_perform in a different thread to the one that it was called from (in the case of an error). As I understand it, this happens because a signal handler is called (from a different thread) and CURLOPT_NOSIGNAL stops this from happening.
Diffstat (limited to 'src/lib/update_checker.cc')
-rw-r--r--src/lib/update_checker.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/update_checker.cc b/src/lib/update_checker.cc
index 2c2e23be1..3897b81d8 100644
--- a/src/lib/update_checker.cc
+++ b/src/lib/update_checker.cc
@@ -66,6 +66,7 @@ UpdateChecker::UpdateChecker ()
curl_easy_setopt (_curl, CURLOPT_WRITEFUNCTION, write_callback_wrapper);
curl_easy_setopt (_curl, CURLOPT_WRITEDATA, this);
curl_easy_setopt (_curl, CURLOPT_TIMEOUT, 20);
+ curl_easy_setopt (_curl, CURLOPT_NOSIGNAL, 1L);
string const agent = "dcpomatic/" + string (dcpomatic_version);
curl_easy_setopt (_curl, CURLOPT_USERAGENT, agent.c_str ());