mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
Merge "main/file.c: Limit media cache usage to remote files." into 16
This commit is contained in:
@@ -640,6 +640,11 @@ static int is_absolute_path(const char *filename)
|
|||||||
return filename[0] == '/';
|
return filename[0] == '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int is_remote_path(const char *filename)
|
||||||
|
{
|
||||||
|
return strstr(filename, "://") ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief test if a file exists for a given format.
|
* \brief test if a file exists for a given format.
|
||||||
* \note result_cap is OPTIONAL
|
* \note result_cap is OPTIONAL
|
||||||
@@ -653,7 +658,7 @@ static int fileexists_test(const char *filename, const char *fmt, const char *la
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ast_media_cache_retrieve(filename, NULL, buf, buflen)) {
|
if (is_remote_path(filename) && !ast_media_cache_retrieve(filename, NULL, buf, buflen)) {
|
||||||
return filehelper(buf, result_cap, NULL, ACTION_EXISTS);
|
return filehelper(buf, result_cap, NULL, ACTION_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user