[sr-dev] git:master: permissions(k): do not check db con in child init

Alex Hermann alex at speakup.nl
Mon Jan 24 14:36:01 CET 2011


Daniel,

is the below change based on different DB behaviour in 3.1 than in 1.4/1.5 
or should this change be applied to 1.4/1.5 too?



Alex.


On Tuesday 18 January 2011, Daniel-Constantin Mierla wrote:
> Module: sip-router
> Branch: master
> Commit: be92c6713c2b7c7cb04320758a346ba6a1324982
> URL:   
> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=be92
> c6713c2b7c7cb04320758a346ba6a1324982
> 
> Author: Daniel-Constantin Mierla <miconda at gmail.com>
> Committer: Daniel-Constantin Mierla <miconda at gmail.com>
> Date:   Tue Jan 18 20:16:31 2011 +0100
> 
> permissions(k): do not check db con in child init
> 
> - proper connection is returned by comparison of pids
> 
> ---
> 
>  modules_k/permissions/address.c |    2 +-
>  modules_k/permissions/trusted.c |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/modules_k/permissions/address.c
> b/modules_k/permissions/address.c index ccdbf1a..3db6e58 100644
> --- a/modules_k/permissions/address.c
> +++ b/modules_k/permissions/address.c
> @@ -287,7 +287,7 @@ error:
>   */
>  int mi_init_addresses(void)
>  {
> -    if (!db_url.s || db_handle) return 0;
> +    if (!db_url.s) return 0;
>      db_handle = perm_dbf.init(&db_url);
>      if (!db_handle) {
>  	LM_ERR("unable to connect database\n");
> diff --git a/modules_k/permissions/trusted.c
> b/modules_k/permissions/trusted.c index 33cae33..1f8a106 100644
> --- a/modules_k/permissions/trusted.c
> +++ b/modules_k/permissions/trusted.c
> @@ -235,7 +235,7 @@ int init_child_trusted(int rank)
>      if ((rank <= 0) && (rank != PROC_RPC) && (rank != PROC_UNIXSOCK))
>  		return 0;
> 
> -	if (!db_url.s || db_handle) {
> +	if (!db_url.s) {
>  		return 0;
>  	}
> 
> @@ -261,7 +261,7 @@ int init_child_trusted(int rank)
>   */
>  int mi_init_trusted(void)
>  {
> -    if (!db_url.s || db_handle) return 0;
> +    if (!db_url.s) return 0;
>      db_handle = perm_dbf.init(&db_url);
>      if (!db_handle) {
>  	LM_ERR("unable to connect database\n");



More information about the sr-dev mailing list