mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-17 16:08:12 +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()
|
defer wg.Done()
|
||||||
for {
|
for {
|
||||||
scanner := bufio.NewScanner(conn)
|
scanner := bufio.NewScanner(conn)
|
||||||
|
buf := make([]byte, 0, 64*1024)
|
||||||
|
scanner.Buffer(buf, 209715200)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
ok := scanner.Scan()
|
ok := scanner.Scan()
|
||||||
@ -76,6 +78,13 @@ func readConnectionSingle(wg *sync.WaitGroup, conn net.Conn, entry *map[string]i
|
|||||||
command := handleCommands(text)
|
command := handleCommands(text)
|
||||||
if !command {
|
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
|
||||||
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(text), entry); err != nil {
|
if err := json.Unmarshal([]byte(text), entry); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user