mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 08:29:45 +00:00
[mod_http_cache] Set binary mode when downloading files in Windows
This commit is contained in:
parent
040416b8db
commit
243421c8fe
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
* Copyright (C) 2005-2016, Anthony Minessale II <anthm@freeswitch.org>
|
* Copyright (C) 2005-2020, Anthony Minessale II <anthm@freeswitch.org>
|
||||||
*
|
*
|
||||||
* Version: MPL 1.1
|
* Version: MPL 1.1
|
||||||
*
|
*
|
||||||
@ -1124,7 +1124,11 @@ static switch_status_t http_get(url_cache_t *cache, http_profile_t *profile, cac
|
|||||||
|
|
||||||
curl_handle = switch_curl_easy_init();
|
curl_handle = switch_curl_easy_init();
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "opening %s for URL cache\n", get_data.url->filename);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "opening %s for URL cache\n", get_data.url->filename);
|
||||||
|
#ifdef WIN32
|
||||||
|
if ((get_data.fd = open(get_data.url->filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR | O_BINARY)) > -1) {
|
||||||
|
#else
|
||||||
if ((get_data.fd = open(get_data.url->filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
|
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_FOLLOWLOCATION, 1);
|
||||||
switch_curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10);
|
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_FAILONERROR, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user