mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
fix: using normal mutex instead of atomic increments ( fixes #69 )
This commit is contained in:
parent
129f87f8f9
commit
d60648f0db
3 changed files with 23 additions and 12 deletions
|
@ -3,7 +3,6 @@ package modules
|
|||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/bettercap/bettercap/log"
|
||||
)
|
||||
|
@ -20,7 +19,9 @@ func (p *Prober) sendProbeUDP(from net.IP, from_hw net.HardwareAddr, ip net.IP)
|
|||
wrote, _ := con.Write([]byte{0x00})
|
||||
|
||||
if wrote > 0 {
|
||||
atomic.AddUint64(&p.Session.Queue.Stats.Sent, uint64(wrote))
|
||||
p.Session.Queue.Stats.Lock()
|
||||
p.Session.Queue.Stats.Sent += uint64(wrote)
|
||||
p.Session.Queue.Stats.Unlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue