fix: propagating mod.started and mod.stopped events

This commit is contained in:
evilsocket 2019-03-15 17:28:20 +01:00
commit c89123f305
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 10 additions and 10 deletions

View file

@ -66,11 +66,13 @@ func (mod *EventsStream) viewEndpointEvent(e session.Event) {
} }
func (mod *EventsStream) viewModuleEvent(e session.Event) { func (mod *EventsStream) viewModuleEvent(e session.Event) {
if *mod.Session.Options.Debug {
fmt.Fprintf(mod.output, "[%s] [%s] %s\n", fmt.Fprintf(mod.output, "[%s] [%s] %s\n",
e.Time.Format(mod.timeFormat), e.Time.Format(mod.timeFormat),
tui.Green(e.Tag), tui.Green(e.Tag),
e.Data) e.Data)
} }
}
func (mod *EventsStream) viewSnifferEvent(e session.Event) { func (mod *EventsStream) viewSnifferEvent(e session.Event) {
if strings.HasPrefix(e.Tag, "net.sniff.http.") { if strings.HasPrefix(e.Tag, "net.sniff.http.") {

View file

@ -186,13 +186,11 @@ func (m *SessionModule) SetRunning(running bool, cb func()) error {
m.Started = running m.Started = running
m.StatusLock.Unlock() m.StatusLock.Unlock()
if *m.Session.Options.Debug {
if running { if running {
m.Session.Events.Add("mod.started", m.Name) m.Session.Events.Add("mod.started", m.Name)
} else { } else {
m.Session.Events.Add("mod.stopped", m.Name) m.Session.Events.Add("mod.stopped", m.Name)
} }
}
if cb != nil { if cb != nil {
if running { if running {