]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Can't send to torrentFinished while handling an event
authorMatt Joiner <anacrolix@gmail.com>
Sat, 28 Sep 2013 18:04:46 +0000 (04:04 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 28 Sep 2013 18:04:46 +0000 (04:04 +1000)
client.go

index 960e8af8532a4cd22d0f7ede1b85a5a070978fca..c34574fd23eca813d003e52f74e77cd458537a68 100644 (file)
--- a/client.go
+++ b/client.go
@@ -192,7 +192,9 @@ func (me *client) pieceHashed(ih infoHash, piece int, correct bool) {
                        return
                }
        }
-       me.torrentFinished <- ih
+       go func() {
+               me.torrentFinished <- ih
+       }()
 }
 
 func (me *client) run() {