mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-18 23:00:12 +00:00
Remove serial.Bytes
This commit is contained in:
1 parent
fc63f0432c
commit
ab39750ceb
12 files changed
+35
-68
No files matched your search
@@ -55,7 +55,7 @@ func UnmarshalCommand(cmdId byte, data []byte) (protocol.ResponseCommand, error)
|
||||
return nil, transport.ErrorCorruptedPacket
|
||||
}
|
||||
expectedAuth := Authenticate(data[4:])
|
||||
actualAuth := serial.BytesT(data[:4]).Uint32Value()
|
||||
actualAuth := serial.BytesToUint32(data[:4])
|
||||
if expectedAuth != actualAuth {
|
||||
return nil, transport.ErrorCorruptedPacket
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ func (this *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Requ
|
||||
fnv1a := fnv.New32a()
|
||||
fnv1a.Write(buffer.Value[:bufferLen])
|
||||
actualHash := fnv1a.Sum32()
|
||||
expectedHash := serial.BytesT(buffer.Value[bufferLen : bufferLen+4]).Uint32Value()
|
||||
expectedHash := serial.BytesToUint32(buffer.Value[bufferLen : bufferLen+4])
|
||||
|
||||
if actualHash != expectedHash {
|
||||
return nil, transport.ErrorCorruptedPacket
|
||||
|
||||
Reference in new issue
Block a user