drivers: wifi: esp_at: fix last rx data loss in Passive Receive mode
In Passive Receive mode, ESP modem will buffer rx data. This fix makes the data still available to user, even though the peer has closed the socket. Otherwise, user will fail to get the last rx data, when the socket is closed by the peer. Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
This commit is contained in:
parent
4ae558c505
commit
173e4983fd
|
@ -151,8 +151,16 @@ void esp_socket_rx(struct esp_socket *sock, struct net_buf *buf,
|
|||
|
||||
flags = esp_socket_flags(sock);
|
||||
|
||||
#ifdef CONFIG_WIFI_ESP_AT_PASSIVE_MODE
|
||||
/* In Passive Receive mode, ESP modem will buffer rx data and make it still
|
||||
* available even though the peer has closed the connection.
|
||||
*/
|
||||
if (!(flags & ESP_SOCK_CONNECTED) &&
|
||||
!(flags & ESP_SOCK_CLOSE_PENDING)) {
|
||||
#else
|
||||
if (!(flags & ESP_SOCK_CONNECTED) ||
|
||||
(flags & ESP_SOCK_CLOSE_PENDING)) {
|
||||
#endif
|
||||
LOG_DBG("Received data on closed link %d", sock->link_id);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue