MCPcopy
hub / github.com/evilsocket/opensnitch / eventWorker

Method eventWorker

daemon/statistics/stats.go:180–193  ·  view source on GitHub ↗
(id int, done <-chan struct{})

Source from the content-addressed store, hash-verified

178}
179
180func (s *Statistics) eventWorker(id int, done <-chan struct{}) {
181 log.Debug("Stats worker #%d started.", id)
182
183 for true {
184 select {
185 case <-done:
186 goto Exit
187 case job := <-s.jobs:
188 s.onConnection(job.con, job.match, job.wasMissed)
189 }
190 }
191Exit:
192 log.Debug("stats.worker() %d exited", id)
193}
194
195func (s *Statistics) onConnection(con *conman.Connection, match *rule.Rule, wasMissed bool) {
196 s.Lock()

Callers 1

SetLimitsMethod · 0.95

Calls 1

onConnectionMethod · 0.95

Tested by

no test coverage detected