]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add missing return to avoiding filling slow write buffer
authorMatt Joiner <anacrolix@gmail.com>
Mon, 15 Jan 2024 02:26:07 +0000 (13:26 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 15 Jan 2024 02:26:07 +0000 (13:26 +1100)
peerconn.go

index 7a1639f29a1b18bfa67831fc33930986efeaaa6c..0dd99cef1f86216d35c50c8641d06aa4711c46c0 100644 (file)
@@ -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() {
@@ -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.