client: set random id correctly
* set_random_id won't work in WASM
This commit is contained in:
parent
d753db62b3
commit
19f53962e7
|
@ -44,7 +44,9 @@ impl Client {
|
|||
// it first, and we also want to be able to do caching and overriding
|
||||
fn build_query(questions: Vec<Question<ParsedDname>>) -> Result<Message, String> {
|
||||
let mut builder = MessageBuilder::new_udp();
|
||||
builder.header_mut().set_random_id();
|
||||
builder
|
||||
.header_mut()
|
||||
.set_id((unsafe { Math::random() } * u16::MAX as f64) as u16);
|
||||
for q in questions {
|
||||
builder
|
||||
.push(q)
|
||||
|
|
Loading…
Reference in New Issue