From 97f380cd94bf03310094e4800973664dcf7bed2c Mon Sep 17 00:00:00 2001 From: hktalent <18223385+hktalent@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:30:30 +0800 Subject: [PATCH] fixed #5 2023-12-26 --- pkg/utils.go | 4 ++-- vendor/github.com/hktalent/go-utils/config.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/utils.go b/pkg/utils.go index 656a62e8..5bf945f7 100644 --- a/pkg/utils.go +++ b/pkg/utils.go @@ -42,8 +42,8 @@ func SetSSL() { // https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size func SetUdpReceiveBufferSize() { - util.DoCmd("sysctl", "-w", "net.core.rmem_max=2500000 2>/dev/null") - util.DoCmd("sysctl", "-w", "kern.ipc.maxsockbuf=3014656 2>/dev/null") + util.DoCmd("sysctl", "-w", "net.core.rmem_max=2500000") + util.DoCmd("sysctl", "-w", "kern.ipc.maxsockbuf=3014656") // , "2>/dev/null" } func RunHttp3(addr string, router *gin.Engine) (err error) { diff --git a/vendor/github.com/hktalent/go-utils/config.go b/vendor/github.com/hktalent/go-utils/config.go index 49adef37..d7a646ea 100644 --- a/vendor/github.com/hktalent/go-utils/config.go +++ b/vendor/github.com/hktalent/go-utils/config.go @@ -15,6 +15,7 @@ import ( "math/rand" "net/http" "os" + "io" "os/exec" "reflect" "regexp" @@ -351,7 +352,7 @@ func DoCmd(args ...string) (string, error) { cmd := exec.Command(args[0], args[1:]...) var stdout, stderr bytes.Buffer cmd.Stdout = &stdout // 标准输出 - cmd.Stderr = &stderr // 标准错误 + cmd.Stderr = io.Discard // 标准错误 err := cmd.Run() outStr, errStr := doReadBuff(&stdout), doReadBuff(&stderr) // out, err := cmd.CombinedOutput()