2011/6/22 Piotr Szotkowski <chastell / chastell.net>:
> srvs.sort { |a, b| (a.priority <=> b.priority).nonzero? or (b.weight <=> a.weight).nonzero? or rand }

The problem is that a SRV record with priority 1 and weight 20 must
not be *always* preferred over another record with priority 1 and
weight 10 (the first record must be chosen ~2 times as its weight is
double high).

Anyhow I've already coded a method for such weight algorithm ;)

Thanks.

-- 
IƱaki Baz Castillo
<ibc / aliax.net>