From 715a74985fbefcaaa32074d2dc28fa946b56ebe1 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 9 May 2016 23:00:20 +1000 Subject: [PATCH] Wasn't using ChunkSize from TorrentSpec --- client.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client.go b/client.go index 6201f387..65259f49 100644 --- a/client.go +++ b/client.go @@ -1556,25 +1556,22 @@ func (cl *Client) AddTorrentInfoHash(infoHash metainfo.Hash) (t *Torrent, new bo // provides one. Returns new if the torrent wasn't already in the client. func (cl *Client) AddTorrentSpec(spec *TorrentSpec) (t *Torrent, new bool, err error) { t, new = cl.AddTorrentInfoHash(spec.InfoHash) - if spec.DisplayName != "" { t.SetDisplayName(spec.DisplayName) } - if spec.Info != nil { err = t.SetInfoBytes(spec.Info.Bytes) if err != nil { return } } - cl.mu.Lock() defer cl.mu.Unlock() - + if spec.ChunkSize != 0 { + t.chunkSize = pp.Integer(spec.ChunkSize) + } t.addTrackers(spec.Trackers) - t.maybeNewConns() - return } -- 2.48.1