Handle cancelled webseed peer requests if they're not active
This commit is contained in:
parent
56bb8a9713
commit
9bee7c3bc4
|
@ -50,12 +50,12 @@ func (ws *webseedPeer) _cancel(r RequestIndex) bool {
|
|||
active, ok := ws.activeRequests[ws.peer.t.requestIndexToRequest(r)]
|
||||
if ok {
|
||||
active.Cancel()
|
||||
if !ws.peer.deleteRequest(r) {
|
||||
panic("cancelled webseed request should exist")
|
||||
}
|
||||
if ws.peer.isLowOnRequests() {
|
||||
ws.peer.updateRequests("webseedPeer._cancel")
|
||||
}
|
||||
}
|
||||
if !ws.peer.deleteRequest(r) {
|
||||
panic("cancelled webseed request should exist")
|
||||
}
|
||||
if ws.peer.isLowOnRequests() {
|
||||
ws.peer.updateRequests("webseedPeer._cancel")
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue