This commit is contained in:
Andrey Volk
2025-07-12 16:21:58 +00:00
parent 5135a4553e
commit 79eb2abe14
3 changed files with 12 additions and 6 deletions

View File

@@ -1131,10 +1131,10 @@ static switch_status_t http_get(url_cache_t *cache, http_profile_t *profile, cac
#else
if ((get_data.fd = open(get_data.url->filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
#endif
switch_curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
switch_curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10);
switch_curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, 1);
switch_curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
switch_curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, (long)1);
switch_curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, (long)10);
switch_curl_easy_setopt(curl_handle, CURLOPT_FAILONERROR, (long)1);
switch_curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, (long)1);
if (headers) {
switch_curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers);
}

View File

@@ -488,9 +488,15 @@ static void myErrorHandler(const ExceptionType t, const char *reason, const char
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s: %s\n", reason, description);
}
static void myFatalErrorHandler(const ExceptionType t, const char *reason, const char *description)
static
#if defined(_MSC_VER) && defined(_WIN32)
#else
__attribute__((noreturn))
#endif
void myFatalErrorHandler(const ExceptionType t, const char *reason, const char *description)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "%s: %s\n", reason, description);
abort();
}
static void myWarningHandler(const ExceptionType t, const char *reason, const char *description)

View File

@@ -45,7 +45,7 @@ SWITCH_DECLARE(void) switch_curl_slist_free_all(switch_curl_slist_t * list)
SWITCH_DECLARE(const char *) switch_curl_easy_strerror(switch_CURLcode errornum )
{
return curl_easy_strerror(errornum);
return curl_easy_strerror((CURLcode)errornum);
}
SWITCH_DECLARE(void) switch_curl_init(void)