mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-16 23:51:29 +00:00
Increase the buffer of another scanner
This commit is contained in:
parent
5e6b5ed438
commit
2dd1883c65
@ -68,6 +68,8 @@ func readConnectionSingle(wg *sync.WaitGroup, conn net.Conn, entry *map[string]i
|
||||
defer wg.Done()
|
||||
for {
|
||||
scanner := bufio.NewScanner(conn)
|
||||
buf := make([]byte, 0, 64*1024)
|
||||
scanner.Buffer(buf, 209715200)
|
||||
|
||||
for {
|
||||
ok := scanner.Scan()
|
||||
@ -76,6 +78,13 @@ func readConnectionSingle(wg *sync.WaitGroup, conn net.Conn, entry *map[string]i
|
||||
command := handleCommands(text)
|
||||
if !command {
|
||||
fmt.Printf("\b\b** %s\n> ", text)
|
||||
|
||||
if text == "" {
|
||||
err := scanner.Err()
|
||||
fmt.Printf("err: %v\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err := json.Unmarshal([]byte(text), entry); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user