1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 04:25:44 -05:00

remove use of Buffer.Value

This commit is contained in:
Darien Raymond
2016-12-05 21:33:24 +01:00
parent 186bf1f141
commit 4bf8288cc2
10 changed files with 21 additions and 22 deletions

View File

@@ -40,14 +40,14 @@ func MarshalCommand(command interface{}, writer io.Writer) error {
return err
}
auth := Authenticate(buffer.Value)
auth := Authenticate(buffer.Bytes())
len := buffer.Len() + 4
if len > 255 {
return ErrCommandTooLarge
}
writer.Write([]byte{cmdId, byte(len), byte(auth >> 24), byte(auth >> 16), byte(auth >> 8), byte(auth)})
writer.Write(buffer.Value)
writer.Write(buffer.Bytes())
return nil
}