mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-28 21:15:46 -05:00
rename CorruptedPacket to ErrorCorruptedPacket
This commit is contained in:
@@ -41,7 +41,7 @@ func (request *Socks5UDPRequest) Write(buffer *alloc.Buffer) {
|
||||
|
||||
func ReadUDPRequest(packet []byte) (*Socks5UDPRequest, error) {
|
||||
if len(packet) < 5 {
|
||||
return nil, transport.CorruptedPacket
|
||||
return nil, transport.ErrorCorruptedPacket
|
||||
}
|
||||
request := new(Socks5UDPRequest)
|
||||
|
||||
@@ -54,7 +54,7 @@ func ReadUDPRequest(packet []byte) (*Socks5UDPRequest, error) {
|
||||
switch addrType {
|
||||
case AddrTypeIPv4:
|
||||
if len(packet) < 10 {
|
||||
return nil, transport.CorruptedPacket
|
||||
return nil, transport.ErrorCorruptedPacket
|
||||
}
|
||||
ip := packet[4:8]
|
||||
request.Port = v2net.PortFromBytes(packet[8:10])
|
||||
@@ -62,7 +62,7 @@ func ReadUDPRequest(packet []byte) (*Socks5UDPRequest, error) {
|
||||
dataBegin = 10
|
||||
case AddrTypeIPv6:
|
||||
if len(packet) < 22 {
|
||||
return nil, transport.CorruptedPacket
|
||||
return nil, transport.ErrorCorruptedPacket
|
||||
}
|
||||
ip := packet[4:20]
|
||||
request.Port = v2net.PortFromBytes(packet[20:22])
|
||||
@@ -71,7 +71,7 @@ func ReadUDPRequest(packet []byte) (*Socks5UDPRequest, error) {
|
||||
case AddrTypeDomain:
|
||||
domainLength := int(packet[4])
|
||||
if len(packet) < 5+domainLength+2 {
|
||||
return nil, transport.CorruptedPacket
|
||||
return nil, transport.ErrorCorruptedPacket
|
||||
}
|
||||
domain := string(packet[5 : 5+domainLength])
|
||||
request.Port = v2net.PortFromBytes(packet[5+domainLength : 5+domainLength+2])
|
||||
|
||||
Reference in New Issue
Block a user