mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-06 19:14:50 +00:00
Swap TcpID
without overwriting it
This commit is contained in:
parent
d0f0e187cb
commit
3ca6437320
@ -41,16 +41,18 @@ type TcpID struct {
|
|||||||
Ident string
|
Ident string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TcpID) Swap() {
|
func (t *TcpID) Swap() *TcpID {
|
||||||
srcIP := t.SrcIP
|
srcIP := t.SrcIP
|
||||||
dstIP := t.DstIP
|
dstIP := t.DstIP
|
||||||
srcPort := t.SrcPort
|
srcPort := t.SrcPort
|
||||||
dstPort := t.DstPort
|
dstPort := t.DstPort
|
||||||
|
|
||||||
t.SrcIP = dstIP
|
return &TcpID{
|
||||||
t.SrcPort = dstPort
|
SrcIP: dstIP,
|
||||||
t.DstIP = srcIP
|
SrcPort: dstPort,
|
||||||
t.DstPort = srcPort
|
DstIP: srcIP,
|
||||||
|
DstPort: srcPort,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type GenericMessage struct {
|
type GenericMessage struct {
|
||||||
|
@ -89,8 +89,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, em
|
|||||||
}
|
}
|
||||||
success = true
|
success = true
|
||||||
} else if isClient {
|
} else if isClient {
|
||||||
tcpID.Swap()
|
err = handleHTTP1ClientStream(b, tcpID.Swap(), emitter)
|
||||||
err = handleHTTP1ClientStream(b, tcpID, emitter)
|
|
||||||
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
||||||
break
|
break
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user