From 362da8d70a363b06309ef0ee856ed1755714b40b Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Thu, 16 Sep 2021 22:58:44 +0300 Subject: [PATCH] Increase the buffer of the scanner --- agent/pkg/api/realtime_client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent/pkg/api/realtime_client.go b/agent/pkg/api/realtime_client.go index bfa44647c..6325e7295 100644 --- a/agent/pkg/api/realtime_client.go +++ b/agent/pkg/api/realtime_client.go @@ -65,6 +65,8 @@ func readConnection(wg *sync.WaitGroup, conn net.Conn, ws *websocket.Conn) { defer wg.Done() for { scanner := bufio.NewScanner(conn) + buf := make([]byte, 0, 64*1024) + scanner.Buffer(buf, 209715200) for { ok := scanner.Scan() @@ -72,9 +74,11 @@ func readConnection(wg *sync.WaitGroup, conn net.Conn, ws *websocket.Conn) { command := handleCommands(text) if !command { - // fmt.Printf("\b\b** %s\n> ", text) + fmt.Printf("\b\b** %s\n> ", text) if text == "" { + err := scanner.Err() + fmt.Printf("err: %v\n", err) return }