Skip to content

Commit

Permalink
gnrc_sock: warn about non-zero receive timeouts with sock_async
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed May 24, 2022
1 parent d43ad76 commit 4e88b75
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sys/net/gnrc/sock/gnrc_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ ssize_t gnrc_sock_recv(gnrc_sock_reg_t *reg, gnrc_pktsnip_t **pkt_out,
}
#endif
if (timeout != 0) {
#if defined(DEVELHELP) && IS_ACTIVE(SOCK_HAS_ASYNC)
if (reg->async_cb.generic) {
/* this warning is a false positive when sock_*_recv() was not called from
* the asynchronous handler */
LOG_WARNING("gnrc_sock: timeout != 0 within the asynchronous callback lead "
"to unexpected delays within the asynchronous handler.\n");
}
#endif
mbox_get(&reg->mbox, &msg);
}
else {
Expand Down

0 comments on commit 4e88b75

Please sign in to comment.