[OpenSIPS-Devel] [OpenSIPS/opensips] 183072: statistics: alocating enough mem for stat name

Dan Pascu dan at ag-projects.com
Thu Jun 27 06:22:09 EDT 2019


In actuality it was commit 1f7af0bdc that broke it not bc9423713, but I guess now it's too late to change the commit message.

On a different note I find the way the register_stat2 function treats the flags to be confusing and counter intuitive. It allocates space for name if the STAT_SHM_NAME flag is not set and it allocates memory if STAT_NO_ALLOC is set. The only flag in there that seems to behave as expected is STAT_IS_FUNC. Maybe some better names for the flags would help. Like for example maybe STAT_NO_ALLOC is in fact STAT_NOT_ALLOCATED?

On 27 Jun 2019, at 10:38, Răzvan Crainea wrote:

>  Branch: refs/heads/master
>  Home:   https://github.com/OpenSIPS/opensips
>  Commit: 18307225468617272633524ab3985340e711067b
>      https://github.com/OpenSIPS/opensips/commit/18307225468617272633524ab3985340e711067b
>  Author: Razvan Crainea <razvan at opensips.org>
>  Date:   2019-06-27 (Thu, 27 Jun 2019)
> 
>  Changed paths:
>    M statistics.c
> 
>  Log Message:
>  -----------
>  statistics: alocating enough mem for stat name
> 
> Commit bc9423713 broke statistics because it was no longer alocating
> space for the name of the statistics. This commit fixes the issue.
> 
> Thanks go to Maxim Sobolev for reporting this and pointing out the issue!
> 
> 
> 
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


--
Dan







More information about the Devel mailing list