Skip to content

Commit

Permalink
refactor: Update add_tsig_to_message function to accept fudge as an o…
Browse files Browse the repository at this point in the history
…ptional parameter
  • Loading branch information
Litr0 committed Aug 7, 2024
1 parent 8b3e3d9 commit f8bde45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/async_resolver/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,10 @@ impl ResolverConfig {
/// let message = Message::new();
/// resolver_config.add_tsig_to_message(&message, 300, vec![]);
/// ```
pub fn add_tsig_to_message(&self, message: &mut DnsMessage, fudge: Option<u16>, mac_request: Vec<u8>) {
pub fn add_tsig_to_message(&self, message: &mut DnsMessage, fudge: Option<u16>, mac_request: Option<Vec<u8>>) {
if self.tsig {
message.add_tsig(self.key.clone(), self.algorithm.clone(), fudge.unwrap_or(300), self.key_name.clone(), mac_request);
message.add_tsig(self.key.clone(), self.algorithm.clone(),
fudge.unwrap_or(300), self.key_name.clone(), mac_request.unwrap_or(Vec::new()));
}
}
}
Expand Down

0 comments on commit f8bde45

Please sign in to comment.