From 75ee60f267d33de35154cfa7e56f3c30b6f2a563 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 21 Apr 2019 23:26:51 +0200 Subject: [PATCH] WaitForResponseTimeoutW: fix, no communication_delay when timeout=-1 --- client/comms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/comms.c b/client/comms.c index 038e90fea..305e84281 100644 --- a/client/comms.c +++ b/client/comms.c @@ -596,7 +596,9 @@ bool WaitForResponseTimeoutW(uint32_t cmd, PacketResponseNG *response, size_t ms response = &resp; // Add delay depending on the communication channel & speed - ms_timeout += communication_delay(); + if (ms_timeout != (size_t)-1) + ms_timeout += communication_delay(); + uint64_t start_time = msclock(); // Wait until the command is received