include the maximum payload size in the DatagramTooLargeError (#4470)

This is more useful than the maximum frame size. The user of the library
shouldn't have to care about the QUIC framing layer.

---------

Co-authored-by: 世界 <i@sekai.icu>
This commit is contained in:
Marten Seemann
2024-04-27 14:54:16 +02:00
committed by GitHub
parent 34f4d1443f
commit c0250ce824
4 changed files with 39 additions and 6 deletions

View File

@@ -64,7 +64,7 @@ func (e *StreamError) Error() string {
// DatagramTooLargeError is returned from Connection.SendDatagram if the payload is too large to be sent.
type DatagramTooLargeError struct {
PeerMaxDatagramFrameSize int64
MaxDatagramPayloadSize int64
}
func (e *DatagramTooLargeError) Is(target error) bool {