box: reopen completed tree spools for upload
This commit is contained in:
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user