mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-24 23:19:44 +00:00
s/len/length/ s/cap/capacity/ to avoid builtin shadowing
This commit is contained in:
1 parent
091fa6ad23
commit
0cf3599db2
2 files changed
+5
-5
No files matched your search
@@ -41,12 +41,12 @@ func MarshalCommand(command interface{}, writer io.Writer) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auth := Authenticate(buffer.Bytes())
|
auth := Authenticate(buffer.Bytes())
|
||||||
len := buffer.Len() + 4
|
length := buffer.Len() + 4
|
||||||
if len > 255 {
|
if length > 255 {
|
||||||
return ErrCommandTooLarge
|
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()))
|
common.Must2(writer.Write(buffer.Bytes()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ type Payload struct {
|
|||||||
|
|
||||||
type HubOption func(h *Hub)
|
type HubOption func(h *Hub)
|
||||||
|
|
||||||
func HubCapacity(cap int) HubOption {
|
func HubCapacity(capacity int) HubOption {
|
||||||
return func(h *Hub) {
|
return func(h *Hub) {
|
||||||
h.capacity = cap
|
h.capacity = capacity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user