mirror of
https://github.com/GiriNeko/hbb_common.git
synced 2025-12-17 05:47:28 +00:00
Merge pull request #85 from fufesou/fix/fs_flush_before_getting_buf
fix: fs, flush before getting the buf
This commit is contained in:
commit
81b932b7bf
1 changed files with 6 additions and 3 deletions
|
|
@ -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 {
|
match self.data_stream {
|
||||||
Some(DataStream::BufStream(bs)) => Some(bs.into_inner().into_inner()),
|
Some(DataStream::BufStream(mut bs)) => {
|
||||||
_ => None,
|
bs.flush().await?;
|
||||||
|
Ok(Some(bs.into_inner().into_inner()))
|
||||||
|
}
|
||||||
|
_ => Ok(None),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue