@@ -32,7 +32,7 @@ import (
3232)
3333
3434const (
35- removeTorrentChanBuffer = 1
35+ // removeTorrentChanBuffer = 1
3636 updateTorrentChanBuffer = 2048
3737
3838 torrentPending = iota //2
@@ -298,8 +298,8 @@ type TorrentManager struct {
298298 DataDir string
299299 TmpDataDir string
300300 closeAll chan struct {}
301- removeTorrent chan metainfo.Hash
302- updateTorrent chan interface {}
301+ // removeTorrent chan metainfo.Hash
302+ updateTorrent chan interface {}
303303 //mu sync.Mutex
304304 lock sync.RWMutex
305305 wg sync.WaitGroup
@@ -364,10 +364,10 @@ func (tm *TorrentManager) dropAll() {
364364 }
365365}
366366
367- func (tm * TorrentManager ) RemoveTorrent (input metainfo.Hash ) error {
368- tm .removeTorrent <- input
369- return nil
370- }
367+ // func (tm *TorrentManager) RemoveTorrent(input metainfo.Hash) error {
368+ // tm.removeTorrent <- input
369+ // return nil
370+ // }
371371
372372func (tm * TorrentManager ) UpdateTorrent (input interface {}) error {
373373 //go func() {tm.updateTorrent <- input}()
@@ -582,7 +582,7 @@ func (tm *TorrentManager) UpdateInfoHash(ih metainfo.Hash, BytesRequested int64)
582582}
583583
584584// DropInfoHash ...
585- func (tm * TorrentManager ) DropInfoHash (ih metainfo.Hash ) bool {
585+ /* func (tm *TorrentManager) DropInfoHash(ih metainfo.Hash) bool {
586586 if t := tm.GetTorrent(ih); t != nil {
587587 t.Torrent.Drop()
588588 tm.lock.Lock()
@@ -591,7 +591,7 @@ func (tm *TorrentManager) DropInfoHash(ih metainfo.Hash) bool {
591591 return true
592592 }
593593 return false
594- }
594+ }*/
595595
596596//var CurrentTorrentManager *TorrentManager = nil
597597
@@ -662,8 +662,8 @@ func NewTorrentManager(config *Config) *TorrentManager {
662662 TmpDataDir : tmpFilePath ,
663663 boostFetcher : NewBoostDataFetcher (config .BoostNodes ),
664664 closeAll : make (chan struct {}),
665- removeTorrent : make (chan metainfo.Hash , removeTorrentChanBuffer ),
666- updateTorrent : make (chan interface {}, updateTorrentChanBuffer ),
665+ // removeTorrent: make(chan metainfo.Hash, removeTorrentChanBuffer),
666+ updateTorrent : make (chan interface {}, updateTorrentChanBuffer ),
667667 //updateTorrent: make(chan interface{}),
668668 }
669669
@@ -697,8 +697,8 @@ func (tm *TorrentManager) mainLoop() {
697697 defer tm .wg .Done ()
698698 for {
699699 select {
700- case torrent := <- tm .removeTorrent :
701- tm .DropInfoHash (torrent )
700+ // case torrent := <-tm.removeTorrent:
701+ // tm.DropInfoHash(torrent)
702702 case msg := <- tm .updateTorrent :
703703 meta := msg .(FlowControlMeta )
704704 if meta .IsCreate {
0 commit comments