misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-02-11 19:43:36 +01:00
commit ea477ef2b4
4 changed files with 38 additions and 45 deletions

View file

@ -3,6 +3,7 @@ package modules
import (
"fmt"
"net"
"sync/atomic"
"github.com/evilsocket/bettercap-ng/log"
)
@ -19,9 +20,7 @@ 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.Lock()
p.Session.Queue.Sent += uint64(wrote)
p.Session.Queue.Unlock()
atomic.AddUint64(&p.Session.Queue.Stats.Sent, uint64(wrote))
}
}
}