1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 15:36:41 -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() {
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
}
}