-
Notifications
You must be signed in to change notification settings - Fork 929
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
Conversation
…of the body buffer is smaller than the size marked by header
would u add an ut for ur pr? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
remoting/getty/readwriter.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flycash please review
Codecov Report
@@ Coverage Diff @@
## 1.5 #1090 +/- ##
==========================================
- Coverage 59.53% 59.10% -0.43%
==========================================
Files 259 269 +10
Lines 12737 13122 +385
==========================================
+ Hits 7583 7756 +173
- Misses 4199 4396 +197
- Partials 955 970 +15
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does:
Which issue(s) this PR fixes:
Fixes #1089
Special notes for your reviewer:
Does this PR introduce a user-facing change?: