bump torrent v1.29.1 and fix build

This commit is contained in:
nikk gitanes
2021-07-18 10:54:15 +03:00
parent 99e4affc3d
commit d318db1a12
5 changed files with 319 additions and 19 deletions

View File

@@ -84,9 +84,10 @@ func (bt *BTServer) configure() {
Preferred: true,
}
if settings.BTsets.DhtConnectionLimit > 0 {
bt.config.ConnTracker.SetMaxEntries(settings.BTsets.DhtConnectionLimit)
}
// TODO
// if settings.BTsets.DhtConnectionLimit > 0 {
// bt.config.ConnTracker.SetMaxEntries(settings.BTsets.DhtConnectionLimit)
// }
if settings.BTsets.DownloadRateLimit > 0 {
bt.config.DownloadRateLimiter = utils.Limit(settings.BTsets.DownloadRateLimit * 1024)
}

View File

@@ -30,7 +30,11 @@ func (s *Storage) OpenTorrent(info *metainfo.Info, infoHash metainfo.Hash) (stor
ch := NewCache(s.capacity, s)
ch.Init(info, infoHash)
s.caches[infoHash] = ch
return ch, nil
//return ch, nil
return storage2.TorrentImpl{
Piece: ch.Piece,
Close: ch.Close,
}, nil
}
func (s *Storage) CloseHash(hash metainfo.Hash) {