forked from quic-go/quic-go
check for WSAEMSGSIZE errors when receiving UDP packets on Windows (#3982)
* check for WSAEMSGSIZE errors when receiving UDP packets on Windows * check EMSGSIZE error on macOS
This commit is contained in:
@@ -57,11 +57,13 @@ func maybeSetGSO(rawConn syscall.RawConn) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func isMsgSizeErr(err error) bool {
|
||||
func isSendMsgSizeErr(err error) bool {
|
||||
// https://man7.org/linux/man-pages/man7/udp.7.html
|
||||
return errors.Is(err, unix.EMSGSIZE)
|
||||
}
|
||||
|
||||
func isRecvMsgSizeErr(err error) bool { return false }
|
||||
|
||||
func appendUDPSegmentSizeMsg(b []byte, size uint16) []byte {
|
||||
startLen := len(b)
|
||||
const dataLen = 2 // payload is a uint16
|
||||
|
||||
Reference in New Issue
Block a user