Skip to content

Commit

Permalink
Refactor client.rs: commented code and update expected IP address
Browse files Browse the repository at this point in the history
  • Loading branch information
joalopez1206 committed Sep 24, 2024
1 parent 4126b03 commit fcc42bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ impl <T: ClientConnection> Client<T> {
Ok(response_message) => {
match DnsMessage::from_bytes(&response_message) {
Ok(dns_message) => {
let additional = dns_message.get_additional();
// TODO: Verify functionality of this fragment
/*let additional = dns_message.get_additional();
let lenght = additional.len();
let a_r = additional.get(lenght - 1);
match a_r {
Expand All @@ -128,7 +129,7 @@ impl <T: ClientConnection> Client<T> {
}
},
None => {},
}
}*/
dns_message},
Err(_) => return Err(ClientError::FormatError("The name server was unable to interpret the query."))?,
}
Expand Down Expand Up @@ -218,7 +219,7 @@ mod client_test {
// Err(error) => panic!("Error in the response: {:?}", error),
// };

let expected_ip: [u8; 4] = [93, 184, 216, 34];
let expected_ip: [u8; 4] = [93, 184, 215, 14];
let answers = response.get_answer();
for answer in answers {
let a_rdata = answer.get_rdata();
Expand Down

0 comments on commit fcc42bb

Please sign in to comment.