mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 08:44:29 +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 {
|
||||
r.Protocol = record.Protocol
|
||||
} else {
|
||||
startTime := record.StartTime
|
||||
if startTime.IsZero() {
|
||||
startTime = time.Now()
|
||||
}
|
||||
l.records[key] = &ConnectionRecord{
|
||||
Protocol: record.Protocol,
|
||||
SrcAddr: record.SrcAddr,
|
||||
DestAddr: record.DestAddr,
|
||||
StartTime: record.StartTime,
|
||||
StartTime: startTime,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user