sync with rustdesk-server hbb_common

This commit is contained in:
rustdesk
2023-01-27 11:42:08 +08:00
parent b07f626611
commit a8c3499d7b
12 changed files with 913 additions and 923 deletions

View File

@@ -15,6 +15,12 @@ enum DecodeState {
Data(usize),
}
impl Default for BytesCodec {
fn default() -> Self {
Self::new()
}
}
impl BytesCodec {
pub fn new() -> Self {
Self {
@@ -56,7 +62,7 @@ impl BytesCodec {
}
src.advance(head_len);
src.reserve(n);
return Ok(Some(n));
Ok(Some(n))
}
fn decode_data(&self, n: usize, src: &mut BytesMut) -> io::Result<Option<BytesMut>> {