box: reopen completed tree spools for upload

This commit is contained in:
2026-11-07 10:41:23 +00:00
parent 85735ccf19
commit d07db09d80
+4 -3
View File
@@ -1,6 +1,5 @@
//! Bounded streaming transfers. Payloads stay in HTTP/VFS, not RPC responses.
use super::*;
use std::io::{Seek, SeekFrom};
pub fn file_path(id: &str, path: &str) -> Result<String> {
if !path.starts_with('/') || path == "/" {
@@ -231,9 +230,11 @@ pub fn put_tree(h: &str, p: PutTree) -> Result<OkResult> {
let mut tar = tar::Builder::new(f);
tar.follow_symlinks(false);
append_tree(&mut tar, Path::new(&p.from_vfs_dir), Path::new("."))?;
let mut f = tar.into_inner()?;
let mut output = tar.into_inner()?;
output.flush()?;
drop(output);
let mut f = File::open(spool.path())?;
let len = f.metadata()?.len();
f.seek(SeekFrom::Start(0))?;
let remote = remote_tmp();
let result = (|| -> Result<()> {
put(h, &p.id, &remote, &mut f, len)?;