1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-05 00:47:51 -05:00

make readv optional

This commit is contained in:
Darien Raymond 2018-07-24 21:58:47 +02:00
parent a941ef5392
commit 82ee23e6d0
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -54,14 +54,8 @@ var useReadv = false
func init() { func init() {
const defaultFlagValue = "NOT_DEFINED_AT_ALL" const defaultFlagValue = "NOT_DEFINED_AT_ALL"
value := platform.NewEnvFlag("v2ray.buf.readv.disable").GetValue(func() string { return defaultFlagValue }) value := platform.NewEnvFlag("v2ray.buf.readv").GetValue(func() string { return defaultFlagValue })
if value != defaultFlagValue { if value != defaultFlagValue && (runtime.GOOS == "linux" || runtime.GOOS == "darwin") {
useReadv = false
return
}
if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
newError("ReadV enabled").WriteToLog()
useReadv = true useReadv = true
} }
} }