Add reference counting to recipient contexts so they can be safely removed
while still in use by active sessions. Expose callback hooks for credential
lookup, echo, and sequence storage to allow custom backends.
Expand example server to demonstrate the external storage via a simple
file based database. Expand coap_oscore_rcp_conf_t to enable settings
preconfigured echo value, sequence counter and window value as uint64
Enable temporary credentials returned by the find function and are destroyed
after use.
Check incoming Uri-Path and Location-Path options for just . or .. (or %2e
hex encoded variants) and treat as being invalid.
Stop insertion of Uri-Path and Location-Path options that contain just
. or .. (or %2e hex encoded variants).
Don't report
WARN coap_socket_accept_tcp: accept: Resource temporarily unavailable
when multiple threads are trying to process the same incoming TCP connection.
If an app request call-back modifies any data associated with a resource,
then multiple threads can attempt to unsafely modify the data at the same time.
Lock the resource when calling the app request handler (as global_lock is
unlocked) to prevent concurrent changes to the resource information.
If the app request handler is definately known to not modify the resource
information, then COAP_RESOURCE_SAFE_REQUEST_HANDLER can be set in the flags
for coap_resource_init(). Usually if there is a PUT, POST, PATCH or IPATCH
handler it is unsafe to set this. Setting this will reduce lock contention.
This is similar to coap_debug_set_packet_loss() which drops packets that are
to be sent, but emulates network reported errors by reporting ECONNREFUSED.
Analyzer run time does not like A -= B or A +=B even if A and B are uint32_t as there is potential
for overflow.
Analyzer run time does not like overflow when doing coap_tick_t - coap_tick_t.
Analyzer run time does not like (uint8_t << 24) as uint8_t is promoted as int, not u_int.
Analyzer run time does not like while(A--) {} even if A is uint32_t, as A is always decremented on
the test, even if the value of A is 0.
Fix potential overflow when analyzing an asn.1 tag.
Fix potential overflow when doing decode_segment() on a % hex value.
Include common system header files in coap_internal.h based on HAVE_*H
definitions.
Remove these system header files from include/*/*.h.
Add in system header files where appropriate in various apps.
Function coap_context_set_max_body_size() added.
For servers, if body size is too large, a 4.13 response is generated.
For clients, if the body size is too large, the server gets a RST and
no date is passed to the application. A new event COAP_EVENT_BLOCK_ISSUE
is generated.
Add in new functions
coap_new_client_session3()
coap_new_client_session_pki3()
coap_new_client_session_psk3()
coap_new_client_session_oscore3()
coap_new_client_session_oscore_pki3()
coap_new_client_session_oscore_psk3()
which effectively does coap_session_set_app_data2() and
coap_ws_set_host_request() early on in the session set up cycle.
Make sure all application callbacks are called with a coap_lock_callback*()
wrapper.
Rename callback variables within the internal structures with a _cb suffix for
ease of review.
The first coap_send(pdu) is held back until after the optional tests for
Extended Token or Q-Block support are complete with the return from coap_send()
containing the held back pdu's mid.
If there are any errors with this PDU when subsequentially sent, the
event COAP_EVENT_FIRST_PDU_FAIL gets raised.
Add in new function coap_add_data_large_request_app() that provides a call-back
to get individual blocks rather than having a large buffer held in
(contrained) memory.
If we correctly determine the presence of the sys/time.h and time.h
files using the HAVE_TIME_H and HAVE_SYS_TIME_H macros, then the LWIP
compilation will result in a duplicate function error. Perhaps previous
versions of LWIP did not have these files, in which case everything
would have worked correctly.
These changes add the necessary ifdefs and keep the optimal timer
function for LWIP.
Adds missed #include <time.h> lines to examples and documentation.
Adds the detection of the sys/select.h header to the CMake and autoconf.