From d42d0ab064416136b8a1061f65f8667069b8d77b Mon Sep 17 00:00:00 2001 From: Termina1 Date: Thu, 21 Nov 2024 20:04:12 +0530 Subject: [PATCH] fix nil pointer --- protocol/peer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/peer.go b/protocol/peer.go index d76e8b1..e55834b 100644 --- a/protocol/peer.go +++ b/protocol/peer.go @@ -88,7 +88,7 @@ func (p *Peer) keepRead(ctx context.Context) error { } p.incomingBuffer.Store(int32(buf.Len())) - if time.Now().After(*timelimit) || buf.Len() >= p.bufferMinToProcess || buf.Len() >= p.bufferMaxSize { + if (timelimit != nil && time.Now().After(*timelimit)) || buf.Len() >= p.bufferMinToProcess || buf.Len() >= p.bufferMaxSize { select { case signal <- struct{}{}: recs, err := Split(&buf)