[riot-notifications] [RIOT-OS/RIOT] tinydtls: add `sock_async` support for `sock_dtls` (#12907)

benpicco notifications at github.com
Wed May 27 17:19:02 CEST 2020

@benpicco commented on this pull request.

> @@ -376,6 +436,26 @@ static ssize_t _copy_buffer(sock_dtls_t *sock, void *data, size_t max_len)
     if (buflen > max_len) {
         return -ENOBUFS;
+    if (sock->buf_ctx != NULL) {
+        memcpy(data, buf, sock->buflen);
+        _check_more_chunks(sock->udp_sock, (void **)&buf, &sock->buf_ctx,
+                           &remote->ep);
+        if (sock->async_cb && cib_avail(&sock->mbox.cib)) {

I guess the mbox API could use a `static inline` wrapper function then, so API users don't have to deal with implementation details.

A `/* check if another message is in the mbox */` would be good regardless to ease navigating the code.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200527/b2a6c38b/attachment-0001.htm>

More information about the notifications mailing list