Skip to content

Commit

Permalink
concurent write fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dvovk committed Oct 15, 2024
1 parent cafc8fc commit 757f4d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -3107,6 +3107,7 @@ func (t *Torrent) addHalfOpen(addrStr string, attemptKey *PeerInfo, lock bool) {
if path.Exists() {
panic("should be unique")
}

path.Set(attemptKey)
t.cl.numHalfOpen++
}
Expand Down Expand Up @@ -3662,7 +3663,7 @@ func (t *Torrent) handleReceivedUtHolepunchMsg(msg utHolepunch.Msg, sender *Peer
setAdd(&t.cl.probablyOnlyConnectedDueToHolepunch, holepunchAddr)
}
}
t.cl.unlock()

opts := outgoingConnOpts{
peerInfo: PeerInfo{
Addr: msg.AddrPort,
Expand All @@ -3677,7 +3678,8 @@ func (t *Torrent) handleReceivedUtHolepunchMsg(msg utHolepunch.Msg, sender *Peer
// encryption. So we will act normally.
HeaderObfuscationPolicy: t.cl.config.HeaderObfuscationPolicy,
}
initiateConn(opts, true, true)
initiateConn(opts, true, false)
t.cl.unlock()
return nil
case utHolepunch.Error:
torrent.Add("holepunch error messages received", 1)
Expand Down

0 comments on commit 757f4d7

Please sign in to comment.