mirror of
https://github.com/zaphar/durnitisp.git
synced 2025-07-20 17:59:48 -04:00
Bump version to 0.2.2
This commit is contained in:
parent
390b61ee86
commit
f609dcfef3
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -71,7 +71,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "durnitisp"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"gflags",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "durnitisp"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
authors = ["Jeremy Wall <jeremy@marzhillstudios.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
12
flake.lock
generated
12
flake.lock
generated
@ -36,11 +36,11 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1639947939,
|
||||
"narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=",
|
||||
"lastModified": 1671096816,
|
||||
"narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "naersk",
|
||||
"rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653",
|
||||
"rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -51,11 +51,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1645937171,
|
||||
"narHash": "sha256-n9f9GZBNMe8UMhcgmmaXNObkH01jjgp7INMrUgBgcy4=",
|
||||
"lastModified": 1678724065,
|
||||
"narHash": "sha256-MjeRjunqfGTBGU401nxIjs7PC9PZZ1FBCZp/bRB3C2M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "22dc22f8cedc58fcb11afe1acb08e9999e78be9c",
|
||||
"rev": "b8afc8489dc96f29f69bec50fdc51e27883f89c1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -73,6 +73,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
|
||||
fn handle_echo_reply(&mut self, identifier: u16, sequence: u16) -> bool {
|
||||
if let Some((domain_name, dest)) = self.destinations.get(&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)) {
|
||||
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.
|
||||
@ -94,7 +95,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
|
||||
self.time_tracker
|
||||
.get_mut(&identifier)
|
||||
.and_then(|m| m.remove(&sequence));
|
||||
return true;
|
||||
result = true;
|
||||
} else {
|
||||
error!(sequence, "Discarding unexpected sequence",);
|
||||
};
|
||||
@ -114,7 +115,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
|
||||
"Dropped"
|
||||
);
|
||||
self.ping_counter
|
||||
.with(&prometheus::labels! {"result" => "timeout", "domain" => domain_name})
|
||||
.with(&prometheus::labels! {"result" => "dropped", "domain" => domain_name})
|
||||
.inc();
|
||||
for_delete.push(*k);
|
||||
}
|
||||
@ -127,6 +128,7 @@ impl<AddrType: std::fmt::Display> State<AddrType> {
|
||||
.get_mut(&identifier)
|
||||
.and_then(|m| m.remove(&k));
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
warn!(identifier, "Discarding wrong identifier");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user