From: Matt Joiner Date: Sat, 18 Sep 2021 11:01:06 +0000 (+1000) Subject: When updating requests, only tickle writer if there are no requests pending X-Git-Tag: v1.32.0~32 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=cd49f75cb9ca83065609d02d9813acf31e24b4af;p=btrtrc.git When updating requests, only tickle writer if there are no requests pending Just a quick attempt to reduce load for now. There'll be a much better way to do this. --- diff --git a/peerconn.go b/peerconn.go index 4eca560e..452166ac 100644 --- a/peerconn.go +++ b/peerconn.go @@ -653,6 +653,9 @@ func (cn *PeerConn) postBitfield() { } func (cn *PeerConn) updateRequests() { + if len(cn.actualRequestState.Requests) != 0 { + return + } cn.tickleWriter() }