Skip to content

Commit

Permalink
fix prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Jun 28, 2024
1 parent 36cd8fe commit e038c51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layer4/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (routes RouteList) Compile(logger *zap.Logger, matchingTimeout time.Duratio
for {
// only prefetch is needed, it's useful in case a RouteList in another RouteList cases
// if some matchers returned ErrConsumedAllPrefetchedBytes, it's true anyway
if len(cx.buf) == 0 || len(cx.buf) == cx.offset {
if len(cx.buf) == 0 || len(cx.buf[cx.offset:]) == 0 {
err = cx.prefetch()
if err != nil {
logFunc := logger.Error
Expand Down

0 comments on commit e038c51

Please sign in to comment.