Fix race in MergeSpec using DisableInitialPieceCheck
This commit is contained in:
parent
09df09596d
commit
716dc55321
|
@ -1301,7 +1301,6 @@ func (t *Torrent) MergeSpec(spec *TorrentSpec) error {
|
||||||
if spec.DisplayName != "" {
|
if spec.DisplayName != "" {
|
||||||
t.SetDisplayName(spec.DisplayName)
|
t.SetDisplayName(spec.DisplayName)
|
||||||
}
|
}
|
||||||
t.initialPieceCheckDisabled = spec.DisableInitialPieceCheck
|
|
||||||
if spec.InfoBytes != nil {
|
if spec.InfoBytes != nil {
|
||||||
err := t.SetInfoBytes(spec.InfoBytes)
|
err := t.SetInfoBytes(spec.InfoBytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1312,6 +1311,7 @@ func (t *Torrent) MergeSpec(spec *TorrentSpec) error {
|
||||||
cl.AddDhtNodes(spec.DhtNodes)
|
cl.AddDhtNodes(spec.DhtNodes)
|
||||||
cl.lock()
|
cl.lock()
|
||||||
defer cl.unlock()
|
defer cl.unlock()
|
||||||
|
t.initialPieceCheckDisabled = spec.DisableInitialPieceCheck
|
||||||
useTorrentSources(spec.Sources, t)
|
useTorrentSources(spec.Sources, t)
|
||||||
for _, url := range spec.Webseeds {
|
for _, url := range spec.Webseeds {
|
||||||
t.addWebSeed(url)
|
t.addWebSeed(url)
|
||||||
|
|
Loading…
Reference in New Issue