simplify testing

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

No files matched your search

+2 -2
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