diff --git a/frontend/udp/bytepool/bytepool.go b/frontend/udp/bytepool/bytepool.go index f4ec893..93507a9 100644 --- a/frontend/udp/bytepool/bytepool.go +++ b/frontend/udp/bytepool/bytepool.go @@ -7,11 +7,11 @@ type BytePool struct { sync.Pool } -// New allocates a new BytePool with slices of the provided capacity. -func New(length, capacity int) *BytePool { +// New allocates a new BytePool with slices of equal length and capacity. +func New(length int) *BytePool { var bp BytePool bp.Pool.New = func() interface{} { - return make([]byte, length, capacity) + return make([]byte, length, length) } return &bp } diff --git a/frontend/udp/frontend.go b/frontend/udp/frontend.go index 4d0ef58..2be9a3e 100644 --- a/frontend/udp/frontend.go +++ b/frontend/udp/frontend.go @@ -93,7 +93,7 @@ func (t *Frontend) ListenAndServe() error { } defer t.socket.Close() - pool := bytepool.New(2048, 2048) + pool := bytepool.New(2048) for { // Check to see if we need to shutdown.