1
0
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:
Darien Raymond 2016-01-04 14:16:52 +00:00
parent 27b521d2aa
commit e6ad1d8518
4 changed files with 4 additions and 3 deletions

View File

@ -123,6 +123,7 @@ func (p *bufferPool) cleanup(tick <-chan time.Time) {
select {
case p.chain <- make([]byte, p.bufferSize):
default:
break
}
}
}

View File

@ -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 {

View File

@ -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]

View File

@ -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))
}