[Asterisk-code-review] Add the ability to read the media file type from HTTP header... (asterisk[15])
Corey Farrell
asteriskteam at digium.com
Tue Feb 27 10:38:56 CST 2018
Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/8209 )
Change subject: Add the ability to read the media file type from HTTP header for playback
......................................................................
Patch Set 4:
(1 comment)
https://gerrit.asterisk.org/#/c/8209/4/include/asterisk/mod_format.h
File include/asterisk/mod_format.h:
https://gerrit.asterisk.org/#/c/8209/4/include/asterisk/mod_format.h@47
PS4, Line 47: char mime_types[80]; /*!< MIME Types related to the format (separated by | if more than one)*/
> As for repeatedly parsing the string, I don't think the extra CPU
> needed for parsing the string is much of a problem to consider
> alternate encodings.
If we were to look at optimizing that function (exts_compare) then I think we would need some kind of hashtab lookup to avoid running strcmp on every item. This would likely require using a private structure to link key to ast_format_def so we can lookup by extension or mime_type. I think that would be a separate change and would not require ABI/API changes. Using a delimited string in the ast_format_def structure keeps the API simpler than using any kind of list.
Regarding the character to be used for the mime_type delimiter, RFC1341/RFC1521 define the "Content-Type" header. They do not exclude the possibility of "|" being part of a mime type (granted I've never seen this). So ":" might be a better option for the mime-type delimiter as it is explicitly forbidden by the MIME specification. This is a pedantic nitpick, not sure if it's worth acting on.
https://www.w3.org/Protocols/rfc1341/4_Content-Type.html
https://datatracker.ietf.org/doc/rfc1521/?include_text=1 (page 9, sorry no direct link)
--
To view, visit https://gerrit.asterisk.org/8209
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: comment
Gerrit-Change-Id: I1b14692a49b2c1ac67688f58757184122e92ba89
Gerrit-Change-Number: 8209
Gerrit-PatchSet: 4
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Gaurav Khurana <gkhurana at godaddy.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Tue, 27 Feb 2018 16:38:56 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180227/8a23a9a0/attachment-0001.html>
More information about the asterisk-code-review
mailing list