mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-18 09:46:58 +00:00
fix: ensure start time is set for new connection records
This commit is contained in:
parent
6877f608ad
commit
873c9d5e69
@ -62,11 +62,15 @@ func (l *ConnectionRecordList) Add(record *ConnectionRecord) {
|
|||||||
if r, exists := l.records[key]; exists {
|
if r, exists := l.records[key]; exists {
|
||||||
r.Protocol = record.Protocol
|
r.Protocol = record.Protocol
|
||||||
} else {
|
} else {
|
||||||
|
startTime := record.StartTime
|
||||||
|
if startTime.IsZero() {
|
||||||
|
startTime = time.Now()
|
||||||
|
}
|
||||||
l.records[key] = &ConnectionRecord{
|
l.records[key] = &ConnectionRecord{
|
||||||
Protocol: record.Protocol,
|
Protocol: record.Protocol,
|
||||||
SrcAddr: record.SrcAddr,
|
SrcAddr: record.SrcAddr,
|
||||||
DestAddr: record.DestAddr,
|
DestAddr: record.DestAddr,
|
||||||
StartTime: record.StartTime,
|
StartTime: startTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user