From a1105a055cf4138deba564535eb34995fa014a0b Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 15 Jan 2024 13:26:07 +1100 Subject: [PATCH] Add missing return to avoiding filling slow write buffer --- peerconn.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/peerconn.go b/peerconn.go index 7a1639f2..0dd99cef 100644 --- a/peerconn.go +++ b/peerconn.go @@ -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. -- 2.48.1