mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
refact: refactored module SetRunning method (fixes #49)
This commit is contained in:
parent
76d6977967
commit
9c6eb70eb3
15 changed files with 103 additions and 174 deletions
|
@ -93,17 +93,13 @@ func (p *HttpProxy) Start() error {
|
|||
return err
|
||||
}
|
||||
|
||||
p.SetRunning(true)
|
||||
p.proxy.Start()
|
||||
|
||||
return nil
|
||||
return p.SetRunning(true, func() {
|
||||
p.proxy.Start()
|
||||
})
|
||||
}
|
||||
|
||||
func (p *HttpProxy) Stop() error {
|
||||
if p.Running() == false {
|
||||
return session.ErrAlreadyStopped
|
||||
}
|
||||
p.SetRunning(false)
|
||||
|
||||
return p.proxy.Stop()
|
||||
return p.SetRunning(false, func() {
|
||||
p.proxy.Stop()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue