1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

Merge pull request #1292 from Quasilyte/quasilyte/builtinShadow

s/len/length/ s/cap/capacity/ to avoid builtin shadowing
This commit is contained in:
Victoria Raymond 2018-10-01 11:40:06 +02:00 committed by GitHub
commit 9a4624b833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -41,12 +41,12 @@ func MarshalCommand(command interface{}, writer io.Writer) error {
}
auth := Authenticate(buffer.Bytes())
len := buffer.Len() + 4
if len > 255 {
length := buffer.Len() + 4
if length > 255 {
return ErrCommandTooLarge
}
common.Must2(writer.Write([]byte{cmdID, byte(len), byte(auth >> 24), byte(auth >> 16), byte(auth >> 8), byte(auth)}))
common.Must2(writer.Write([]byte{cmdID, byte(length), byte(auth >> 24), byte(auth >> 16), byte(auth >> 8), byte(auth)}))
common.Must2(writer.Write(buffer.Bytes()))
return nil
}

View File

@ -17,9 +17,9 @@ type Payload struct {
type HubOption func(h *Hub)
func HubCapacity(cap int) HubOption {
func HubCapacity(capacity int) HubOption {
return func(h *Hub) {
h.capacity = cap
h.capacity = capacity
}
}