1 Star 0 Fork 1

lsj/go-torrent

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
peer.go 510 Bytes
一键复制 编辑 原始数据 按行查看 历史
Matt Joiner 提交于 2021-12-24 08:55 . Dynamic outbound max requests
package torrent
func (p *Peer) isLowOnRequests() bool {
return p.requestState.Requests.IsEmpty() && p.requestState.Cancelled.IsEmpty()
}
func (p *Peer) decPeakRequests() {
// // This can occur when peak requests are altered by the update request timer to be lower than
// // the actual number of outstanding requests. Let's let it go negative and see what happens. I
// // wonder what happens if maxRequests is not signed.
// if p.peakRequests < 1 {
// panic(p.peakRequests)
// }
p.peakRequests--
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/leesj/go-torrent.git
git@gitee.com:leesj/go-torrent.git
leesj
go-torrent
go-torrent
master

搜索帮助