Skip to content

Commit

Permalink
Add missing return to avoiding filling slow write buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Jan 15, 2024
1 parent 6e8634e commit a1105a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions peerconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func (cn *PeerConn) fillWriteBuffer() {
// request reason will not be cleared, so we'll come right back here when there's space. We
// can't do this in maybeUpdateActualRequestState because it's a method on Peer and has no
// knowledge of write buffers.
return
}
cn.maybeUpdateActualRequestState()
if cn.pex.IsEnabled() {
Expand Down Expand Up @@ -983,8 +984,8 @@ func (c *PeerConn) setRetryUploadTimer(delay time.Duration) {

// Also handles choking and unchoking of the remote peer.
func (c *PeerConn) upload(msg func(pp.Message) bool) bool {
// Breaking or completing this loop means we don't want to upload to the
// peer anymore, and we choke them.
// Breaking or completing this loop means we don't want to upload to the peer anymore, and we
// choke them.
another:
for c.uploadAllowed() {
// We want to upload to the peer.
Expand Down

0 comments on commit a1105a0

Please sign in to comment.