Revamp connection handling flow to fix race condition and support info-only packets
This commit is contained in:
@@ -51,6 +51,11 @@ func cleanConnections() (activePIDs map[int]struct{}) {
|
||||
|
||||
// delete inactive connections
|
||||
switch {
|
||||
case !conn.DataIsComplete():
|
||||
// Step 0: delete old incomplete connections
|
||||
if conn.Started < deleteOlderThan {
|
||||
conn.delete()
|
||||
}
|
||||
case conn.Ended == 0:
|
||||
// Step 1: check if still active
|
||||
exists := state.Exists(&packet.Info{
|
||||
|
||||
Reference in New Issue
Block a user