mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-29 23:34:44 +00:00
simplify connection reuse settings
This commit is contained in:
1 parent
9a8bc3fc3c
commit
ff0cb89efa
8 files changed
+19
-62
No files matched your search
@@ -39,7 +39,7 @@ func (this *Connection) Close() error {
|
||||
if this == nil || this.conn == nil {
|
||||
return ErrorClosedConnection
|
||||
}
|
||||
if transport.TCPStreamConfig.ConnectionReuse && this.Reusable() {
|
||||
if transport.IsConnectionReusable() && this.Reusable() {
|
||||
this.listener.Recycle(this.dest, this.conn)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ var (
|
||||
func Dial(dest v2net.Destination) (*Connection, error) {
|
||||
destStr := dest.String()
|
||||
var conn net.Conn
|
||||
if transport.TCPStreamConfig.ConnectionReuse {
|
||||
if transport.IsConnectionReusable() {
|
||||
conn = globalCache.Get(destStr)
|
||||
}
|
||||
if conn == nil {
|
||||
|
||||
Reference in new issue
Block a user