mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
delay check of remote address
This commit is contained in:
parent
8ced9aeec8
commit
76776ddf99
@ -97,7 +97,7 @@ func ReadTCPSession(user *protocol.User, reader io.Reader) (*protocol.RequestHea
|
||||
}
|
||||
request.Address = v2net.DomainAddress(string(buffer.BytesFrom(-domainLength)))
|
||||
default:
|
||||
return nil, nil, errors.New("Shadowsocks|TCP: Unknown address type: ", addrType)
|
||||
// Check address validity after OTA verification.
|
||||
}
|
||||
|
||||
err = buffer.AppendSupplier(buf.ReadFullFrom(reader, 2))
|
||||
@ -120,6 +120,10 @@ func ReadTCPSession(user *protocol.User, reader io.Reader) (*protocol.RequestHea
|
||||
}
|
||||
}
|
||||
|
||||
if request.Address == nil {
|
||||
return nil, nil, errors.New("Shadowsocks|TCP: Invalid remote address.")
|
||||
}
|
||||
|
||||
var chunkReader buf.Reader
|
||||
if request.Option.Has(RequestOptionOneTimeAuth) {
|
||||
chunkReader = NewChunkReader(reader, NewAuthenticator(ChunkKeyGenerator(iv)))
|
||||
|
@ -152,6 +152,10 @@ func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request
|
||||
return nil, errors.New("VMess|Server: Invalid auth.")
|
||||
}
|
||||
|
||||
if request.Address == nil {
|
||||
return nil, errors.New("VMess|Server: Invalid remote address.")
|
||||
}
|
||||
|
||||
return request, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user