Add disabled code for limiting wasted chunks
This commit is contained in:
parent
e7426133e2
commit
344ada8b7c
|
@ -1335,6 +1335,7 @@ func (c *Peer) receiveChunk(msg *pp.Message) error {
|
|||
|
||||
// Do we actually want this chunk?
|
||||
if t.haveChunk(ppReq) {
|
||||
//panic(fmt.Sprintf("%+v", ppReq))
|
||||
chunksReceived.Add("wasted", 1)
|
||||
c.allStats(add(1, func(cs *ConnStats) *Count { return &cs.ChunksReadWasted }))
|
||||
return nil
|
||||
|
|
|
@ -215,6 +215,9 @@ func (p *Peer) getDesiredRequestState() (desired requestState) {
|
|||
allowedFast := p.peerAllowedFast.ContainsInt(pieceIndex)
|
||||
rsp.IterPendingChunks.Iter(func(ci request_strategy.ChunkIndex) {
|
||||
r := p.t.pieceRequestIndexOffset(pieceIndex) + ci
|
||||
//if p.t.pendingRequests.Get(r) != 0 && !p.actualRequestState.Requests.Contains(r) {
|
||||
// return
|
||||
//}
|
||||
if !allowedFast {
|
||||
// We must signal interest to request this
|
||||
desired.Interested = true
|
||||
|
|
Loading…
Reference in New Issue