1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 15:36:41 -05:00

fix error usage

This commit is contained in:
Darien Raymond 2017-02-02 10:51:15 +01:00
parent 815e13f302
commit 8afdbbfc9f
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -12,7 +12,6 @@ import (
"v2ray.com/core/common/buf" "v2ray.com/core/common/buf"
"v2ray.com/core/common/crypto" "v2ray.com/core/common/crypto"
"v2ray.com/core/common/errors" "v2ray.com/core/common/errors"
"v2ray.com/core/app/log"
"v2ray.com/core/common/net" "v2ray.com/core/common/net"
"v2ray.com/core/common/protocol" "v2ray.com/core/common/protocol"
"v2ray.com/core/common/serial" "v2ray.com/core/common/serial"
@ -42,8 +41,7 @@ func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
_, err := io.ReadFull(reader, buffer[:protocol.IDBytesLen]) _, err := io.ReadFull(reader, buffer[:protocol.IDBytesLen])
if err != nil { if err != nil {
log.Info("VMess|Server: Failed to read request header: ", err) return nil, errors.Base(err).Message("VMess|Server: Failed to read request header.")
return nil, io.EOF
} }
user, timestamp, valid := v.userValidator.Get(buffer[:protocol.IDBytesLen]) user, timestamp, valid := v.userValidator.Get(buffer[:protocol.IDBytesLen])
@ -123,7 +121,7 @@ func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
if padingLen > 0 { if padingLen > 0 {
_, err = io.ReadFull(decryptor, buffer[bufferLen:bufferLen+padingLen]) _, err = io.ReadFull(decryptor, buffer[bufferLen:bufferLen+padingLen])
if err != nil { if err != nil {
return nil, errors.New("VMess|Server: Failed to read padding.") return nil, errors.Base(err).Message("VMess|Server: Failed to read padding.")
} }
bufferLen += padingLen bufferLen += padingLen
} }