mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
format code
This commit is contained in:
parent
27b521d2aa
commit
e6ad1d8518
@ -123,6 +123,7 @@ func (p *bufferPool) cleanup(tick <-chan time.Time) {
|
||||
select {
|
||||
case p.chain <- make([]byte, p.bufferSize):
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ func ReadRequest(reader io.Reader) (request *Socks5Request, err error) {
|
||||
err = transport.CorruptedPacket
|
||||
return
|
||||
}
|
||||
request.Domain = string(buffer.Value[:domainLength])
|
||||
request.Domain = string(append([]byte(nil), buffer.Value[:domainLength]...))
|
||||
case AddrTypeIPv6:
|
||||
nBytes, err = reader.Read(request.IPv6[:])
|
||||
if err != nil {
|
||||
|
@ -39,7 +39,7 @@ func (this *VMessOutboundHandler) Dispatch(firstPacket v2net.Packet, ray ray.Out
|
||||
}
|
||||
|
||||
buffer := alloc.NewSmallBuffer()
|
||||
defer buffer.Release() // Buffer is released after communication finishes.
|
||||
defer buffer.Release() // Buffer is released after communication finishes.
|
||||
v2net.ReadAllBytes(rand.Reader, buffer.Value[:36]) // 16 + 16 + 4
|
||||
request.RequestIV = buffer.Value[:16]
|
||||
request.RequestKey = buffer.Value[16:32]
|
||||
|
@ -136,7 +136,7 @@ func (this *VMessRequestReader) Read(reader io.Reader) (*VMessRequest, error) {
|
||||
return nil, err
|
||||
}
|
||||
bufferLen += 1 + domainLength
|
||||
domainBytes := append([]byte(nil), buffer.Value[42 : 42+domainLength]...)
|
||||
domainBytes := append([]byte(nil), buffer.Value[42:42+domainLength]...)
|
||||
request.Address = v2net.DomainAddress(string(domainBytes))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user