feat: quic-go v0.41.0

This commit is contained in:
Toby
2024-01-21 16:58:22 -08:00
parent c4993f8dd1
commit e648321b96
8 changed files with 13 additions and 22 deletions

View File

@@ -60,11 +60,11 @@ func (u *udpConn) Send(data []byte, addr string) error {
Data: data,
}
err := u.SendFunc(u.SendBuf, msg)
var errTooLarge quic.ErrMessageTooLarge
var errTooLarge *quic.DatagramTooLargeError
if errors.As(err, &errTooLarge) {
// Message too large, try fragmentation
msg.PacketID = uint16(rand.Intn(0xFFFF)) + 1
fMsgs := frag.FragUDPMessage(msg, int(errTooLarge))
fMsgs := frag.FragUDPMessage(msg, int(errTooLarge.MaxDataLen))
for _, fMsg := range fMsgs {
err := u.SendFunc(u.SendBuf, &fMsg)
if err != nil {