aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/eloop_win.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-05 07:59:38 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-07 08:45:10 (GMT)
commita09ffd5f2f9ad8ef396be52246aab9b9ab507ad6 (patch)
tree8d6899ede75878049e765c8902239cc8379bef16 /src/utils/eloop_win.c
parentbce774ad6358a04341e9e6d45ff3060ff955c87a (diff)
downloadhostap-a09ffd5f2f9ad8ef396be52246aab9b9ab507ad6.zip
hostap-a09ffd5f2f9ad8ef396be52246aab9b9ab507ad6.tar.gz
hostap-a09ffd5f2f9ad8ef396be52246aab9b9ab507ad6.tar.bz2
Fix req_scan-deplete-timeout and update eloop API for this
Commit e2f5a9889a3a2bb8f1eed0cf274c7fbbabe3e9de was supposed to prevent new scan request from pushing out the old one. However, it did not really do that since eloop_deplete_timeout() returned 0 both for the case where the old timeout existed (and was sooner) and if the old timeout did not exist. It returned 1 only for the case where an old timeout did exist and was larger than the new requested value. That case used to result in wpa_supplicant_req_scan() rescheduling the timeout, but hew code in eloop_deplete_timeout() did the exact same thing and as such, did not really change anything apart from the debug log message. Extend the eloop_deplete_timeout() (and eloop_replenish_timeout() for that matter since it is very similar) to return three different values based on whether the timeout existed or not and if yes, whether it was modified. This allows wpa_supplicant_req_scan() to schedule a new timeout only in the case there was no old timeout. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/utils/eloop_win.c')
-rw-r--r--src/utils/eloop_win.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils/eloop_win.c b/src/utils/eloop_win.c
index a1f9996..de47fb2 100644
--- a/src/utils/eloop_win.c
+++ b/src/utils/eloop_win.c
@@ -378,10 +378,11 @@ int eloop_deplete_timeout(unsigned int req_secs, unsigned int req_usecs,
user_data);
return 1;
}
+ return 0;
}
}
- return 0;
+ return -1;
}
@@ -409,10 +410,11 @@ int eloop_replenish_timeout(unsigned int req_secs, unsigned int req_usecs,
user_data);
return 1;
}
+ return 0;
}
}
- return 0;
+ return -1;
}