From d07db09d8094d38eea3ceaa8119167be62418c0b Mon Sep 17 00:00:00 2001 From: Surma Date: Sat, 7 Nov 2026 10:41:23 +0000 Subject: [PATCH] box: reopen completed tree spools for upload --- userland/box/src/transfer.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/userland/box/src/transfer.rs b/userland/box/src/transfer.rs index 5535488..17ecc41 100644 --- a/userland/box/src/transfer.rs +++ b/userland/box/src/transfer.rs @@ -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 { if !path.starts_with('/') || path == "/" { @@ -231,9 +230,11 @@ pub fn put_tree(h: &str, p: PutTree) -> Result { 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)?;