mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
wifi.go: dont claim read lock until it is needed
This commit is contained in:
parent
08cad808ef
commit
10817d574c
1 changed files with 3 additions and 3 deletions
|
@ -218,9 +218,6 @@ func (w *WiFi) NumHandshakes() int {
|
|||
}
|
||||
|
||||
func (w *WiFi) SaveHandshakesTo(fileName string, linkType layers.LinkType) error {
|
||||
w.RLock()
|
||||
defer w.RUnlock()
|
||||
|
||||
// check if folder exists first
|
||||
dirName := filepath.Dir(fileName)
|
||||
if _, err := os.Stat(dirName); err != nil {
|
||||
|
@ -244,6 +241,9 @@ func (w *WiFi) SaveHandshakesTo(fileName string, linkType layers.LinkType) error
|
|||
}
|
||||
}
|
||||
|
||||
w.RLock()
|
||||
defer w.RUnlock()
|
||||
|
||||
for _, ap := range w.aps {
|
||||
for _, station := range ap.Clients() {
|
||||
// if half (which includes also complete) or has pmkid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue