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 SendDatagram #4436
Fix SendDatagram #4436
Conversation
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.
Code looks correct to me, but can we have a test?
I found that there is already a test: quic-go/integrationtests/self/datagram_test.go Lines 66 to 68 in 7b9d21f
But MatchError always returns true because DatagramTooLargeError implements Is(error) incorrectly func (matcher *MatchErrorMatcher) Match(actual any) (success bool, err error) {
...
// first try the built-in errors.Is
if errors.Is(actualErr, expected.(error)) {
return true, nil
} Lines 70 to 73 in 7b9d21f
|
e84d1f5
to
a3bb384
Compare
a3bb384
to
c83ad80
Compare
It almost passed. There is a race, but it doesn't seem to be related to my changes. |
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.
I don’t understand your changes regarding the errors. I also don’t see any test that’s testing your change.
These lines should test the PeerMaxDatagramFrameSize returned by SendDatagram but actually always pass because error has a wrong implementation of Is(error). According to the implementation of errors.Is , Is(error) should check for equality, not the type (that's what errors.As implements). quic-go/integrationtests/self/datagram_test.go Lines 66 to 68 in 7b9d21f
|
That might be a separate issue. Please don't change the error implementation in this PR. |
@nekohasekai Are you still working on this PR? Would be nice to get the fix into the v0.43 release. |
SendDatagram returned wrong PeerMaxDatagramFrameSize value