Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix races and panics around connections #17

Merged
merged 21 commits into from
Jul 3, 2024
Prev Previous commit
Next Next commit
remove recursive lock
  • Loading branch information
mh0lt committed Jul 2, 2024
commit 08021a8b36dd5a8e160f59952682486382f26d9d
6 changes: 3 additions & 3 deletions peerconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ func (me *PeerConn) _request(r Request, lock bool) bool {

func (me *PeerConn) _cancel(r RequestIndex, lock bool, lockTorrent bool) bool {
me.write(makeCancelMessage(me.t.requestIndexToRequest(r, lockTorrent)), lock)
return me.remoteRejectsCancels()
return me.remoteRejectsCancels(false)
}

// Whether we should expect a reject message after sending a cancel.
func (me *PeerConn) remoteRejectsCancels() bool {
if !me.fastEnabled(true) {
func (me *PeerConn) remoteRejectsCancels(lock bool) bool {
if !me.fastEnabled(lock) {
return false
}
if me.remoteIsTransmission() {
Expand Down
Loading