dpp-nfc: Fix recv_octets() regression

The updated socket.poll() loop did not terminate properly in cases where
no response is available. Fix that to check for both False and None.

Fixes: 1733e356e4 ("dpp-nfc: Fix handover client wait for receiving handover select")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
master
Jouni Malinen 4 years ago committed by Jouni Malinen
parent 90e05626f0
commit 55a366d7a8

@ -280,7 +280,7 @@ class HandoverClient(nfc.handover.HandoverClient):
msg = bytearray()
while True:
poll_timeout = 0.1 if timeout is None or timeout > 0.1 else timeout
if self.socket.poll('recv', poll_timeout) is None:
if not self.socket.poll('recv', poll_timeout):
if timeout:
timeout -= time.time() - start
if timeout <= 0:

Loading…
Cancel
Save