]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Merge pull request #101 from perses/master
authorMatt Joiner <anacrolix@gmail.com>
Wed, 27 Jul 2016 02:13:41 +0000 (12:13 +1000)
committerGitHub <noreply@github.com>
Wed, 27 Jul 2016 02:13:41 +0000 (12:13 +1000)
dirwatch: fix panic when attemting to copy func into [20]byte

cmd/torrentfs/main.go
util/dirwatch/dirwatch.go

index 13f7c18a28db51c918f709857192c60223c67cf8..b5fc23dc39533ffab2100f87ab182b3f61cacfd0 100644 (file)
@@ -137,12 +137,15 @@ func main() {
        resolveTestPeerAddr()
        fs := torrentfs.New(client)
        go exitSignalHandlers(fs)
-       go func() {
-               for {
-                       addTestPeer(client)
-                       time.Sleep(10 * time.Second)
-               }
-       }()
+
+       if testPeerAddr != nil {
+               go func() {
+                       for {
+                               addTestPeer(client)
+                               time.Sleep(10 * time.Second)
+                       }
+               }()
+       }
 
        if err := fusefs.Serve(conn, fs); err != nil {
                log.Fatal(err)
index 4c5c32cd5610701b8b5220398029967fc7465a3e..1d5fe65a20b7efb0a5e0bae01d4935ea426551f0 100644 (file)
@@ -69,7 +69,7 @@ func torrentFileInfoHash(fileName string) (ih metainfo.Hash, ok bool) {
        if mi == nil {
                return
        }
-       missinggo.CopyExact(ih[:], mi.Info.Hash)
+       ih = mi.Info.Hash()
        ok = true
        return
 }