[Asterisk-code-review] loader: Create ast module running ref. (asterisk[master])
Corey Farrell
asteriskteam at digium.com
Wed Jan 3 16:21:20 CST 2018
Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/7770 )
Change subject: loader: Create ast_module_running_ref.
......................................................................
Patch Set 1:
(4 comments)
I'm adding comments to the places which support NULL module (registration from main/*.c).
https://gerrit.asterisk.org/#/c/7770/1/main/bridge.c
File main/bridge.c:
https://gerrit.asterisk.org/#/c/7770/1/main/bridge.c@528
PS1, Line 528: /* The bridge module is not actually running. */
: /* BUGBUG: improve handling of this situation. */
: best = NULL;
: }
> Just a thought, but you could search again for the next best?
No but we can do the reference from within the loop. I modified the registration function to keep bridge_technologies sorted by preference so if we have multiple compatible tech's we should find the best first.
https://gerrit.asterisk.org/#/c/7770/1/main/cli.c
File main/cli.c:
https://gerrit.asterisk.org/#/c/7770/1/main/cli.c@2683
PS1, Line 2683: if (!e->module || ast_module_running_ref(e->module)) {
> Can skip the null check here as it's checked for in ast_module_running
The NULL check is needed as ast_module_running_ref will return NULL for CLI from main/*.c (e->module == NULL), but those commands can still be run.
https://gerrit.asterisk.org/#/c/7770/1/main/cli.c@2765
PS1, Line 2765: if (!e->module || ast_module_running_ref(e->module)) {
> Can skip the null check here as it's checked for in ast_module_running
Same.
https://gerrit.asterisk.org/#/c/7770/1/main/manager.c
File main/manager.c:
https://gerrit.asterisk.org/#/c/7770/1/main/manager.c@2950
PS1, Line 2950: if (mod_ref || !act_found->module) {
> This took me a second to parse (don't enter if module ref was rejected due
I'm going to swap the order so !act_found->module is checked first like in CLI.c. This is don't enter if we have a module and it is not running. Like CLI it's valid for act_found->module to be NULL.
--
To view, visit https://gerrit.asterisk.org/7770
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia16fd28e188b2fc0b9d18b8a5d9cacc31df73fcc
Gerrit-Change-Number: 7770
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Wed, 03 Jan 2018 22:21:20 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180103/8e1106c1/attachment.html>
More information about the asterisk-code-review
mailing list