diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dc251f..5fd9225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project follows [semantic versioning](http://semver.org). - [added] Added crypto option AES128 - [changed] Updated dependencies +- [fixed] Fixed keepalive for small timeouts ### v1.4.0 (2020-06-03) diff --git a/src/cloud.rs b/src/cloud.rs index 0f31c6b..88865e5 100644 --- a/src/cloud.rs +++ b/src/cloud.rs @@ -3,7 +3,7 @@ // This software is licensed under GPL-3 or newer (see LICENSE.md) use std::{ - cmp::min, + cmp::{min, max}, collections::HashMap, fmt, fs::{self, File}, @@ -473,7 +473,7 @@ impl GenericCloud Duration { match self.keepalive { Some(dur) => dur, - None => self.peer_timeout / 2 - 60 + None => max(self.peer_timeout / 2 - 60, 1) } } }