client: comments

This commit is contained in:
Peter Cai 2021-04-04 13:35:29 +08:00
parent 0e149f954b
commit af91ce2ef1
1 changed files with 2 additions and 0 deletions

View File

@ -68,6 +68,8 @@ impl Client {
let mut builder = MessageBuilder::new_vec();
// Set up the header
let header = builder.header_mut();
// We don't use set_random_id because `getrandom` seems to be
// unreliable on Cloudflare Workers for some reason
header.set_id(crate::util::random_range(0, u16::MAX));
header.set_qr(false); // For queries, QR = false
header.set_opcode(Opcode::Query);