mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 14:57:44 -05:00
remove unnecessary assign
This commit is contained in:
parent
9dd4f016b1
commit
2a37c62e07
@ -92,14 +92,14 @@ func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
|||||||
|
|
||||||
switch buffer[40] {
|
switch buffer[40] {
|
||||||
case AddrTypeIPv4:
|
case AddrTypeIPv4:
|
||||||
nBytes, err = io.ReadFull(decryptor, buffer[41:45]) // 4 bytes
|
_, err = io.ReadFull(decryptor, buffer[41:45]) // 4 bytes
|
||||||
bufferLen += 4
|
bufferLen += 4
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("VMess|Server: Failed to read IPv4: " + err.Error())
|
return nil, errors.New("VMess|Server: Failed to read IPv4: " + err.Error())
|
||||||
}
|
}
|
||||||
request.Address = v2net.IPAddress(buffer[41:45])
|
request.Address = v2net.IPAddress(buffer[41:45])
|
||||||
case AddrTypeIPv6:
|
case AddrTypeIPv6:
|
||||||
nBytes, err = io.ReadFull(decryptor, buffer[41:57]) // 16 bytes
|
_, err = io.ReadFull(decryptor, buffer[41:57]) // 16 bytes
|
||||||
bufferLen += 16
|
bufferLen += 16
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("VMess|Server: Failed to read IPv6 address: " + err.Error())
|
return nil, errors.New("VMess|Server: Failed to read IPv6 address: " + err.Error())
|
||||||
@ -114,7 +114,7 @@ func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
|||||||
if domainLength == 0 {
|
if domainLength == 0 {
|
||||||
return nil, errors.New("VMess|Server: Zero domain length.")
|
return nil, errors.New("VMess|Server: Zero domain length.")
|
||||||
}
|
}
|
||||||
nBytes, err = io.ReadFull(decryptor, buffer[42:42+domainLength])
|
_, err = io.ReadFull(decryptor, buffer[42:42+domainLength])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("VMess|Server: Failed to read domain: " + err.Error())
|
return nil, errors.New("VMess|Server: Failed to read domain: " + err.Error())
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
|||||||
request.Address = v2net.DomainAddress(string(buffer[42 : 42+domainLength]))
|
request.Address = v2net.DomainAddress(string(buffer[42 : 42+domainLength]))
|
||||||
}
|
}
|
||||||
|
|
||||||
nBytes, err = io.ReadFull(decryptor, buffer[bufferLen:bufferLen+4])
|
_, err = io.ReadFull(decryptor, buffer[bufferLen:bufferLen+4])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("VMess|Server: Failed to read checksum: " + err.Error())
|
return nil, errors.New("VMess|Server: Failed to read checksum: " + err.Error())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user