[Asterisk-code-review] loader: Add dependency fields to module structures. (asterisk[master])
Corey Farrell
asteriskteam at digium.com
Sun Jan 14 16:57:59 CST 2018
Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/7872 )
Change subject: loader: Add dependency fields to module structures.
......................................................................
Patch Set 5:
(5 comments)
https://gerrit.asterisk.org/#/c/7872/5/include/asterisk/module.h
File include/asterisk/module.h:
https://gerrit.asterisk.org/#/c/7872/5/include/asterisk/module.h@342
PS5, Line 342: /*! Modules which must be started first, in comma-separated string format. */
: const char *requires;
> This seems to need more clarification.
"Modules which must be loaded and started first, in comma-separated string format." ?
This field is for modules which are unconditionally mandatory. I had only mentioned "started first" since this field does not actually enforce load order. Load order is often enforced by dlopen symbol resolution (RTLD_NOW forces res_fax load before res_fax_spandsp), but sometimes when one module requires another but doesn't directly use symbols the dlopen's can succeed in any order (app_adsiprog vs res_adsi for example). The requires field deals with "starting" the module.
It's unfortunate that the start module callback is '.load' instead of '.start' - this inappropriately named field makes things confusing but I'm not sure renaming would be worth it.
https://gerrit.asterisk.org/#/c/7872/5/res/res_agi.c
File res/res_agi.c:
https://gerrit.asterisk.org/#/c/7872/5/res/res_agi.c@4720
PS5, Line 4720: .requires = "res_speech",
> Why is this required for AGI? It should be optional.
res_speech is not implemented with OPTIONAL_API so res_agi.so directly references symbols from res_speech (ast_speech_grammar_activate for example).
https://gerrit.asterisk.org/#/c/7872/5/res/res_ari.c
File res/res_ari.c:
https://gerrit.asterisk.org/#/c/7872/5/res/res_ari.c@1200
PS5, Line 1200: .optional_apis = "res_http_websocket",
> Heh. I thought ARI was essentially nonfunctional without a websocket.
What about some of the basic information retrieval URL's (no use of events)?
https://gerrit.asterisk.org/#/c/7872/5/res/res_pjsip_outbound_publish.c
File res/res_pjsip_outbound_publish.c:
https://gerrit.asterisk.org/#/c/7872/5/res/res_pjsip_outbound_publish.c@1705
PS5, Line 1705: .requires = "res_pjproject,res_pjsip",
> Should only need res_pjsip as res_pjsip cannot function without res_pjproje
This module directly calls ast_pjproject_get_buildopt. You are right it's not technically required. For situations like this I don't have very strong feelings but lean towards listing everything that is directly used.
https://gerrit.asterisk.org/#/c/7872/5/res/res_pjsip_registrar.c
File res/res_pjsip_registrar.c:
https://gerrit.asterisk.org/#/c/7872/5/res/res_pjsip_registrar.c@1137
PS5, Line 1137: .requires = "res_pjproject,res_pjsip",
> Should only need res_pjsip as res_pjsip cannot function without res_pjproje
Same as res_pjsip_outbound_publish.
--
To view, visit https://gerrit.asterisk.org/7872
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
Gerrit-Change-Number: 7872
Gerrit-PatchSet: 5
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Sun, 14 Jan 2018 22:57:59 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180114/1bbbcb2e/attachment-0001.html>
More information about the asterisk-code-review
mailing list