dtls_event is a static variable, declared outside of all the functions which tracks (D)TLS errors for generating events etc. If there are multiple SSL sessions being set up to the same server (as per Happy Eyeballs for the DOTS protocol) it is possible to asynchronously get dtls_event updated and the wrong SSL session then acts on it. Make dtls_event a part of coap_session_t to maintain seperation. Preset dtls_event to -1 in coap_make_session(). Update coap_event_handler() to have the 3rd parameter as coap_session_t *session instead of void *arg as the parameter is always session. Updated coap_event_handler_t to have session as the 3rd parameter. Add in new registration handler coap_register_event_handler() to be consistent with all the other coap_register_XXX_handler()s. Consequently, coap_set_event_handler() and coap_clear_enent_handler() are deprecated. Update coap_handler(3) to include new coap_register_event_handler(). (PR #183 event definitions are included presumptive on #183 getting merged)
libcoap: A C implementation of the Constrained Application Protocol (RFC 7252)
Copyright (C) 2010--2018 by Olaf Bergmann bergmann@tzi.org and others
ABOUT LIBCOAP
libcoap is a C implementation of a lightweight application-protocol for devices that are constrained their resources such as computing power, RF range, memory, bandwith, or network packet sizes. This protocol, CoAP, is standardized by the IETF as RFC 7252. For further information related to CoAP, see http://coap.technology.
You might want to check out libcoap-minimal for usage examples.
PACKAGE CONTENTS
This directory contains a protocol parser and basic networking functions for platform with support for malloc() and BSD-style sockets. The examples directory contains a client and a server to demonstrate the use of this library.
LICENSE INFORMATION
This library is published as open-source software without any warranty of any kind. Use is permitted under the terms of the simplified BSD license. It includes public domain software. libcoap binaries may also include open-source software with their respective licensing terms. Please refer to LICENSE for further details.