mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
some progress but still doesn't work
This commit is contained in:
parent
894cbe76a1
commit
b243e67828
4 changed files with 168 additions and 32 deletions
|
@ -12,10 +12,11 @@ import (
|
|||
|
||||
type EventsStream struct {
|
||||
session.SessionModule
|
||||
ignoreList *IgnoreList
|
||||
waitFor string
|
||||
waitChan chan *session.Event
|
||||
quit chan bool
|
||||
ignoreList *IgnoreList
|
||||
waitFor string
|
||||
waitChan chan *session.Event
|
||||
eventListener <-chan session.Event
|
||||
quit chan bool
|
||||
}
|
||||
|
||||
func NewEventsStream(s *session.Session) *EventsStream {
|
||||
|
@ -124,10 +125,12 @@ func (s *EventsStream) Configure() error {
|
|||
|
||||
func (s *EventsStream) Start() error {
|
||||
return s.SetRunning(true, func() {
|
||||
|
||||
s.eventListener = s.Session.Events.Listen()
|
||||
for {
|
||||
var e session.Event
|
||||
select {
|
||||
case e = <-s.Session.Events.NewEvents:
|
||||
case e = <-s.eventListener:
|
||||
if e.Tag == s.waitFor {
|
||||
s.waitFor = ""
|
||||
s.waitChan <- &e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue