aboutsummaryrefslogtreecommitdiff
path: root/lib/websocket
diff options
context:
space:
mode:
Diffstat (limited to 'lib/websocket')
-rw-r--r--lib/websocket/funcs.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/websocket/funcs.go b/lib/websocket/funcs.go
index 293213a1..85c83eed 100644
--- a/lib/websocket/funcs.go
+++ b/lib/websocket/funcs.go
@@ -100,11 +100,7 @@ func Send(fd int, packet []byte, timeout time.Duration) (err error) {
}
for len(packet) > 0 {
- if len(packet) < maxBuffer {
- max = len(packet)
- } else {
- max = maxBuffer
- }
+ max = min(len(packet), maxBuffer)
n, err = unix.Write(fd, packet[:max])
if err != nil {