mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-07-28 09:43:59 +00:00
Make CloseOtherProtocolDissectors method mutexed
This commit is contained in:
@@ -157,17 +157,15 @@ func (t *TcpStream) ReassemblyComplete(ac reassembly.AssemblerContext) bool {
|
||||
}
|
||||
|
||||
func (t *TcpStream) Close() {
|
||||
shouldReturn := false
|
||||
t.Lock()
|
||||
defer t.Unlock()
|
||||
|
||||
if t.isClosed {
|
||||
shouldReturn = true
|
||||
} else {
|
||||
t.isClosed = true
|
||||
}
|
||||
t.Unlock()
|
||||
if shouldReturn {
|
||||
return
|
||||
}
|
||||
|
||||
t.isClosed = true
|
||||
|
||||
t.StreamsMap.Delete(t.Id)
|
||||
|
||||
for i := range t.Clients {
|
||||
@@ -181,6 +179,9 @@ func (t *TcpStream) Close() {
|
||||
}
|
||||
|
||||
func (t *TcpStream) CloseOtherProtocolDissectors(protocol *Protocol) {
|
||||
t.Lock()
|
||||
defer t.Unlock()
|
||||
|
||||
if t.ProtoIdentifier.IsClosedOthers {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user