From 82ee23e6d0369067ee5da13e983134f6c79c15c8 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Tue, 24 Jul 2018 21:58:47 +0200 Subject: [PATCH] make readv optional --- common/buf/io.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/common/buf/io.go b/common/buf/io.go index e51db9502..737bd355e 100644 --- a/common/buf/io.go +++ b/common/buf/io.go @@ -54,14 +54,8 @@ var useReadv = false func init() { const defaultFlagValue = "NOT_DEFINED_AT_ALL" - value := platform.NewEnvFlag("v2ray.buf.readv.disable").GetValue(func() string { return defaultFlagValue }) - if value != defaultFlagValue { - useReadv = false - return - } - - if runtime.GOOS == "linux" || runtime.GOOS == "darwin" { - newError("ReadV enabled").WriteToLog() + value := platform.NewEnvFlag("v2ray.buf.readv").GetValue(func() string { return defaultFlagValue }) + if value != defaultFlagValue && (runtime.GOOS == "linux" || runtime.GOOS == "darwin") { useReadv = true } }