forked from quic-go/quic-go
add the APPLICATION_ERROR, use it in CONNECTION_CLOSE frames
This commit is contained in:
@@ -23,6 +23,7 @@ const (
|
||||
ConnectionIDLimitError ErrorCode = 0x9
|
||||
ProtocolViolation ErrorCode = 0xa
|
||||
InvalidToken ErrorCode = 0xb
|
||||
ApplicationError ErrorCode = 0xc
|
||||
CryptoBufferExceeded ErrorCode = 0xd
|
||||
)
|
||||
|
||||
@@ -72,6 +73,8 @@ func (e ErrorCode) String() string {
|
||||
return "PROTOCOL_VIOLATION"
|
||||
case InvalidToken:
|
||||
return "INVALID_TOKEN"
|
||||
case ApplicationError:
|
||||
return "APPLICATION_ERROR"
|
||||
case CryptoBufferExceeded:
|
||||
return "CRYPTO_BUFFER_EXCEEDED"
|
||||
default:
|
||||
|
||||
@@ -16,10 +16,6 @@ type QuicError struct {
|
||||
|
||||
var _ net.Error = &QuicError{}
|
||||
|
||||
// UserCanceledError is used if the application closes the connection
|
||||
// before the handshake completes.
|
||||
var UserCanceledError = &QuicError{ErrorCode: 0x15a}
|
||||
|
||||
// NewError creates a new QuicError instance
|
||||
func NewError(errorCode ErrorCode, errorMessage string) *QuicError {
|
||||
return &QuicError{
|
||||
|
||||
Reference in New Issue
Block a user