forked from quic-go/quic-go
move QUIC_GO_DISABLE_GSO check out of init (#4041)
* move QUIC_GO_DISABLE_GSO test out of init(). * Update sys_conn_helper_linux.go --------- Co-authored-by: Marten Seemann <martenseemann@gmail.com>
This commit is contained in:
committed by
GitHub
parent
824fd8a2f2
commit
8d91ad9fcd
@@ -14,15 +14,6 @@ import (
|
|||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
var gsoDisabled bool
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
disabled, err := strconv.ParseBool(os.Getenv("QUIC_GO_DISABLE_GSO"))
|
|
||||||
if err == nil {
|
|
||||||
gsoDisabled = disabled
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
msgTypeIPTOS = unix.IP_TOS
|
msgTypeIPTOS = unix.IP_TOS
|
||||||
ipv4PKTINFO = unix.IP_PKTINFO
|
ipv4PKTINFO = unix.IP_PKTINFO
|
||||||
@@ -65,7 +56,8 @@ func parseIPv4PktInfo(body []byte) (ip netip.Addr, ifIndex uint32, ok bool) {
|
|||||||
// isGSOSupported tests if the kernel supports GSO.
|
// isGSOSupported tests if the kernel supports GSO.
|
||||||
// Sending with GSO might still fail later on, if the interface doesn't support it (see isGSOError).
|
// Sending with GSO might still fail later on, if the interface doesn't support it (see isGSOError).
|
||||||
func isGSOSupported(conn syscall.RawConn) bool {
|
func isGSOSupported(conn syscall.RawConn) bool {
|
||||||
if gsoDisabled {
|
disabled, err := strconv.ParseBool(os.Getenv("QUIC_GO_DISABLE_GSO"))
|
||||||
|
if err == nil && disabled {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
var serr error
|
var serr error
|
||||||
|
|||||||
Reference in New Issue
Block a user