mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #14060 from miri64/lwip_sock/fix/re-recv-signal
lwip_sock: re-issue receive events if there are still received messages after `*_recv()` or `*_accept()` was called.
This commit is contained in:
commit
b13a4d6c9c
@ -548,6 +548,13 @@ int lwip_sock_recv(struct netconn *conn, uint32_t timeout, struct netbuf **buf)
|
||||
/* unset flags */
|
||||
#if LWIP_SO_RCVTIMEO
|
||||
netconn_set_recvtimeout(conn, 0);
|
||||
#endif
|
||||
#if IS_ACTIVE(SOCK_HAS_ASYNC)
|
||||
lwip_sock_base_t *sock = netconn_get_callback_arg(conn);
|
||||
|
||||
if (sock && sock->async_cb.gen && cib_avail(&conn->recvmbox.mbox.cib)) {
|
||||
sock->async_cb.gen(sock, SOCK_ASYNC_MSG_RECV, sock->async_cb_arg);
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
@ -254,6 +254,13 @@ int sock_tcp_accept(sock_tcp_queue_t *queue, sock_tcp_t **sock,
|
||||
}
|
||||
#if LWIP_SO_RCVTIMEO
|
||||
netconn_set_recvtimeout(queue->base.conn, 0);
|
||||
#endif
|
||||
#if IS_ACTIVE(SOCK_HAS_ASYNC)
|
||||
if (queue->base.async_cb.gen &&
|
||||
cib_avail(&queue->base.conn->acceptmbox.mbox.cib)) {
|
||||
queue->base.async_cb.gen(&queue->base, SOCK_ASYNC_CONN_RECV,
|
||||
queue->base.async_cb_arg);
|
||||
}
|
||||
#endif
|
||||
mutex_unlock(&queue->mutex);
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user