Bump version to 0.2.2

This commit is contained in:
Jeremy Wall 2023-03-13 20:26:19 -04:00
parent 390b61ee86
commit f609dcfef3
4 changed files with 12 additions and 10 deletions

2
Cargo.lock generated
View File

@ -71,7 +71,7 @@ dependencies = [
[[package]] [[package]]
name = "durnitisp" name = "durnitisp"
version = "0.2.1" version = "0.2.2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"gflags", "gflags",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "durnitisp" name = "durnitisp"
version = "0.2.1" version = "0.2.2"
authors = ["Jeremy Wall <jeremy@marzhillstudios.com>"] authors = ["Jeremy Wall <jeremy@marzhillstudios.com>"]
edition = "2018" edition = "2018"

12
flake.lock generated
View File

@ -36,11 +36,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1639947939, "lastModified": 1671096816,
"narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=", "narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "naersk", "repo": "naersk",
"rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653", "rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -51,11 +51,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1645937171, "lastModified": 1678724065,
"narHash": "sha256-n9f9GZBNMe8UMhcgmmaXNObkH01jjgp7INMrUgBgcy4=", "narHash": "sha256-MjeRjunqfGTBGU401nxIjs7PC9PZZ1FBCZp/bRB3C2M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "22dc22f8cedc58fcb11afe1acb08e9999e78be9c", "rev": "b8afc8489dc96f29f69bec50fdc51e27883f89c1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -73,6 +73,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
fn handle_echo_reply(&mut self, identifier: u16, sequence: u16) -> bool { fn handle_echo_reply(&mut self, identifier: u16, sequence: u16) -> bool {
if let Some((domain_name, dest)) = self.destinations.get(&identifier) { if let Some((domain_name, dest)) = self.destinations.get(&identifier) {
let time_tracker = self.time_tracker.get_mut(&identifier); let time_tracker = self.time_tracker.get_mut(&identifier);
let mut result = false;
if let Some(Some(send_time)) = time_tracker.as_ref().map(|m| m.get(&sequence)) { if let Some(Some(send_time)) = time_tracker.as_ref().map(|m| m.get(&sequence)) {
let elapsed = Instant::now().sub(send_time.clone()).as_micros() as f64 / 1000.00; let elapsed = Instant::now().sub(send_time.clone()).as_micros() as f64 / 1000.00;
// We make a copy here to avoid the borrow above sticking around for too long. // We make a copy here to avoid the borrow above sticking around for too long.
@ -94,7 +95,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
self.time_tracker self.time_tracker
.get_mut(&identifier) .get_mut(&identifier)
.and_then(|m| m.remove(&sequence)); .and_then(|m| m.remove(&sequence));
return true; result = true;
} else { } else {
error!(sequence, "Discarding unexpected sequence",); error!(sequence, "Discarding unexpected sequence",);
}; };
@ -114,7 +115,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
"Dropped" "Dropped"
); );
self.ping_counter self.ping_counter
.with(&prometheus::labels! {"result" => "timeout", "domain" => domain_name}) .with(&prometheus::labels! {"result" => "dropped", "domain" => domain_name})
.inc(); .inc();
for_delete.push(*k); for_delete.push(*k);
} }
@ -127,6 +128,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
.get_mut(&identifier) .get_mut(&identifier)
.and_then(|m| m.remove(&k)); .and_then(|m| m.remove(&k));
} }
return result;
} else { } else {
warn!(identifier, "Discarding wrong identifier"); warn!(identifier, "Discarding wrong identifier");
} }