Skip to content

Commit

Permalink
refact: add incremetn_current_server_index in state block
Browse files Browse the repository at this point in the history
  • Loading branch information
justRkive committed Sep 19, 2024
1 parent c8aaa30 commit 15e51a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/async_resolver/state_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ impl StateBlock {
// TODO: Implement the logic to terminate the request if the counter reaches zero.
}

/// Increments the `current_server_index` of the request.
///
/// It it used when the resolver must query the next name server in the list.
pub fn increment_current_server_index(&mut self) {
self.current_server_index = (self.current_server_index + 1)%(self.servers.len());
}

/// Returns a reference to the `timestamp` of the request.
pub fn get_timestamp(&self) -> &Instant {
return &self.timestamp;
Expand Down

0 comments on commit 15e51a7

Please sign in to comment.