If the application needs to see CoAP ping requests or CoAP TCP pong responses
then this update provides calling the configured handlers at the appropriate
points.
If the application needs to see CoAP ping requests or CoAP TCP pong responses
then there needs to be a handler that can be set up that is called
appropriately.
Add in coap_get_tls_library_version() for determining TLS build base + version
Do not allow a dynamic openssl library to be loaded and used at application
runtime that is less than OpenSSL version 1.1.0.
A new function coap_get_tls_library_version() that returns a pointer to a
coap_tls_version_t structure that contains both the TLS library type libcoap
was compiled against as well as the current TLS library version.
For a client, if a DTLS session is closed with ICMP unavailable packet, when
the TLS session is closed in the application with SSL_shutdown(), the OpenSSL
underlying library triggers a BIO_write() which calls coap_dgram_write() which
then 'assert's in coap_session_send().
(sock->flags == COAP_SOCKET_EMPTY && session->endpoint == NULL).
Fix is not to call coap_session_send() from coap_dgram_write() if socket is
closed and this is not an endpoint (not a server).
John Carter has provided this (slightly edited) patch to set len to 0
for PDUs that do not contain a payload. This makes this function more
robust for callers that do not care about the function result.
This change fixes issue 120 [1].
[1] https://github.com/obgm/libcoap/issues/120
The dead code detected by Coverity scan in CID 1458395 has been
replaced with explicitly setting the return value to 1 (the default
that has previously been used).
As coap_send() automatically releases the specified pdu, it must
not be accessed after coap_send() has returned.
This change fixes CID 1458399 reported by Coverity scan.
coap_send() always takes the ownership of the pdu that is passed
as argument to send, i.e., the memory will be released automatically
when the pdu is not needed anymore.
In CID 1459612, Coverity scan has complained about uninitialized use
of the variable bytes_read. Although this is a false positive here,
it seems to be more safe to always initialize bytes_read.
In coap_session_create_client(), the default port for TCP did not
correctly distinguish between TCP and TLS as pointed out in [1] by
Joan Shallow. This change applies the suggested fix.
[1] https://sourceforge.net/p/libcoap/mailman/message/36092184/
The value of the observe option is kept for each resource rather than being global to the context.
The value of the observe option must wrap to be stay below 2^24.
The value of the observe option must be different from the initial value when a notification is sent.