Mercurial > prosody-hg
comparison net/dns.lua @ 2425:772b2caf762e
net.dns: Make sure math.randomseed() gets passed an integer
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 07 Jan 2010 01:26:01 +0000 |
| parents | 92264ee3a0e4 |
| children | 60493186fef6 |
comparison
equal
deleted
inserted
replaced
| 2424:7d3b071e3b5b | 2425:772b2caf762e |
|---|---|
| 181 | 181 |
| 182 -- packet layer -------------------------------------------------- packet layer | 182 -- packet layer -------------------------------------------------- packet layer |
| 183 | 183 |
| 184 | 184 |
| 185 function dns.random(...) -- - - - - - - - - - - - - - - - - - - dns.random | 185 function dns.random(...) -- - - - - - - - - - - - - - - - - - - dns.random |
| 186 math.randomseed(10000*socket.gettime()); | 186 math.randomseed(math.floor(10000*socket.gettime())); |
| 187 dns.random = math.random; | 187 dns.random = math.random; |
| 188 return dns.random(...); | 188 return dns.random(...); |
| 189 end | 189 end |
| 190 | 190 |
| 191 | 191 |
