diff --git a/aquatic_udp/src/workers/swarm/storage.rs b/aquatic_udp/src/workers/swarm/storage.rs index 9c78021..2c864e8 100644 --- a/aquatic_udp/src/workers/swarm/storage.rs +++ b/aquatic_udp/src/workers/swarm/storage.rs @@ -86,11 +86,21 @@ impl TorrentData { match (status, opt_removed_peer.is_some()) { // We added a new peer (PeerStatus::Leeching | PeerStatus::Seeding, false) => { - statistics_sender.try_send(StatisticsMessage::PeerAdded(peer_id)); + if let Err(_) = + statistics_sender.try_send(StatisticsMessage::PeerAdded(peer_id)) + { + // Should never happen in practice + ::log::error!("Couldn't send StatisticsMessage::PeerAdded"); + } } // We removed an existing peer (PeerStatus::Stopped, true) => { - statistics_sender.try_send(StatisticsMessage::PeerRemoved(peer_id)); + if let Err(_) = + statistics_sender.try_send(StatisticsMessage::PeerRemoved(peer_id)) + { + // Should never happen in practice + ::log::error!("Couldn't send StatisticsMessage::PeerRemoved"); + } } _ => (), } @@ -149,7 +159,12 @@ impl TorrentData { self.num_seeders -= 1; } if config.statistics.extended { - statistics_sender.try_send(StatisticsMessage::PeerRemoved(*peer_id)); + if let Err(_) = + statistics_sender.try_send(StatisticsMessage::PeerRemoved(*peer_id)) + { + // Should never happen in practice + ::log::error!("Couldn't send StatisticsMessage::PeerRemoved"); + } } } diff --git a/aquatic_udp/templates/statistics.html b/aquatic_udp/templates/statistics.html index 77463f6..0fe8930 100644 --- a/aquatic_udp/templates/statistics.html +++ b/aquatic_udp/templates/statistics.html @@ -267,7 +267,7 @@ {{ for value in peer_clients }} { value.0 } - { value.2 } + { value.1 } {{ endfor }}