[Asterisk-code-review] Remove redundant module references. (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Jan 17 22:42:07 CST 2018


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/7989 )

Change subject: Remove redundant module references.
......................................................................


Patch Set 2:

(8 comments)

* include/asterisk/ari.h: The CHECK_ARI_MODULE_LOADED() is not needed
anymore.  Dependent modules won't start if a dependency is not
running/declined anymore right?

* Users of ast_module_check() need to be examined for continued need.
Many are now redundant.  CHECK_ARI_MODULE_LOADED() and
CHECK_PJSIP_MODULE_LOADED() are examples.

* Consumers of optional API's need to list the optional module in the
AST_MODULE_INFO section.  Many currently don't do this.

https://gerrit.asterisk.org/#/c/7989/2/res/res_agi.c
File res/res_agi.c:

https://gerrit.asterisk.org/#/c/7989/2/res/res_agi.c@3826
PS2, Line 3826: int AST_OPTIONAL_API_NAME(ast_agi_unregister)(struct ast_module *mod, agi_command *cmd)
mod is now unused.


https://gerrit.asterisk.org/#/c/7989/2/res/res_agi.c@3892
PS2, Line 3892: int AST_OPTIONAL_API_NAME(ast_agi_unregister_multiple)(struct ast_module *mod, struct agi_command *cmd, unsigned int len)
mod is now unused


https://gerrit.asterisk.org/#/c/7989/2/res/res_agi.c@4641
PS2, Line 4641: 	if (ast_agi_register(NULL, &noop_command) == 0) {
Revert.  While executing the command we need to ref the module or the command fails.  See agi_handle_command() which refs while executing.


https://gerrit.asterisk.org/#/c/7989/2/res/res_agi.c@4658
PS2, Line 4658: 	ast_agi_unregister(NULL, &noop_command);
Revert.  While executing the command we need to ref the module or the command fails.


https://gerrit.asterisk.org/#/c/7989/2/res/res_agi.c@4692
PS2, Line 4692: 	err |= ast_agi_register_multiple(NULL, commands, ARRAY_LEN(commands));
Revert.  While executing the command we need to ref the module or the command fails.


https://gerrit.asterisk.org/#/c/7989/2/res/res_pjsip.c
File res/res_pjsip.c:

https://gerrit.asterisk.org/#/c/7989/2/res/res_pjsip.c@a2794
PS2, Line 2794: 
Need to keep ast_free(identifier_order).


https://gerrit.asterisk.org/#/c/7989/2/res/res_pjsip_config_wizard.c
File res/res_pjsip_config_wizard.c:

https://gerrit.asterisk.org/#/c/7989/2/res/res_pjsip_config_wizard.c@1202
PS2, Line 1202: /*! \brief When the res_pjsip instance is created, add an observer to it and
The current changes in this file should be reverted.  There are no enforced load dependencies.  This module pre-enhances res_pjsip but that cannot be expressed by the module info dependency lists.


https://gerrit.asterisk.org/#/c/7989/2/res/res_pjsip_config_wizard.c@1215
PS2, Line 1215: static void instance_destroying_observer(const char *name, struct ast_sorcery *sorcery)
(Pre-existing) This function should protect from the case where it is manually loaded AFTER res_pjsip is started.  In this case we never installed the observer and we should not unref our own module ref.



-- 
To view, visit https://gerrit.asterisk.org/7989
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
Gerrit-Change-Number: 7989
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Thu, 18 Jan 2018 04:42:07 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180117/de6334de/attachment.html>


More information about the asterisk-code-review mailing list