remove unnecessary assign

pull/314/head
Darien Raymond 8 years ago
parent 9dd4f016b1
commit 2a37c62e07
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -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…
Cancel
Save