Fix req_scan-deplete-timeout and update eloop API for this
authorJouni Malinen <j@w1.fi>
Sun, 5 Jan 2014 07:59:38 +0000 (09:59 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jan 2014 08:45:10 +0000 (10:45 +0200)
commita09ffd5f2f9ad8ef396be52246aab9b9ab507ad6
tree8d6899ede75878049e765c8902239cc8379bef16
parentbce774ad6358a04341e9e6d45ff3060ff955c87a
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>
src/ap/sta_info.c
src/ap/wps_hostapd.c
src/utils/eloop.c
src/utils/eloop.h
src/utils/eloop_win.c
wpa_supplicant/scan.c