Skip to content

Commit

Permalink
fix: remove HEADER_LENGTH in decode because of discard
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvnszn committed Apr 15, 2022
1 parent 605764e commit fb2778f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protocol/dubbo/impl/codec.go
Expand Up @@ -157,7 +157,7 @@ func (c *ProtocolCodec) Decode(p *DubboPackage) error {
return err
}
}
if c.reader.Size() < p.GetBodyLen()+HEADER_LENGTH {
if c.reader.Size() < p.GetBodyLen() { // discard header, header length is not necessary
return hessian.ErrBodyNotEnough
}
body, err := c.reader.Peek(p.GetBodyLen())
Expand Down

0 comments on commit fb2778f

Please sign in to comment.