-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3184/#review10759
-----------------------------------------------------------


This also needs a unit test to verify functionality and off nominals.


branches/12/main/sorcery.c
<https://reviewboard.asterisk.org/r/3184/#comment20256>

    Sorcery instances are already opaque, you can add a name to it instead and 
then use normal astobj2 containers.



branches/12/main/sorcery.c
<https://reviewboard.asterisk.org/r/3184/#comment20257>

    Destroy the hashtab usage! DESTWOY!



branches/12/main/sorcery.c
<https://reviewboard.asterisk.org/r/3184/#comment20258>

    You have a race condition here where two of the same name could be added 
(albeit unlikely).



branches/12/main/sorcery.c
<https://reviewboard.asterisk.org/r/3184/#comment20259>

    What happens if no name is specified? Should it return NULL or maybe place 
a uuid in there instead?


- Joshua Colp


On Feb. 5, 2014, 5:08 p.m., George Joseph wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3184/
> -----------------------------------------------------------
> 
> (Updated Feb. 5, 2014, 5:08 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-22537
>     https://issues.asterisk.org/jira/browse/ASTERISK-22537
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Create sorcery instance registry as a precursor to creating a generic 
> dialplan function that can retrieve parameters from a sorcery-based config 
> file.
> 
> ast_sorcery_init now creates a hashtab as a registry.
> ast_sorcery_open now checks the hashtab for an existing sorcery instance 
> matching the caller's module name.  If it finds one, it bumps the refcount 
> and returns it.  If not, it creates a new sorcery instance, adds it to the 
> hashtab, then returns it.
> ast_sorcery_retrieve_by_module_name is a new function that does a hashtab 
> lookup by module name.  It can be called by the future dialplan function.
> 
> A side effect of this patch is that a module can only have 1 sorcery instance 
> (because it's the key for the hashtab).  res_pjsip/config_system needed a 
> small change to share the main res_pjsip sorcery instance.
> 
> 
> Diffs
> -----
> 
>   branches/12/res/res_pjsip/config_system.c 407418 
>   branches/12/main/sorcery.c 407418 
>   branches/12/include/asterisk/sorcery.h 407418 
> 
> Diff: https://reviewboard.asterisk.org/r/3184/diff/
> 
> 
> Testing
> -------
> 
> Made sure that users of sorcery (mostly res_pjsip) continued to load their 
> configs correctly.
> Made sure there were no ill effects on res_pjsip from config_system sharing 
> the same sorcery instance as the rest of the pjsip infrastructure.
> Made sure that config_system was properly marked as 'not reloadable' and that 
> it was maintaining it's original values when res_pjsip was reloaded.
> 
> 
> Thanks,
> 
> George Joseph
> 
>

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to