Skip to content

Commit 33d78ab

Browse files
committed
Set CURLOPT_NOSIGNAL option in SimpleCurlGet to prevent signal interruptions
Fixes #148
1 parent fcaa3b3 commit 33d78ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/scitokens_internal.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ SimpleCurlGet::GetStatus SimpleCurlGet::perform_start(const std::string &url) {
8080
if (rv != CURLE_OK) {
8181
throw CurlException("Failed to set CURLOPT_FOLLOWLOCATION.");
8282
}
83+
// Disable signal handling to avoid issues in multi-threaded contexts.
84+
rv = curl_easy_setopt(m_curl.get(), CURLOPT_NOSIGNAL, 1L);
85+
if (rv != CURLE_OK) {
86+
throw CurlException("Failed to set CURLOPT_NOSIGNAL.");
87+
}
88+
8389

8490
auto ca_file = configurer::Configuration::get_tls_ca_file();
8591
if (!ca_file.empty()) {

0 commit comments

Comments
 (0)