mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: propagating mod.started and mod.stopped events
This commit is contained in:
parent
0f427911be
commit
c89123f305
2 changed files with 10 additions and 10 deletions
|
@ -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.") {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue