fix(lib): let an unanswered upload offer expire

An upload offer counted against the slot cap until the peer accepted
it, and a peer that never answered, having gone away or hung, held that
slot for the life of the process; with two slots by default, two such
peers shut uploads down until a restart. An offer nobody answers within
thirty seconds is now dropped, recorded as a failed upload so the
operator sees why, and the slot goes to the next in line.
This commit is contained in:
Michel de Graaf
2026-09-07 23:30:33 +02:00
parent 2d774c779f
commit 431080699d
4 changed files with 150 additions and 4 deletions
+2
View File
@@ -107,6 +107,8 @@ struct UploadJob {
real_path: std::path::PathBuf,
virtual_path: String,
size: u64,
/// When the offer went out; `None` once the peer has answered it.
offered: Option<Instant>,
}
/// Live bookkeeping for an upload being served (or recently finished).