1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-28 04:55:37 -05:00

simplify testing

This commit is contained in:
v2ray
2016-05-24 21:55:46 +02:00
parent 3582b9d869
commit fc63f0432c
99 changed files with 726 additions and 817 deletions

View File

@@ -99,7 +99,7 @@ func (this *CommandSwitchAccountFactory) Marshal(command interface{}, writer io.
idBytes := cmd.ID.Bytes()
writer.Write(idBytes)
writer.Write(cmd.AlterIds.Bytes())
writer.Write(serial.Uint16ToBytes(cmd.AlterIds))
writer.Write([]byte{byte(cmd.Level)})
writer.Write([]byte{cmd.ValidMin})
@@ -132,7 +132,7 @@ func (this *CommandSwitchAccountFactory) Unmarshal(data []byte) (interface{}, er
if len(data) < alterIdStart+2 {
return nil, transport.ErrorCorruptedPacket
}
cmd.AlterIds = serial.BytesT(data[alterIdStart : alterIdStart+2]).Uint16()
cmd.AlterIds = serial.BytesToUint16(data[alterIdStart : alterIdStart+2])
levelStart := alterIdStart + 2
if len(data) < levelStart+1 {
return nil, transport.ErrorCorruptedPacket