fix: fixed a race condition

This commit is contained in:
evilsocket 2018-03-22 10:35:42 +01:00
commit ec28d73ba7
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 32 additions and 38 deletions

View file

@ -19,9 +19,9 @@ func (p *Prober) sendProbeUDP(from net.IP, from_hw net.HardwareAddr, ip net.IP)
wrote, _ := con.Write([]byte{0x00})
if wrote > 0 {
p.Session.Queue.Stats.Lock()
p.Session.Queue.Stats.Sent += uint64(wrote)
p.Session.Queue.Stats.Unlock()
p.Session.Queue.TrackSent(uint64(wrote))
} else {
p.Session.Queue.TrackError()
}
}
}