From 59eaa4c221b8859d839017807c90c04436de7796 Mon Sep 17 00:00:00 2001
From: Joshua Gigg <giggsey@gmail.com>
Date: Fri, 4 Sep 2020 11:29:02 +0100
Subject: [PATCH] Don't remove the old file if the extension changes

Avoids any chance of a race condition removing a file that is about to be played
---
 src/mod/applications/mod_httapi/mod_httapi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c
index 985d85aca9..28c892d206 100644
--- a/src/mod/applications/mod_httapi/mod_httapi.c
+++ b/src/mod/applications/mod_httapi/mod_httapi.c
@@ -2823,7 +2823,6 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char
 			 * Update the cache_file path and delete the original file
 			 */
 			ext = newext;
-			unlink(context->cache_file);
 			context->cache_file = switch_core_sprintf(context->pool, "%s.%s", context->cache_file_base, newext);
 		}