[Asterisk-code-review] res_stasis: Add ability to switch applications. (...asterisk[13])
Kevin Harwell
asteriskteam at digium.com
Wed Mar 6 09:55:04 CST 2019
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/10937 )
Change subject: res_stasis: Add ability to switch applications.
......................................................................
Patch Set 13: Code-Review-1
(3 comments)
Only one real bug found.
https://gerrit.asterisk.org/#/c/10937/13/res/stasis/control.c
File res/stasis/control.c:
https://gerrit.asterisk.org/#/c/10937/13/res/stasis/control.c@494
PS13, Line 494: }
Need to free "data" here as well.
https://gerrit.asterisk.org/#/c/10937/13/res/stasis/control.c@512
PS13, Line 512: AST_VECTOR_FREE(&move_data->args);
This could stay, but for consistency I'd remove it and just let the clean up function handle it.
https://gerrit.asterisk.org/#/c/10937/13/res/stasis/control.c@528
PS13, Line 528: AST_VECTOR_INIT(&move_data->args, 0);
:
: if (app_args) {
: char *iter = ast_strdupa(app_args);
:
: if (!iter) {
: move_free(move_data);
: return -1;
: }
:
: token = strtok(iter, ",");
: while (token != NULL) {
: int res;
: char *arg;
:
: if (!(arg = ast_strdup(token))) {
: move_free(move_data);
: return -1;
: }
:
: res = AST_VECTOR_APPEND(&move_data->args, arg);
: if (res) {
: move_free(move_data);
: return -1;
: }
:
: token = strtok(NULL, ",");
: }
: }
Just a suggestion, but you could pass the app_name and app_args via move data and then do the string parsing/arg extraction in the command handler. That would remove the extra loop, and potentially one of the string copies.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/10937
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I43d12b10045a98a8d42541889b85695be26f288a
Gerrit-Change-Number: 10937
Gerrit-PatchSet: 13
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Wed, 06 Mar 2019 15:55:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190306/e1014e93/attachment.html>
More information about the asterisk-code-review
mailing list