mirror of
https://github.com/bettercap/bettercap
synced 2025-07-07 05:22:04 -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
|
@ -131,17 +131,13 @@ func (p *HttpsProxy) Start() error {
|
|||
return err
|
||||
}
|
||||
|
||||
p.SetRunning(true)
|
||||
p.proxy.Start()
|
||||
|
||||
return nil
|
||||
return p.SetRunning(true, func() {
|
||||
p.proxy.Start()
|
||||
})
|
||||
}
|
||||
|
||||
func (p *HttpsProxy) 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