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:
parent
1ab0848eab
commit
66766581c9
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue