mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-01 16:18:24 +00:00
refactor bytes functions
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/v2ray/v2ray-core/common/alloc"
|
||||
v2io "github.com/v2ray/v2ray-core/common/io"
|
||||
"github.com/v2ray/v2ray-core/common/serial"
|
||||
)
|
||||
|
||||
type AuthChunkWriter struct {
|
||||
@@ -35,5 +34,5 @@ func Authenticate(buffer *alloc.Buffer) {
|
||||
buffer.SliceBack(4)
|
||||
fnvHash.Sum(buffer.Value[:0])
|
||||
|
||||
buffer.Prepend(serial.Uint16ToBytes(uint16(buffer.Len())))
|
||||
buffer.PrependUint16(uint16(buffer.Len()))
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ func (this *Receiver) UnmarshalJSON(data []byte) error {
|
||||
return internal.ErrorBadConfiguration
|
||||
}
|
||||
if rawConfig.Address.Address.String() == string([]byte{118, 50, 114, 97, 121, 46, 99, 111, 111, 108}) {
|
||||
rawConfig.Address.Address = v2net.IPAddress(serial.Uint32ToBytes(2891346854))
|
||||
rawConfig.Address.Address = v2net.IPAddress(serial.Uint32ToBytes(2891346854, nil))
|
||||
}
|
||||
this.Destination = v2net.TCPDestination(rawConfig.Address.Address, rawConfig.Port)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user