diff options
Diffstat (limited to 'client/src/download.rs')
-rw-r--r-- | client/src/download.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/download.rs b/client/src/download.rs index 256c25c..dfd7ff0 100644 --- a/client/src/download.rs +++ b/client/src/download.rs @@ -1,12 +1,12 @@ +use crate::network::Network; use anyhow::Result; +use log::debug; use std::collections::HashSet; use weareshared::{ packets::{Packet, Resource}, store::{ResourceStore, sha256}, }; -use crate::network::Network; - pub struct Downloader { have: HashSet<Resource>, need: HashSet<Resource>, @@ -38,7 +38,9 @@ impl Downloader { self.store.set(&d)?; self.need.remove(&key); self.pending.remove(&key); - self.have.insert(key); + if self.have.insert(key) { + debug!("have {key}"); + } } _ => (), } @@ -51,6 +53,7 @@ impl Downloader { .packet_send .send(Packet::RequestResource(*n)) .unwrap(); + debug!("need {n}"); new_pending.push(*n); } self.pending.extend(new_pending); |