[Asterisk-code-review] res_stasis: Add ability to switch applications. (...asterisk[13])
Benjamin Keith Ford
asteriskteam at digium.com
Wed Mar 6 10:17:58 CST 2019
Benjamin Keith Ford 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:
(1 comment)
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@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 […]
In this case, you wouldn't need the custom destructor anymore either, would you? Since you wouldn't want to free app_name or app_args, just the move_data struct which has the pointers to both. You would just have to manually free everything if something went wrong. Correct?
--
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 16:17:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190306/b0ef3572/attachment-0001.html>
More information about the asterisk-code-review
mailing list