Skip to content

Commit

Permalink
Fix auto-rename bug in end-of-stream logic
Browse files Browse the repository at this point in the history
The termination condition on this while loop was incorrect; I think this
snuck in during an automated rename of a super-short variable.
  • Loading branch information
akshayjshah committed Apr 8, 2022
1 parent f396e2c commit 3413e46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protocol_grpc_lpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (u *unmarshaler) Unmarshal(message any) (retErr *Error) {
if err != nil && !errors.Is(err, io.EOF) {
return errorf(CodeUnknown, "error reading length-prefixed message data: %w", err)
}
if errors.Is(err, io.EOF) && prefixBytesRead == 0 {
if errors.Is(err, io.EOF) && bytesRead == 0 {
// We've gotten zero-length chunk of data. Message is likely malformed,
// don't wait for additional chunks.
return errorf(
Expand Down

0 comments on commit 3413e46

Please sign in to comment.