1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -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/crypto"
"v2ray.com/core/common/errors"
"v2ray.com/core/app/log"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol"
"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])
if err != nil {
log.Info("VMess|Server: Failed to read request header: ", err)
return nil, io.EOF
return nil, errors.Base(err).Message("VMess|Server: Failed to read request header.")
}
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 {
_, err = io.ReadFull(decryptor, buffer[bufferLen:bufferLen+padingLen])
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
}