[asterisk-dev] [Code Review] 3708: config: inform config hook of configuration change when writing file

Matt Jordan reviewboard at asterisk.org
Thu Jul 3 11:39:52 CDT 2014


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



/branches/11/main/config.c
<https://reviewboard.asterisk.org/r/3708/#comment22744>

    When loading a file, config_hook_exec is not called until we are positive that the configuration loaded successfully.
    
    Similarly, I don't think we would want to call config_hook_exec on writing to a config file until we knew for sure that the file had been written correctly. Otherwise, we may get into a situation where a config hook is notified of the changes, updates itself with the new configuration, but the write fails, resulting in a mismatch between the config file owner module and whatever had hooks into it.
    
    I'd put the config_hook_exec as the last entry in this routine.


- Matt Jordan


On July 3, 2014, 10:45 a.m., Scott Griepentrog wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3708/
> -----------------------------------------------------------
> 
> (Updated July 3, 2014, 10:45 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> When writing configuration changes back to the filesystem, also execute any registered configuration hooks.  This prevents changes in one module that are intended to be permanent from going unnoticed by another interested party.
> 
> 
> Diffs
> -----
> 
>   /branches/11/main/config.c 417862 
> 
> Diff: https://reviewboard.asterisk.org/r/3708/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Scott Griepentrog
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140703/f385ed9b/attachment.html>


More information about the asterisk-dev mailing list