[Asterisk-code-review] Add the ability to read the media file type from HTTP header... (asterisk[15])

Gaurav Khurana asteriskteam at digium.com
Mon Mar 5 20:28:01 CST 2018


Gaurav Khurana 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:

(5 comments)

Testing my changes is taking way longer than I expected because of my application being incompatible with Asterisk 15. Hence the delays here.

https://gerrit.asterisk.org/#/c/8209/4/main/file.c
File main/file.c:

https://gerrit.asterisk.org/#/c/8209/4/main/file.c@356
PS4, Line 356: static int mime_types_compare(const char *mime_types, const char *type)
> This function is not needed.  The only difference between this function and
Done


https://gerrit.asterisk.org/#/c/8209/4/main/media_cache.c
File main/media_cache.c:

https://gerrit.asterisk.org/#/c/8209/4/main/media_cache.c@146
PS4, Line 146: 		char temp_ext[PATH_MAX];
> How about found_ext[] instead.
Done


https://gerrit.asterisk.org/#/c/8209/4/main/media_cache.c@147
PS4, Line 147: 		strcpy(temp_ext, ext);
> strcpy() could write beyond the buffer.  Use ast_string_copy().
Done


https://gerrit.asterisk.org/#/c/8209/4/main/media_cache.c@162
PS4, Line 162: 					char *tmp = strsep(&exts, "|");
> tmp is always a lousy name as it provides no meaningful information about w
Done


https://gerrit.asterisk.org/#/c/8209/4/main/media_cache.c@164
PS4, Line 164: 					/* Not updating the original ext here to keep the key for media-cache same */
             : 					snprintf(temp_ext, strlen(temp_ext), ".%s", tmp);
> Is having to truncate the extension a good thing?  It seems a bad thing to 
temp_ext is defined as PATH_MAX. I think it is safe to assume that an extension won't be longer than that and if it is then it probably is junk which should be avoided regardless. So, I don't think it will get truncated here.
Please let me know if you meant something else and not this.



-- 
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, 06 Mar 2018 02:28:01 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180305/e3bb2113/attachment.html>


More information about the asterisk-code-review mailing list