]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix bad init of Torrent.requestStrategy
authorMatt Joiner <anacrolix@gmail.com>
Mon, 13 Jan 2020 23:30:20 +0000 (10:30 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 13 Jan 2020 23:51:09 +0000 (10:51 +1100)
client.go

index fddddf4814964c6257a4111329d97e4c9960f108..620b4b62158b8e3d9487968ddb2887b9b64dbf46 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1039,11 +1039,11 @@ func (cl *Client) newTorrent(ih metainfo.Hash, specStorage storage.ClientImpl) (
                maxEstablishedConns: cl.config.EstablishedConnsPerTorrent,
 
                networkingEnabled: true,
-               requestStrategy:   cl.config.DefaultRequestStrategy(t.requestStrategyCallbacks()),
                metadataChanged: sync.Cond{
                        L: cl.locker(),
                },
        }
+       t.requestStrategy = cl.config.DefaultRequestStrategy(t.requestStrategyCallbacks())
        t.logger = cl.logger.WithValues(t).WithText(func(m log.Msg) string {
                return fmt.Sprintf("%v: %s", t, m.Text())
        })