wifi: esp_at: notify receivers on async close

`esp_close_work` can be queued from the `on_cmd_closed`, which clears
`ESP_SOCK_CONNECTED` and sets `ESP_SOCK_CLOSE_PENDING`, but does no
further work. The receive callback should still be run with no data when
the socket is closed through this mechanism.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
Jordan Yates 2022-04-15 12:24:01 +10:00 committed by Carles Cufí
commit a2c0bd8dd1

View file

@ -517,7 +517,7 @@ void esp_close_work(struct k_work *work)
}
/* Should we notify that the socket has been closed? */
if (old_flags & ESP_SOCK_CONNECTED) {
if (old_flags & ESP_SOCK_CLOSE_PENDING) {
k_mutex_lock(&sock->lock, K_FOREVER);
if (sock->recv_cb) {
sock->recv_cb(sock->context, NULL, NULL, NULL, 0,