2016-06-01 23:49:25 +00:00
|
|
|
package transport
|
|
|
|
|
|
|
|
import "github.com/v2ray/v2ray-core/common/log"
|
|
|
|
|
|
|
|
var (
|
2016-06-02 00:20:53 +00:00
|
|
|
TCPStreamConfig = TCPConfig{
|
2016-06-01 23:49:25 +00:00
|
|
|
ConnectionReuse: false,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func ApplyConfig(config *Config) error {
|
|
|
|
if config.StreamType == StreamTypeTCP {
|
|
|
|
if config.TCPConfig != nil {
|
2016-06-02 00:20:53 +00:00
|
|
|
TCPStreamConfig.ConnectionReuse = config.TCPConfig.ConnectionReuse
|
|
|
|
if TCPStreamConfig.ConnectionReuse {
|
2016-06-01 23:49:25 +00:00
|
|
|
log.Info("Transport: TCP connection reuse enabled.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|