From: Matt Joiner Date: Mon, 9 May 2016 13:00:20 +0000 (+1000) Subject: Wasn't using ChunkSize from TorrentSpec X-Git-Tag: v1.0.0~738 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=715a74985fbefcaaa32074d2dc28fa946b56ebe1;p=btrtrc.git Wasn't using ChunkSize from TorrentSpec --- 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 }