mirror of https://github.com/dswd/vpncloud.git
Reconnecting to lost peers when receiving from them or sending to them
This commit is contained in:
parent
d7b930982d
commit
ab7c033383
|
@ -6,7 +6,10 @@ This project follows [semantic versioning](http://semver.org).
|
|||
|
||||
- [changed] Updated dependencies
|
||||
- [changed] Turned some clippy warnings off
|
||||
- [changed] Cross-compiling for ARMv7
|
||||
- [changed] Cross-compiling for ARM
|
||||
- [removed] Removed Address remove code for prefix table
|
||||
- [fixed] Reconnecting to lost peers when receiving from them or sending to them
|
||||
- [fixed] Sending peer list more often to prevent timeouts
|
||||
|
||||
### v0.6.0 (2016-06-02)
|
||||
|
||||
|
|
|
@ -362,11 +362,11 @@ impl<P: Protocol> GenericCloud<P> {
|
|||
match self.table.lookup(&dst) {
|
||||
Some(addr) => {
|
||||
debug!("Found destination for {} => {}", dst, addr);
|
||||
if self.peers.contains_addr(&addr) {
|
||||
try!(self.send_msg(addr, &mut Message::Data(payload, start, end)))
|
||||
} else {
|
||||
try!(self.send_msg(addr, &mut Message::Data(payload, start, end)));
|
||||
if !self.peers.contains_addr(&addr) {
|
||||
warn!("Destination for {} not found in peers: {}", dst, addr);
|
||||
self.table.remove(&dst);
|
||||
try!(self.connect(&addr));
|
||||
}
|
||||
},
|
||||
None => {
|
||||
|
@ -406,6 +406,9 @@ impl<P: Protocol> GenericCloud<P> {
|
|||
}
|
||||
},
|
||||
Message::Peers(peers) => {
|
||||
if !self.peers.contains_addr(&peer) {
|
||||
try!(self.connect(&peer));
|
||||
}
|
||||
for p in &peers {
|
||||
if ! self.peers.contains_addr(p) && ! self.blacklist_peers.contains(p) {
|
||||
try!(self.connect(p));
|
||||
|
|
Loading…
Reference in New Issue