]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Set torrentDataOpener from config
authorMatt Joiner <anacrolix@gmail.com>
Wed, 25 Feb 2015 04:41:13 +0000 (15:41 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 25 Feb 2015 04:41:13 +0000 (15:41 +1100)
client.go

index 83d77b3bed520d6814a9b178acd93de722d01cc6..1f823edc6f7978952017f108bad723de5db7ecbc 100644 (file)
--- a/client.go
+++ b/client.go
@@ -418,6 +418,9 @@ func NewClient(cfg *Config) (cl *Client, err error) {
                torrents: make(map[InfoHash]*torrent),
        }
        cl.event.L = &cl.mu
+       if cfg.TorrentDataOpener != nil {
+               cl.torrentDataOpener = cfg.TorrentDataOpener
+       }
 
        if !cfg.NoDefaultBlocklist {
                err = cl.setEnvBlocklist()