[OpenSIPS-Devel] [OpenSIPS/opensips] 65f422: Update drouting.c
nexbridge
noreply at github.com
Thu Mar 16 06:52:27 UTC 2023
Branch: refs/heads/3.3
Home: https://github.com/OpenSIPS/opensips
Commit: 65f4225bc3a0df736049c86b00a80491e4ef08d5
https://github.com/OpenSIPS/opensips/commit/65f4225bc3a0df736049c86b00a80491e4ef08d5
Author: nexbridge <13848887+nexbridge at users.noreply.github.com>
Date: 2023-03-16 (Thu, 16 Mar 2023)
Changed paths:
M modules/drouting/drouting.c
Log Message:
-----------
Update drouting.c
In weight_based_sort() function:
- Changed RAND_MAX to RAND_MAX + 1 to make sure that quotient is always less than 1
- Changed float to double to avoid rounding errors, particularly when the value of rand() nears RAND_MAX and thus the quotient could round to 1
(cherry picked from commit 6ef8168a8de88d04512b3aa6bb888ac3794fb142)
More information about the Devel
mailing list