Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: body buffer too short #1090

Merged
merged 12 commits into from
Mar 19, 2021
3 changes: 2 additions & 1 deletion remoting/getty/readwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ func (p *RpcServerPackageHandler) Read(ss getty.Session, data []byte) (interface
req, length, err := (p.server.codec).Decode(data)
//resp,len, err := (*p.).DecodeResponse(buf)
if err != nil {
if err == hessian.ErrHeaderNotEnough || err == hessian.ErrBodyNotEnough {
originErr := perrors.Cause(err)
if originErr == hessian.ErrHeaderNotEnough || originErr == hessian.ErrBodyNotEnough {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using errors.Is() ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flycash please review

return nil, 0, nil
}

Expand Down