fix error usage

pull/467/head^2
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
1 changed files with 2 additions and 4 deletions

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
}