mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-11-14 17:12:55 +00:00
refactor error messages
This commit is contained in:
parent
72d9cb8a74
commit
c4ba853887
@ -114,7 +114,7 @@ func (f FrameMetadata) AsSupplier() buf.Supplier {
|
|||||||
|
|
||||||
func ReadFrameFrom(b []byte) (*FrameMetadata, error) {
|
func ReadFrameFrom(b []byte) (*FrameMetadata, error) {
|
||||||
if len(b) < 4 {
|
if len(b) < 4 {
|
||||||
return nil, errors.New("Proxyman|Mux: Insufficient buffer.")
|
return nil, errors.New("Proxyman|Mux: Insufficient buffer: ", len(b))
|
||||||
}
|
}
|
||||||
|
|
||||||
f := &FrameMetadata{
|
f := &FrameMetadata{
|
||||||
@ -151,6 +151,8 @@ func ReadFrameFrom(b []byte) (*FrameMetadata, error) {
|
|||||||
f.Target = net.TCPDestination(addr, port)
|
f.Target = net.TCPDestination(addr, port)
|
||||||
case TargetNetworkUDP:
|
case TargetNetworkUDP:
|
||||||
f.Target = net.UDPDestination(addr, port)
|
f.Target = net.UDPDestination(addr, port)
|
||||||
|
default:
|
||||||
|
return nil, errors.New("Proxymann|Mux: Unknown network type: ", network)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user