perf(storage): optimize internode RPC transfer path (#2262)

Co-authored-by: momoda693 <momoda693@gmail.com>
This commit is contained in:
weisd
2026-03-23 17:09:49 +08:00
committed by GitHub
parent 236142a682
commit 05dc131a49
43 changed files with 1846 additions and 566 deletions
+4 -4
View File
@@ -20,7 +20,7 @@ use crate::HttpWriter;
pub enum Writer {
Cursor(Cursor<Vec<u8>>),
Http(HttpWriter),
Http(Box<HttpWriter>),
Other(Box<dyn AsyncWrite + Unpin + Send + Sync>),
}
@@ -38,7 +38,7 @@ impl Writer {
}
pub fn from_http(w: HttpWriter) -> Self {
Writer::Http(w)
Writer::Http(Box::new(w))
}
pub fn into_cursor_inner(self) -> Option<Vec<u8>> {
@@ -56,14 +56,14 @@ impl Writer {
}
pub fn as_http(&mut self) -> Option<&mut HttpWriter> {
match self {
Writer::Http(w) => Some(w),
Writer::Http(w) => Some(w.as_mut()),
_ => None,
}
}
pub fn into_http(self) -> Option<HttpWriter> {
match self {
Writer::Http(w) => Some(w),
Writer::Http(w) => Some(*w),
_ => None,
}
}