Improve dns resolving and logging

This commit is contained in:
Daniel
2021-04-16 21:35:16 +02:00
parent bb3fc0ad35
commit d626cea102
6 changed files with 115 additions and 65 deletions

View File

@@ -57,9 +57,12 @@ func SaveOpenDNSRequest(conn *Connection) {
key := getDNSRequestCacheKey(conn.process.Pid, conn.Entity.Domain)
if existingConn, ok := openDNSRequests[key]; ok {
// End previous request and save it.
existingConn.Lock()
defer existingConn.Unlock()
existingConn.Ended = conn.Started
existingConn.Unlock()
existingConn.Save()
return
}