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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user