Skip to content

Commit

Permalink
fix nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Termina1 committed Nov 21, 2024
1 parent fb7278c commit d42d0ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protocol/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d42d0ab

Please sign in to comment.