- 22 Jun, 2020 2 commits
-
-
The fallback to a straight Fisher-Yates shuffle needs to occur whenever the sum of the *remaining* weights is zero, or else the remaining records will not be reordered. Testing only once at the beginning covers the case when all weights are zero, and obviously no shuffling is needed when only one weight is zero; but other weight combinations are possible, such as (1, 0, 0).
-
Prior to this change, given two records of weight 1 the algorithm would return them in the order (0,1) with 100% probability instead of the desired 50%. This was due to an off-by-one error in the range test. srv_rand() returns a float in the range [0.0, 1.0[, so r is an integer in the range [0, total[. The correct probability for record 0 to be chosen is a[0].weight/total, not (a[0].weight+1)/total.
-
- 09 Jan, 2020 1 commit
-
-
Quanah Gibson-Mount authored
-
- 14 Jan, 2019 1 commit
-
-
Quanah Gibson-Mount authored
-
- 22 Mar, 2018 1 commit
-
-
Quanah Gibson-Mount authored
-
- 03 Jan, 2017 1 commit
-
-
Quanah Gibson-Mount authored
-
- 29 Jan, 2016 1 commit
-
-
Quanah Gibson-Mount authored
-
- 28 Jul, 2015 1 commit
-
-
Another bug from 5de85b92
-
- 12 Jul, 2015 1 commit
-
-
Howard Chu authored
Another bug from 5de85b92
-
- 11 Feb, 2015 2 commits
-
-
Quanah Gibson-Mount authored
-
Quanah Gibson-Mount authored
-
- 19 Jan, 2015 1 commit
-
-
- 14 Jan, 2015 1 commit
-
-
Howard Chu authored
-
- 22 Jul, 2014 6 commits
-
-
-
-
From RFC 2782: A client MUST attempt to contact the target host with the lowest-numbered priority it can reach. This patch sorts the DNS SRV records by their priority, and additionally gives records with a larger weight a higher probability of appearing earlier. This way, the DNS SRV records are tried in the order of their priority.
-
Howard Chu authored
-
Howard Chu authored
-
From RFC 2782: A client MUST attempt to contact the target host with the lowest-numbered priority it can reach. This patch sorts the DNS SRV records by their priority, and additionally gives records with a larger weight a higher probability of appearing earlier. This way, the DNS SRV records are tried in the order of their priority.
-
- 25 Jan, 2014 2 commits
-
-
Kurt Zeilenga authored
-
Kurt Zeilenga authored
-
- 02 Jan, 2013 1 commit
-
-
Kurt Zeilenga authored
-
- 01 Jan, 2012 1 commit
-
-
Kurt Zeilenga authored
-
- 05 Jan, 2011 1 commit
-
-
Kurt Zeilenga authored
-
- 13 Oct, 2010 1 commit
-
-
Howard Chu authored
-
- 09 Sep, 2010 1 commit
-
-
Pierangelo Masarati authored
-
- 13 Apr, 2010 1 commit
-
-
Kurt Zeilenga authored
-
- 22 Jan, 2009 1 commit
-
-
Kurt Zeilenga authored
-
- 08 Jan, 2008 1 commit
-
-
Kurt Zeilenga authored
-
- 02 Jan, 2007 1 commit
-
-
Kurt Zeilenga authored
-
- 05 Aug, 2006 1 commit
-
-
Pierangelo Masarati authored
-
- 03 Jan, 2006 1 commit
-
-
Kurt Zeilenga authored
-
- 01 Jan, 2005 1 commit
-
-
Kurt Zeilenga authored
-
- 18 Jul, 2004 1 commit
-
-
Pierangelo Masarati authored
-
- 07 Apr, 2004 1 commit
-
-
Kurt Zeilenga authored
-
- 17 Mar, 2004 1 commit
-
-
Kurt Zeilenga authored
-
- 05 Mar, 2004 1 commit
-
-
Howard Chu authored
-
- 17 Jan, 2004 2 commits
-
-
Kurt Zeilenga authored
-
Howard Chu authored
-
- 01 Jan, 2004 1 commit
-
-
Kurt Zeilenga authored
-