if _, ok := cn.requests[r]; ok {
return true, nil
}
+ if cn.numLocalRequests() >= cn.nominalMaxRequests() {
+ return true, errors.New("too many outstanding requests")
+ }
if !cn.peerHasPiece(pieceIndex(r.Index)) {
return true, errors.New("requesting piece peer doesn't have")
}
"sort"
"time"
- "github.com/anacrolix/log"
"github.com/anacrolix/multiless"
pp "github.com/anacrolix/torrent/peer_protocol"
"github.com/bradfitz/iter"
req := Request{pp.Integer(p.index), chunk}
_, err := peer.request(req)
if err == nil {
- log.Printf("requested %v", req)
+ //log.Printf("requested %v", req)
break
}
}