mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
refact: some refactoring to proxy modules
This commit is contained in:
parent
195650777f
commit
291e87de39
11 changed files with 332 additions and 315 deletions
|
@ -2,6 +2,7 @@ package session
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
@ -20,6 +21,9 @@ import (
|
|||
|
||||
var (
|
||||
I = (*Session)(nil)
|
||||
|
||||
ErrAlreadyStarted = errors.New("Module is already running.")
|
||||
ErrAlreadyStopped = errors.New("Module is not running.")
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
|
|
|
@ -89,6 +89,10 @@ func (s *Session) activeHandler(args []string, sess *Session) error {
|
|||
}
|
||||
|
||||
func (s *Session) exitHandler(args []string, sess *Session) error {
|
||||
for _, mod := range s.Modules {
|
||||
mod.Stop()
|
||||
}
|
||||
|
||||
s.Active = false
|
||||
s.Input.Close()
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue