1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 22:15:27 -05:00

format code

This commit is contained in:
V2Ray
2015-10-08 23:29:06 +02:00
parent ebb4f5b7bd
commit 936fd03c30
2 changed files with 9 additions and 9 deletions

View File

@@ -27,14 +27,14 @@ func (request *Socks5UDPRequest) Write(buffer *alloc.Buffer) {
buffer.AppendBytes(0, 0, request.Fragment)
switch {
case request.Address.IsIPv4():
buffer.AppendBytes(AddrTypeIPv4).Append(request.Address.IP())
buffer.AppendBytes(AddrTypeIPv4).Append(request.Address.IP())
case request.Address.IsIPv6():
buffer.AppendBytes(AddrTypeIPv6).Append(request.Address.IP())
buffer.AppendBytes(AddrTypeIPv6).Append(request.Address.IP())
case request.Address.IsDomain():
buffer.AppendBytes(AddrTypeDomain, byte(len(request.Address.Domain()))).Append([]byte(request.Address.Domain()))
buffer.AppendBytes(AddrTypeDomain, byte(len(request.Address.Domain()))).Append([]byte(request.Address.Domain()))
}
buffer.Append(request.Address.PortBytes())
buffer.Append(request.Data.Value)
buffer.Append(request.Address.PortBytes())
buffer.Append(request.Data.Value)
}
func ReadUDPRequest(packet []byte) (request Socks5UDPRequest, err error) {