mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-06 21:11:11 +00:00
Fix the request-response matcher maps iteration in clean()
method and share the streams map with the TLS tapper (#1059)
* Fix `panic: interface conversion: api.RequestResponseMatcher is nil, not *http.requestResponseMatcher` error Also fix the request-response matcher maps iteration in `clean()` method. * Fix the mocks in the unit tests * Remove unnecessary fields from `tlsPoller` and implement `SetProtocol` method * Use concrete types in `tap` package * Share the streams map with the TLS tapper * Check interface conversion error
This commit is contained in:
@@ -34,12 +34,14 @@ func (cl *Cleaner) clean() {
|
||||
cl.assemblerMutex.Unlock()
|
||||
|
||||
cl.streamsMap.Range(func(k, v interface{}) bool {
|
||||
reqResMatcher := v.(api.TcpStream).GetReqResMatcher()
|
||||
if reqResMatcher == nil {
|
||||
return true
|
||||
reqResMatchers := v.(api.TcpStream).GetReqResMatchers()
|
||||
for _, reqResMatcher := range reqResMatchers {
|
||||
if reqResMatcher == nil {
|
||||
continue
|
||||
}
|
||||
deleted := deleteOlderThan(reqResMatcher.GetMap(), startCleanTime.Add(-cl.connectionTimeout))
|
||||
cl.stats.deleted += deleted
|
||||
}
|
||||
deleted := deleteOlderThan(reqResMatcher.GetMap(), startCleanTime.Add(-cl.connectionTimeout))
|
||||
cl.stats.deleted += deleted
|
||||
return true
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user