mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-10-26 16:01:23 +00:00
errors.Format
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package protocol
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"v2ray.com/core/common/buf"
|
||||
@@ -228,7 +227,7 @@ func ReadRequest(reader io.Reader) (request *Socks5Request, err error) {
|
||||
return
|
||||
}
|
||||
default:
|
||||
err = fmt.Errorf("Socks: Unexpected address type %d", request.AddrType)
|
||||
err = errors.Format("Socks: Unexpected address type %d", request.AddrType)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package protocol
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"v2ray.com/core/common/buf"
|
||||
"v2ray.com/core/common/errors"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
@@ -79,7 +78,7 @@ func ReadUDPRequest(packet []byte) (*Socks5UDPRequest, error) {
|
||||
request.Address = v2net.ParseAddress(domain)
|
||||
dataBegin = 5 + domainLength + 2
|
||||
default:
|
||||
return nil, fmt.Errorf("Socks|UDP: Unknown address type %d", addrType)
|
||||
return nil, errors.Format("Socks|UDP: Unknown address type %d", addrType)
|
||||
}
|
||||
|
||||
if len(packet) > dataBegin {
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"crypto/cipher"
|
||||
"crypto/md5"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
"io"
|
||||
|
||||
@@ -14,6 +13,7 @@ import (
|
||||
"v2ray.com/core/common/buf"
|
||||
"v2ray.com/core/common/crypto"
|
||||
"v2ray.com/core/common/dice"
|
||||
"v2ray.com/core/common/errors"
|
||||
"v2ray.com/core/common/log"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/protocol"
|
||||
@@ -187,7 +187,7 @@ func (v *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.Respon
|
||||
}
|
||||
|
||||
if buffer[0] != v.responseHeader {
|
||||
return nil, fmt.Errorf("VMess|Client: Unexpected response header. Expecting %d but actually %d", v.responseHeader, buffer[0])
|
||||
return nil, errors.Format("VMess|Client: Unexpected response header. Expecting %d but actually %d", v.responseHeader, buffer[0])
|
||||
}
|
||||
|
||||
header := &protocol.ResponseHeader{
|
||||
|
||||
Reference in New Issue
Block a user