Skip to content

Commit eb58753

Browse files
authored
Merge pull request #157 from djw8605/add-curlopt-nosignal
Set CURLOPT_NOSIGNAL option in SimpleCurlGet to prevent signal interruptions
2 parents fcaa3b3 + 0b3181c commit eb58753

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/scitokens_internal.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ 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+
}
8388

8489
auto ca_file = configurer::Configuration::get_tls_ca_file();
8590
if (!ca_file.empty()) {

0 commit comments

Comments
 (0)