mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-18 16:38:38 +00:00
Try to dissect with looping through all the extensions
This commit is contained in:
parent
b2a07f37a4
commit
becb8d1618
@ -5,6 +5,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -93,16 +94,18 @@ func (h *tcpReader) Read(p []byte) (int, error) {
|
|||||||
func (h *tcpReader) run(wg *sync.WaitGroup) {
|
func (h *tcpReader) run(wg *sync.WaitGroup) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
data, _ := io.ReadAll(h)
|
data, err := io.ReadAll(h)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Corrupted TCP stream, unable to read!")
|
||||||
|
return
|
||||||
|
}
|
||||||
r := bytes.NewReader(data)
|
r := bytes.NewReader(data)
|
||||||
|
|
||||||
b := bufio.NewReader(r)
|
for _, extension := range extensions {
|
||||||
|
for _, isClient := range []bool{true, false} {
|
||||||
extensions[1].Dissector.Dissect(b, true, h.tcpID, h.Emitter)
|
|
||||||
|
|
||||||
r.Reset(data)
|
r.Reset(data)
|
||||||
|
b := bufio.NewReader(r)
|
||||||
b = bufio.NewReader(r)
|
extension.Dissector.Dissect(b, isClient, h.tcpID, h.Emitter)
|
||||||
|
}
|
||||||
extensions[1].Dissector.Dissect(b, false, h.tcpID, h.Emitter)
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user