mirror of
https://github.com/rustdesk/hbb_common.git
synced 2025-07-01 23:47:24 +00:00
fix: fs, flush before getting the buf
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
9ede5d49f6
commit
77113964cf
@ -513,10 +513,13 @@ impl TransferJob {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn get_buf_data(self) -> Option<Vec<u8>> {
|
||||
pub async fn get_buf_data(self) -> ResultType<Option<Vec<u8>>> {
|
||||
match self.data_stream {
|
||||
Some(DataStream::BufStream(bs)) => Some(bs.into_inner().into_inner()),
|
||||
_ => None,
|
||||
Some(DataStream::BufStream(mut bs)) => {
|
||||
bs.flush().await?;
|
||||
Ok(Some(bs.into_inner().into_inner()))
|
||||
}
|
||||
_ => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user