mirror of
https://github.com/bettercap/bettercap.git
synced 2025-03-12 04:36:03 -07:00
misc: added debug panic for #500
This commit is contained in:
parent
80000ed737
commit
821f885332
@ -62,6 +62,7 @@ func NewQueue(iface *network.Endpoint) (q *Queue, err error) {
|
||||
q = &Queue{
|
||||
Protos: sync.Map{},
|
||||
Traffic: sync.Map{},
|
||||
Stats: Stats{},
|
||||
Activities: make(chan Activity),
|
||||
|
||||
writes: &sync.WaitGroup{},
|
||||
@ -165,6 +166,10 @@ func (q *Queue) trackActivity(eth *layers.Ethernet, ip4 *layers.IPv4, address ne
|
||||
}
|
||||
|
||||
func (q *Queue) TrackPacket(size uint64) {
|
||||
// https://github.com/bettercap/bettercap/issues/500
|
||||
if q == nil {
|
||||
panic("track packet on nil queue!")
|
||||
}
|
||||
atomic.AddUint64(&q.Stats.PktReceived, 1)
|
||||
atomic.AddUint64(&q.Stats.Received, size)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user