Merge pull request #101 from perses/master

dirwatch: fix panic when attemting to copy func into [20]byte
This commit is contained in:
Matt Joiner 2016-07-27 12:13:41 +10:00 committed by GitHub
commit 174e7192b5
2 changed files with 10 additions and 7 deletions

View 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)

View 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
}