refactor bytes functions

This commit is contained in:
v2ray
2016-06-26 22:34:48 +02:00
parent d12d5b0593
commit 67ac925ee7
16 changed files with 78 additions and 64 deletions
+1 -2
View File
@@ -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()))
}
+1 -1
View File
@@ -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