[Asterisk-code-review] media cache: make sure generated filenames cannot conflict (asterisk[master])

Nathan Bruning asteriskteam at digium.com
Wed Feb 8 05:55:34 CST 2023


Attention is currently required from: Sean Bright.

Nathan Bruning has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19797 )

Change subject: media cache: make sure generated filenames cannot conflict
......................................................................


Patch Set 1:

(1 comment)

Patchset:

PS1: 
> Ultimately the check-then-act is always going to result in a race condition. […]
Agreed. Thinking about it some more, the root cause is that `filehelper` is full of logic that only makes sense for 'local files', not for media cached-files: like iterating over file extensions. Instead of adding more exceptions there, I opted to avoid this method altogether for media cache files.

My second patch is not yet formatted and doesn't work for video yet, but it illustrates the idea. The method `ast_openstream_full` now has different codepaths depending on where the file comes from (local file / media cache). To avoid much duplicated code, I added `stream_file` which links to audio file to the channel for both scenarion.

If we can agree on this idea, i'm happy to format the patch and apply for video too, although i don't have a test setup for video.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19797
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: If6b5f4af9cbdf39009252594eb987b07bfb493a4
Gerrit-Change-Number: 19797
Gerrit-PatchSet: 1
Gerrit-Owner: Nathan Bruning <nathan at iperity.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Comment-Date: Wed, 08 Feb 2023 11:55:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sean Bright <sean at seanbright.com>
Comment-In-Reply-To: Nathan Bruning <nathan at iperity.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230208/c2bfae32/attachment-0001.html>


More information about the asterisk-code-review mailing list