finish tcp rendezvous keep alive logic following mqtt, but defined by

server so that it can be easily to be controlled at server side.
This commit is contained in:
rustdesk
2024-01-09 22:41:11 +08:00
parent e471c01269
commit f7b35defc9
4 changed files with 51 additions and 5 deletions

View File

@@ -330,6 +330,9 @@ impl Encrypt {
}
pub fn dec(&mut self, bytes: &mut BytesMut) -> Result<(), Error> {
if bytes.is_empty() {
return Ok(());
}
self.2 += 1;
let nonce = FramedStream::get_nonce(self.2);
match secretbox::open(bytes, &nonce, &self.0) {