]> git.ipfire.org Git - thirdparty/asterisk.git/commit
media_cache: Don't lock when curl the remote file
authorAndre Barbosa <andre.emanuel.barbosa@gmail.com>
Thu, 5 Aug 2021 16:55:33 +0000 (17:55 +0100)
committerGeorge Joseph <gjoseph@digium.com>
Fri, 20 Aug 2021 16:47:40 +0000 (11:47 -0500)
commiteb486db3af70b09c470e8d51b28f36a89fa4d3ac
tree7618af6be7f29447f1eedcb492759c8f9ff680b2
parentb72425b1f0407d1a3490589b3a13d725e8503df8
media_cache: Don't lock when curl the remote file

When playing a remote sound file, which is not in cache, first we need
to download it with ast_bucket_file_retrieve.

This can take a while if the remote host is slow. The current CURL
timeout is 180secs, so in extreme situations, it can take 3 minutes to
return.

Because ast_media_cache_retrieve has a lock on all function, while we
are waiting for the delayed download, Asterisk is not able to play any
more files, even the files already cached locally.

ASTERISK-29544 #close

Change-Id: I8d4142b463ae4a1d4c41bff2bf63324821567408
main/media_cache.c