]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Don't panic if changing interest fills the write buffer
authorMatt Joiner <anacrolix@gmail.com>
Fri, 19 May 2023 04:09:27 +0000 (14:09 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 19 May 2023 04:09:27 +0000 (14:09 +1000)
This was the old behaviour, years ago. I don't know why it's suddenly being triggered lately.

requesting.go

index 7fbfccfbba1776a69c59d1d8a9123cf8f7bb2ccf..f9b5424f003a771ebe78e655b2eac82089193ffd 100644 (file)
@@ -272,7 +272,7 @@ func (p *Peer) maybeUpdateActualRequestState() {
 func (p *Peer) applyRequestState(next desiredRequestState) {
        current := &p.requestState
        if !p.setInterested(next.Interested) {
-               panic("insufficient write buffer")
+               return
        }
        more := true
        requestHeap := binheap.FromSlice(next.Requests.requestIndexes, next.Requests.lessByValue)