fix caching files as binary on windows (e.g. when using WAV files)

This commit is contained in:
Kurt Kiessling 2024-01-22 15:04:02 +01:00
parent d3c60820d7
commit eedd1d086b
1 changed files with 4 additions and 0 deletions

View File

@ -2501,7 +2501,11 @@ static switch_status_t fetch_cache_data(http_file_context_t *context, const char
if (save_path) { if (save_path) {
while(--tries && (client->fd == 0 || client->fd == -1)) { while(--tries && (client->fd == 0 || client->fd == -1)) {
#ifdef WIN32
client->fd = open(save_path, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, S_IRUSR | S_IWUSR);
#else
client->fd = open(save_path, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR); client->fd = open(save_path, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR);
#endif
} }
if (client->fd < 0) { if (client->fd < 0) {