fix: using normal mutex instead of atomic increments ( fixes #69 )

This commit is contained in:
evilsocket 2018-02-23 10:15:51 +01:00
commit d60648f0db
3 changed files with 23 additions and 12 deletions

View file

@ -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()
}
}
}