mirror of https://github.com/dswd/vpncloud.git
Compare commits
2 Commits
79916104ba
...
50a6c01e93
Author | SHA1 | Date |
---|---|---|
Dennis Schwerdel | 50a6c01e93 | |
Dennis Schwerdel | 2dc774196e |
|
@ -6,7 +6,7 @@ jobs:
|
||||||
audit:
|
audit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- uses: actions-rs/audit-check@v1
|
- uses: actions-rs/audit-check@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
@ -10,6 +10,7 @@ This project follows [semantic versioning](http://semver.org).
|
||||||
- [changed] Changed Rust version to 1.57.0
|
- [changed] Changed Rust version to 1.57.0
|
||||||
- [changed] Updated dependencies
|
- [changed] Updated dependencies
|
||||||
- [fixed] Fixed problem with IPv4 addresses in listen option
|
- [fixed] Fixed problem with IPv4 addresses in listen option
|
||||||
|
- [fixed] Fixed periodic broadcast messages in switch mode
|
||||||
|
|
||||||
### v2.2.0 (2021-04-06)
|
### v2.2.0 (2021-04-06)
|
||||||
|
|
||||||
|
|
12
src/table.rs
12
src/table.rs
|
@ -48,6 +48,7 @@ impl<TS: TimeSource> ClaimTable<TS> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_claims(&mut self, peer: SocketAddr, mut claims: RangeList) {
|
pub fn set_claims(&mut self, peer: SocketAddr, mut claims: RangeList) {
|
||||||
|
let mut removed_claim = false;
|
||||||
for entry in &mut self.claims {
|
for entry in &mut self.claims {
|
||||||
if entry.peer == peer {
|
if entry.peer == peer {
|
||||||
let pos = claims.iter().position(|r| r == &entry.claim);
|
let pos = claims.iter().position(|r| r == &entry.claim);
|
||||||
|
@ -58,16 +59,19 @@ impl<TS: TimeSource> ClaimTable<TS> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
entry.timeout = 0
|
entry.timeout = 0;
|
||||||
|
removed_claim = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for claim in claims {
|
for claim in claims {
|
||||||
self.claims.push(ClaimEntry { peer, claim, timeout: TS::now() + self.claim_timeout as Time })
|
self.claims.push(ClaimEntry { peer, claim, timeout: TS::now() + self.claim_timeout as Time })
|
||||||
}
|
}
|
||||||
for entry in self.cache.values_mut() {
|
if removed_claim {
|
||||||
if entry.peer == peer {
|
for entry in self.cache.values_mut() {
|
||||||
entry.timeout = 0
|
if entry.peer == peer {
|
||||||
|
entry.timeout = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.housekeep()
|
self.housekeep()
|
||||||
|
|
Loading…
Reference in New Issue