drivers: wifi: esp_at: notify send() caller about pending close

If stream socket is marked as pending close, make sure that send()
caller gets notified about it, so that application layer can decide to
stop trying to send anything more.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
This commit is contained in:
Marcin Niestroj 2021-07-01 16:28:22 +02:00 committed by Anas Nashif
commit 66766581c9

View file

@ -376,7 +376,10 @@ static int esp_sendto(struct net_pkt *pkt,
}
if (esp_socket_type(sock) == SOCK_STREAM) {
if (!esp_socket_connected(sock)) {
atomic_val_t flags = esp_socket_flags(sock);
if (!(flags & ESP_SOCK_CONNECTED) ||
(flags & ESP_SOCK_CLOSE_PENDING)) {
return -ENOTCONN;
}
} else {