Skip to content

Commit

Permalink
fix: avoid return io.UnexpectedEOF error while remain is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
acynothia authored May 2, 2024
1 parent ebca72e commit 841258d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ func (c *Conn) ReadBatchWith(cfg ReadBatchConfig) *Batch {

var msgs *messageSetReader
if err == nil {
if highWaterMark == offset {
if highWaterMark == offset || remain == 0 {
msgs = &messageSetReader{empty: true}
} else {
msgs, err = newMessageSetReader(&c.rbuf, remain)
Expand Down

0 comments on commit 841258d

Please sign in to comment.