mirror of
https://github.com/XTLS/REALITY.git
synced 2025-08-30 02:15:32 +00:00
Reuse buf
(though io.CopyBuffer()
is not likely to actually use it)
This commit is contained in:
parent
dc9a7cef8e
commit
6288e760a9
6
tls.go
6
tls.go
@ -265,7 +265,7 @@ func Server(ctx context.Context, conn net.Conn, config *Config) (*Conn, error) {
|
|||||||
} else {
|
} else {
|
||||||
copying = true
|
copying = true
|
||||||
mutex.Unlock()
|
mutex.Unlock()
|
||||||
io.Copy(target, underlying)
|
io.CopyBuffer(target, underlying, buf)
|
||||||
}
|
}
|
||||||
waitGroup.Done()
|
waitGroup.Done()
|
||||||
}()
|
}()
|
||||||
@ -330,7 +330,7 @@ func Server(ctx context.Context, conn net.Conn, config *Config) (*Conn, error) {
|
|||||||
}
|
}
|
||||||
if i == 2 && handshakeLen > 512 {
|
if i == 2 && handshakeLen > 512 {
|
||||||
hs.c.out.handshakeLen[i] = handshakeLen
|
hs.c.out.handshakeLen[i] = handshakeLen
|
||||||
hs.c.out.handshakeBuf = s2cSaved[:0]
|
hs.c.out.handshakeBuf = buf[:0]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if i == 6 && handshakeLen > 0 {
|
if i == 6 && handshakeLen > 0 {
|
||||||
@ -368,7 +368,7 @@ func Server(ctx context.Context, conn net.Conn, config *Config) (*Conn, error) {
|
|||||||
} else {
|
} else {
|
||||||
copying = true
|
copying = true
|
||||||
mutex.Unlock()
|
mutex.Unlock()
|
||||||
io.Copy(underlying, target)
|
io.CopyBuffer(underlying, target, buf)
|
||||||
}
|
}
|
||||||
waitGroup.Done()
|
waitGroup.Done()
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user