mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
move back to serial
This commit is contained in:
@@ -16,15 +16,15 @@ import (
|
||||
"v2ray.com/core/common/crypto"
|
||||
"v2ray.com/core/common/dice"
|
||||
"v2ray.com/core/common/protocol"
|
||||
"v2ray.com/core/common/vio"
|
||||
"v2ray.com/core/common/serial"
|
||||
"v2ray.com/core/proxy/vmess"
|
||||
)
|
||||
|
||||
func hashTimestamp(h hash.Hash, t protocol.Timestamp) []byte {
|
||||
vio.WriteUint64(h, uint64(t))
|
||||
vio.WriteUint64(h, uint64(t))
|
||||
vio.WriteUint64(h, uint64(t))
|
||||
vio.WriteUint64(h, uint64(t))
|
||||
serial.WriteUint64(h, uint64(t))
|
||||
serial.WriteUint64(h, uint64(t))
|
||||
serial.WriteUint64(h, uint64(t))
|
||||
serial.WriteUint64(h, uint64(t))
|
||||
return h.Sum(nil)
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func (c *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writ
|
||||
timestamp := protocol.NewTimestampGenerator(protocol.NowTime(), 30)()
|
||||
account := header.User.Account.(*vmess.MemoryAccount)
|
||||
idHash := c.idHash(account.AnyValidID().Bytes())
|
||||
common.Must2(vio.WriteUint64(idHash, uint64(timestamp)))
|
||||
common.Must2(serial.WriteUint64(idHash, uint64(timestamp)))
|
||||
common.Must2(writer.Write(idHash.Sum(nil)))
|
||||
|
||||
buffer := buf.New()
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"v2ray.com/core/common/buf"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/protocol"
|
||||
"v2ray.com/core/common/serial"
|
||||
"v2ray.com/core/common/uuid"
|
||||
"v2ray.com/core/common/vio"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -96,11 +96,11 @@ func (f *CommandSwitchAccountFactory) Marshal(command interface{}, writer io.Wri
|
||||
common.Must2(writer.Write([]byte(hostStr)))
|
||||
}
|
||||
|
||||
common.Must2(vio.WriteUint16(writer, cmd.Port.Value()))
|
||||
common.Must2(serial.WriteUint16(writer, cmd.Port.Value()))
|
||||
|
||||
idBytes := cmd.ID.Bytes()
|
||||
common.Must2(writer.Write(idBytes))
|
||||
common.Must2(vio.WriteUint16(writer, cmd.AlterIds))
|
||||
common.Must2(serial.WriteUint16(writer, cmd.AlterIds))
|
||||
common.Must2(writer.Write([]byte{byte(cmd.Level)}))
|
||||
|
||||
common.Must2(writer.Write([]byte{cmd.ValidMin}))
|
||||
|
||||
Reference in New Issue
Block a user