diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-10-26 20:29:48 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-10-26 20:29:48 -0700 |
commit | d95adfa86a4a903a20120a93b8d10ae39fb6cd3d (patch) | |
tree | 6f2487adaab52cc27c7ad5009ab9496d247d037f /src/sync.rs | |
parent | 3a6fa9cdf581dd3f7f8156190f33d2617c156cd6 (diff) | |
download | geniza-d95adfa86a4a903a20120a93b8d10ae39fb6cd3d.tar.gz geniza-d95adfa86a4a903a20120a93b8d10ae39fb6cd3d.zip |
small lint cleanups
Diffstat (limited to 'src/sync.rs')
-rw-r--r-- | src/sync.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/sync.rs b/src/sync.rs index d092422..efa045a 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -232,7 +232,7 @@ impl DatConnection { dc.tcp.set_nodelay(true)?; // Faster handshake // send register let mut register_msg = Feed::new(); - register_msg.set_discoveryKey(dk.to_vec()); + register_msg.set_discoveryKey(dc.discovery_key.to_vec()); register_msg.set_nonce((tx_nonce[0..24]).to_vec()); dc.send_register(®ister_msg)?; @@ -246,8 +246,8 @@ impl DatConnection { // send handshake let mut handshake_msg = Handshake::new(); - handshake_msg.set_live(live); - handshake_msg.set_id(local_id.to_vec()); + handshake_msg.set_live(dc.live); + handshake_msg.set_id(dc.id.to_vec()); dc.send_msg(&DatNetMessage::Handshake(handshake_msg), false)?; // read handshake @@ -408,14 +408,12 @@ impl DatConnection { self.send_msg(&DatNetMessage::Want(wm), false)?; // listen for Have - let length; loop { let (was_content, msg) = self.recv_msg()?; if was_content { continue; } - if let DatNetMessage::Have(have) = msg { - length = have.get_length(); + if let DatNetMessage::Have(_) = msg { break; } else { info!("Expected Have message, got: {:?}", &msg); |