mirror of https://github.com/ARMmbed/mbed-os.git
Fix ESP8266 recv_udp timeout with flow control
UDP packets are always received as OOB data. Without checking for new OOB data with a call to "_process_oob" then recv_udp never blocks. If a UDP packet is not available then NSAPI_ERROR_WOULD_BLOCK is returned. This causes mbed-os's DNS handling to always fail when flow control is enabled. This patch fixes recv_udp by always calling "_process_oob" regardless of if flow control is enabled. This ensures that recv_udp follows the timeout parameter and waits for new data to arrive.pull/9208/head
parent
5be53a00d6
commit
c8c68381d6
|
@ -782,10 +782,9 @@ int32_t ESP8266::recv_udp(int id, void *data, uint32_t amount, uint32_t timeout)
|
|||
_smutex.lock();
|
||||
set_timeout(timeout);
|
||||
|
||||
// No flow control, drain the USART receive register ASAP to avoid data overrun
|
||||
if (_serial_rts == NC) {
|
||||
// Process OOB data since this is
|
||||
// how UDP packets are received
|
||||
_process_oob(timeout, true);
|
||||
}
|
||||
|
||||
set_timeout();
|
||||
|
||||
|
|
Loading…
Reference in New Issue