forked from quic-go/quic-go
send large max_datagram_frame size, introduce a DatagramTooLargeError error (#4143)
The size can be overwritten to a lower value for testing.
This commit is contained in:
12
errors.go
12
errors.go
@@ -61,3 +61,15 @@ func (e *StreamError) Error() string {
|
||||
}
|
||||
return fmt.Sprintf("stream %d canceled by %s with error code %d", e.StreamID, pers, e.ErrorCode)
|
||||
}
|
||||
|
||||
// DatagramTooLargeError is returned from Connection.SendDatagram if the payload is too large to be sent.
|
||||
type DatagramTooLargeError struct {
|
||||
PeerMaxDatagramFrameSize int64
|
||||
}
|
||||
|
||||
func (e *DatagramTooLargeError) Is(target error) bool {
|
||||
_, ok := target.(*DatagramTooLargeError)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (e *DatagramTooLargeError) Error() string { return "DATAGRAM frame too large" }
|
||||
|
||||
Reference in New Issue
Block a user