feat: track uploads with progress and cancellation

serve_file streams in chunks, updating a shared byte counter and
aborting with Interrupted when a cancel flag is set. Each served upload
is registered (peer, virtual path, size, live progress, status) and
exposed via Client::uploads(); Client::cancel_upload flags a matching
in-progress transfer. e2e: the download test now also asserts the
uploader recorded a completed upload with the right peer and byte
count.
This commit is contained in:
michel
2026-07-20 20:51:22 +02:00
parent be8197fd31
commit 6238c44312
6 changed files with 225 additions and 8 deletions
+2
View File
@@ -652,6 +652,8 @@ impl Client {
UploadJob {
downloader: downloader.clone(),
real_path,
virtual_path: filename.clone(),
size,
},
);
(ctx.peer_registry.clone(), size)