Skip to content

Commit

Permalink
Use Next instead of io.Discard to skip header
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderYastrebov committed Oct 15, 2024
1 parent 8d833b8 commit 0067a88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (p *Conn) readHeader() error {
header, err := Read(br)

if err == nil {
_, err = io.CopyN(io.Discard, bb, int64(bb.Len()-br.Buffered()))
_ = bb.Next(bb.Len() - br.Buffered()) // skip header
}

if bb.Len() == 0 {
Expand Down

0 comments on commit 0067a88

Please sign in to comment.