#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);
}
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)
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)