1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-31 06:25:32 -05:00

understand OTA bit

This commit is contained in:
Darien Raymond
2016-01-29 14:09:51 +00:00
parent 008c285324
commit 7f5184e943
3 changed files with 43 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ const (
type Request struct {
Address v2net.Address
Port v2net.Port
OTA bool
}
func ReadRequest(reader io.Reader) (*Request, error) {
@@ -32,7 +33,10 @@ func ReadRequest(reader io.Reader) (*Request, error) {
request := new(Request)
addrType := buffer.Value[0]
addrType := (buffer.Value[0] & 0x0F)
if (buffer.Value[0] & 0x10) == 0x10 {
request.OTA = true
}
switch addrType {
case AddrTypeIPv4:
_, err := io.ReadFull(reader, buffer.Value[:4])