]> git.ipfire.org Git - thirdparty/asterisk.git/commit
main/file.c: Limit media cache usage to remote files.
authorKevin Reeves <kevin@phoneburner.com>
Thu, 21 Nov 2019 18:48:42 +0000 (12:48 -0600)
committerKevin Reeves <kevin@phoneburner.com>
Thu, 21 Nov 2019 18:48:42 +0000 (12:48 -0600)
commite013f502b1b5abda167206a3ec2dbe50ff59a585
treeb61945fc4e6a033b7c8e2fa0d1253a974ed14a3a
parent7574be5110e049a44b8c8ead52cd1c2a5d442afa
main/file.c: Limit media cache usage to remote files.

When testing for the existance of a file, the media cache is searched even if
the file has no chance of being in it.  This can cause performance issues
as the media cache size increases.

As a result, calls to applications like Read and Playback using local files
must scan through the media cache before playing.  Under load and with a
large cache, this can delay the playback of those files.

This patch updates the function that checks for the existance of a file to
only consult the media cache database if the requested file is a remote path.
It introduces a new is_remote_path() function in main/file.c.

ASTERISK-28625  #close
Reported-by: kevin@phoneburner.com
Change-Id: If91137493732d9034dafa381c081c69274a7dcc9
main/file.c