aboutsummaryrefslogtreecommitdiffstats
path: root/src/synchronizer.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-02-19 20:06:10 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-02-19 20:06:10 -0800
commit4eb739dcab2a1a79e1e0e60feddb0d9cc0d74108 (patch)
treeda5786d14a71ebb1f961efd37586fcd15d430371 /src/synchronizer.rs
parent915acb1be8693f992afd7b5c82c2761c85b6b64d (diff)
downloadgeniza-4eb739dcab2a1a79e1e0e60feddb0d9cc0d74108.tar.gz
geniza-4eb739dcab2a1a79e1e0e60feddb0d9cc0d74108.zip
more WIP on synchronizer
Diffstat (limited to 'src/synchronizer.rs')
-rw-r--r--src/synchronizer.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/synchronizer.rs b/src/synchronizer.rs
index 277bf64..cfc4cd3 100644
--- a/src/synchronizer.rs
+++ b/src/synchronizer.rs
@@ -136,14 +136,15 @@ impl Synchronizer {
}
fn handle_msg(&mut self, pm: &PeerMsg) -> Result<()> {
+ // NB: this is the simplistic model of registers (only works up to 2x per peer)
// mutable ref to PeerThread for this message
let pt = self.peers.get_mut(&pm.peer_handle).unwrap();
// NB: this is the simplistic model of registers (only works up to 2x per peer?)
if pm.feed_index as usize >= self.registers.len() {
- // XXX: invalid feed! drop connection
- pt.close()?;
+ // Ignore feed channels we haven't registered yet
+ return Ok(());
}
match &pm.msg {