Merge pull request #982 from twmsh/master

update bytes(protobuf types) mapping, from Vec<u8> to bytes:Byte
This commit is contained in:
RustDesk
2022-07-21 18:09:14 +08:00
committed by GitHub
17 changed files with 46 additions and 35 deletions

View File

@@ -19,6 +19,7 @@ use parity_tokio_ipc::{
};
use serde_derive::{Deserialize, Serialize};
use std::{collections::HashMap, sync::atomic::Ordering};
use bytes::Bytes;
#[cfg(not(windows))]
use std::{fs::File, io::prelude::*};
@@ -75,7 +76,7 @@ pub enum FS {
WriteBlock {
id: i32,
file_num: i32,
data: Vec<u8>,
data: Bytes,
compressed: bool,
},
WriteDone {
@@ -562,8 +563,8 @@ where
}
}
pub async fn send_raw(&mut self, data: Vec<u8>) -> ResultType<()> {
self.inner.send(bytes::Bytes::from(data)).await?;
pub async fn send_raw(&mut self, data: Bytes) -> ResultType<()> {
self.inner.send(data).await?;
Ok(())
}