[riot-notifications] [RIOT-OS/RIOT] net/gcoap: support DTLS (#15549)

János Brodbeck notifications at github.com
Wed May 26 18:21:30 CEST 2021


@janosbrodbeck commented on this pull request.



> +            return;
+        }
+        dsm_state_t prev_state = dsm_store(sock, &socket.ctx_dtls_session,
+                                           SESSION_STATE_ESTABLISHED, false);
+
+        /* If session is already stored and the state was SESSION_STATE_HANDSHAKE
+        before, the handshake has been initiated internally by a gcoap client request
+        and another thread is waiting for the handshake. Send message to the
+        waiting thread to inform about established session */
+        if (prev_state == SESSION_STATE_HANDSHAKE) {
+            msg_t msg = { .type = DTLS_EVENT_CONNECTED };
+            msg_send(&msg, _auth_waiting_thread);
+        } else if (prev_state == NO_SPACE) {
+            /* No space in session management. Should not happen. If it occurs,
+            we lost track of sessions stored in tinydtls internally */
+            sock_dtls_session_destroy(sock, &socket.ctx_dtls_session);

Added debug output here. Not sure whether `assert(false)` is really necessary here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15549#discussion_r639889841
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210526/f148b52e/attachment.htm>


More information about the notifications mailing list