Fix connection type switches

This commit is contained in:
Daniel 2021-03-22 13:46:22 +01:00
parent 60bdea7c50
commit 04d633a196
2 changed files with 4 additions and 4 deletions

View file

@ -548,10 +548,10 @@ func (conn *Connection) delete() {
// A connection without an ID has been created from // A connection without an ID has been created from
// a DNS request rather than a packet. Choose the correct // a DNS request rather than a packet. Choose the correct
// connection store here. // connection store here.
if conn.ID == "" { if conn.Type == IPConnection {
dnsConns.delete(conn)
} else {
conns.delete(conn) conns.delete(conn)
} else {
dnsConns.delete(conn)
} }
conn.Meta().Delete() conn.Meta().Delete()

View file

@ -132,7 +132,7 @@ func (conn *Connection) addToMetrics() {
} }
// Only count successful connections, not DNS requests. // Only count successful connections, not DNS requests.
if conn.ID == "" { if conn.Type == DNSRequest {
return return
} }