forked from quic-go/quic-go
remove the Token field from the StatelessResetError (#4740)
There's nothing the application could possibly do with this value.
This commit is contained in:
@@ -114,14 +114,12 @@ func (e *VersionNegotiationError) Is(target error) bool {
|
||||
}
|
||||
|
||||
// A StatelessResetError occurs when we receive a stateless reset.
|
||||
type StatelessResetError struct {
|
||||
Token protocol.StatelessResetToken
|
||||
}
|
||||
type StatelessResetError struct{}
|
||||
|
||||
var _ net.Error = &StatelessResetError{}
|
||||
|
||||
func (e *StatelessResetError) Error() string {
|
||||
return fmt.Sprintf("received a stateless reset with token %x", e.Token)
|
||||
return "received a stateless reset"
|
||||
}
|
||||
|
||||
func (e *StatelessResetError) Is(target error) bool {
|
||||
|
||||
@@ -117,9 +117,7 @@ func TestVersionNegotiationErrorString(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStatelessResetErrorString(t *testing.T) {
|
||||
token := protocol.StatelessResetToken{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}
|
||||
err := &StatelessResetError{Token: token}
|
||||
require.Equal(t, "received a stateless reset with token 000102030405060708090a0b0c0d0e0f", err.Error())
|
||||
require.Equal(t, "received a stateless reset", (&StatelessResetError{}).Error())
|
||||
}
|
||||
|
||||
func TestStatelessResetErrorIsNetError(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user