Fix connection type switches
This commit is contained in:
@@ -548,10 +548,10 @@ func (conn *Connection) delete() {
|
||||
// A connection without an ID has been created from
|
||||
// a DNS request rather than a packet. Choose the correct
|
||||
// connection store here.
|
||||
if conn.ID == "" {
|
||||
dnsConns.delete(conn)
|
||||
} else {
|
||||
if conn.Type == IPConnection {
|
||||
conns.delete(conn)
|
||||
} else {
|
||||
dnsConns.delete(conn)
|
||||
}
|
||||
|
||||
conn.Meta().Delete()
|
||||
|
||||
@@ -132,7 +132,7 @@ func (conn *Connection) addToMetrics() {
|
||||
}
|
||||
|
||||
// Only count successful connections, not DNS requests.
|
||||
if conn.ID == "" {
|
||||
if conn.Type == DNSRequest {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user