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] Updated dependencies
|
||||||
- [changed] Turned some clippy warnings off
|
- [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)
|
### v0.6.0 (2016-06-02)
|
||||||
|
|
||||||
|
|
|
@ -362,11 +362,11 @@ impl<P: Protocol> GenericCloud<P> {
|
||||||
match self.table.lookup(&dst) {
|
match self.table.lookup(&dst) {
|
||||||
Some(addr) => {
|
Some(addr) => {
|
||||||
debug!("Found destination for {} => {}", dst, addr);
|
debug!("Found destination for {} => {}", dst, addr);
|
||||||
if self.peers.contains_addr(&addr) {
|
try!(self.send_msg(addr, &mut Message::Data(payload, start, end)));
|
||||||
try!(self.send_msg(addr, &mut Message::Data(payload, start, end)))
|
if !self.peers.contains_addr(&addr) {
|
||||||
} else {
|
|
||||||
warn!("Destination for {} not found in peers: {}", dst, addr);
|
warn!("Destination for {} not found in peers: {}", dst, addr);
|
||||||
self.table.remove(&dst);
|
self.table.remove(&dst);
|
||||||
|
try!(self.connect(&addr));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
|
@ -406,6 +406,9 @@ impl<P: Protocol> GenericCloud<P> {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Message::Peers(peers) => {
|
Message::Peers(peers) => {
|
||||||
|
if !self.peers.contains_addr(&peer) {
|
||||||
|
try!(self.connect(&peer));
|
||||||
|
}
|
||||||
for p in &peers {
|
for p in &peers {
|
||||||
if ! self.peers.contains_addr(p) && ! self.blacklist_peers.contains(p) {
|
if ! self.peers.contains_addr(p) && ! self.blacklist_peers.contains(p) {
|
||||||
try!(self.connect(p));
|
try!(self.connect(p));
|
||||||
|
|
Loading…
Reference in New Issue