Skip to content

Commit 954de9f

Browse files
authored
Merge pull request #231 from CortexFoundation/dev
Dev->Master
2 parents 9ee29f3 + 9fd8a37 commit 954de9f

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

torrentfs/monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const (
5252
type TorrentManagerAPI interface {
5353
Start() error
5454
Close() error
55-
RemoveTorrent(metainfo.Hash) error
55+
//RemoveTorrent(metainfo.Hash) error
5656
UpdateTorrent(interface{}) error
5757
UpdateDynamicTrackers(trackers []string)
5858
GetTorrent(ih metainfo.Hash) *Torrent

torrentfs/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func NewFileStorage(config *Config) (*FileStorage, error) {
9191
if dbErr != nil {
9292
return nil, dbErr
9393
}
94-
db.NoSync = true
94+
//db.NoSync = true
9595

9696
fs := &FileStorage{
9797
// filesInfoHash: make(map[metainfo.Hash]*FileInfo),

torrentfs/torrentClient.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
)
3333

3434
const (
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

372372
func (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

Comments
 (0)