summaryrefslogtreecommitdiff
path: root/internal/server/handlers/basehandler.go
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2021-12-05 10:37:20 +0000
committerPaul Buetow <pbuetow@mimecast.com>2021-12-05 10:37:20 +0000
commit7ec5c5b144866c392e3676778041a2ae6aa9d360 (patch)
tree55538e624912e24b94d6faa0ae5f0060b824d1bf /internal/server/handlers/basehandler.go
parent6c12fc4b33049111ad6ddc3f62bf979f843fad73 (diff)
buffer line.Line for performance
Diffstat (limited to 'internal/server/handlers/basehandler.go')
-rw-r--r--internal/server/handlers/basehandler.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/server/handlers/basehandler.go b/internal/server/handlers/basehandler.go
index f068944..4fd718e 100644
--- a/internal/server/handlers/basehandler.go
+++ b/internal/server/handlers/basehandler.go
@@ -29,7 +29,7 @@ type handleCommandCb func(context.Context, lcontext.LContext, int, []string, str
type baseHandler struct {
done *internal.Done
handleCommandCb handleCommandCb
- lines chan line.Line
+ lines chan *line.Line
aggregate *server.Aggregate
maprMessages chan string
serverMessages chan string
@@ -112,6 +112,7 @@ func (h *baseHandler) Read(p []byte) (n int, err error) {
h.readBuf.WriteByte(protocol.MessageDelimiter)
n = copy(p, h.readBuf.Bytes())
pool.RecycleBytesBuffer(line.Content)
+ line.Recycle()
case <-time.After(time.Second):
select {