mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +00:00
LookupServer: Move case randomization into DNSName
* DNSName knows how to randomize itself * DNSPacket no longer constructs DNSQuestion instances, it receives an already built DNSQuestion and just adds it to the list * LookupServer::lookup() explicitly calls randomize_case() if it needs to randomize the case.
This commit is contained in:
parent
89f718c4c5
commit
bacbde31f3
5 changed files with 27 additions and 23 deletions
|
@ -172,7 +172,10 @@ Vector<String> LookupServer::lookup(const DNSName& name, const String& nameserve
|
|||
DNSPacket request;
|
||||
request.set_is_query();
|
||||
request.set_id(arc4random_uniform(UINT16_MAX));
|
||||
request.add_question(name.as_string(), record_type, should_randomize_case);
|
||||
DNSName name_in_question = name;
|
||||
if (should_randomize_case == ShouldRandomizeCase::Yes)
|
||||
name_in_question.randomize_case();
|
||||
request.add_question({ name_in_question, record_type, C_IN });
|
||||
|
||||
auto buffer = request.to_byte_buffer();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue