A unique Request-Tag is added to any PUT/POST/FETCH request that contains
a large body. The server is then able to differentiate between concurrent
sending of large data using the same session.
If a server responds with a 4.01 and includes an Echo option, then the libcoap
client retransmits the request adding in the received Echo option with the same
value.
If the server responds normally with an Echo option, then the next request
from the libcoap client (internally added by libcoap) will contain that Echo
option.
It is the responsibility of the server application to add in the Echo
option if required and validate the next request unless the Echo is triggered
by OSCORE (RFC8613 Appendix B.1.2).
Add in new function coap_mcast_per_resource() to enable granularity of
handling multicast requests differently at the resource level.
The granularity is handled by how the flags variable is set up in
coap_resource_init(). These additional flags are ignored if
function coap_mcast_per_resource() has not been invoked.
Added 2 functions coap_resource_unknown_init2() and
coap_resource_proxy_uri_init2() that support defining the mcast flags as
per coap_resource_init().
Responses are now delayed rather than the request being delayed before being
passed to the request handler.
Update coap-server with the -r option to enable multicast on specific
resources.
Do not reset wait_ms in coap-client for Block2 transfers.
Fix double release of lg_xmit data.
Allow lg_xmit server sessions to timeout.
Check that there is support for adding diagnostic messages for
error returns.
Truncate received data that is larger than the indicated block size
apart from the BERT case.
Sending off multiple CON requests with the same token without waiting for
any responses, causes the first one to be sent with the remainder ending
up in the delayqueue.
On receipt of ACK, coap_remove_from_queue() called in coap_dispatch(),
which returns the MID matching entry that was in the send queue, and then
the next entry on the delayqueue is removed from delayqueue and then sent
which puts the request on the sendqueue for any required re-transmissions.
coap_cancel_all_messages() should not be called in handle_response()
following the logic above if response is type ACK. If
coap_cancel_all_messages() is subsequently called with the same (possibly
empty) token as the next request that is being sent, then the next sendqueue
entry is inadvertantly deleted.
As there is now no sendqueue entry on receipt of the next ACK, the next
delayqueue entry is not sent off.
Only call coap_cancel_all_messages() if response is not of type ACK
(i.e. a separate response).
Report on tokens being the same as the previous one to encourage application
coders to use different tokens.
If the response is large, it can take time to transfer over the body. If
the server then initiates a new unsolicited response during the existing
transfer, then overflow / retry issues start to occur, compounded if multiple
unsolicited responses are triggerred during an existing transfer.
Hold back the notify of the new unsolicited response(s) until the
existing response has completed (or failed for another reason).
Other code has been tightened up incase the server or client are
not libcoap based and also exhibit this behavior, so to have a better chance
of recovery.
Create where appropriate default values for the Congestion control base
values and update the derived CC values accordingly.
Move derived value #define to coap_session_internal.h.
Update coap_session_t to hold the new CC values.
Update documentation for the new CC functions that update / get the
appropriate values.
NOTE: PROBING_WAIT is not currently checked in the code.
This removes a lot of code duplication by creating a pseudo resource
for .well-known/core that is not included in the .well-known/core output.
In particular specific Block2 option handling is no longer required.
Updated tests which now include checking that queries work.
Always delete PDUs on error before return from coap_send() (aligning with
previous documentation).
Check that the socket is still available before continuing with the PDU
transmission in coap_send().
Update documentation to be clearer on non-usage of PDU on return from
coap_send().
Trap coap_send() errors in coap-client.
Move event handlers setup code to earlier in coap-client to trap events
early on in the CoAP setup process.
Treat GNUTLS_E_UNEXPECTED_PACKET as a reason for DTLS closure.
To test, gnutls server and client with different PSK keys and coaps://
GNUTLS_E_UNEXPECTED_PACKET raised if alert sent by server in the
middle of the setup handshaking.
Commit 069a0786ce (#833) introduced the concept
of delaying PDU building until the CSM message had been received from server
so that PDUs could be correctly sized.
However, this meant that the functions coap_new_client_session*() would not
complete until the CSM was in for reliable protocols. Some applications need
the returned session to handle / differentiate between different events.
CSM can update
session->mtu
session->csm_block_supported
session->csm_bert_rem_support
coap_client_delay_first() is now called in coap_add_data_large_request()
and coap_session_max_pdu_size() (not coap_session_max_pdu_rcv_size() as
this is for receiving PDUs).
coap_client_delay_first() has been updated to catch recursive requests as well
as using more of the common code for the LwIP specifics.
The example coap-client application was setting the SIGPIPE signal to
SIG_IGN too late.
For applications that do not handle SIGPIPE, set MSG_NOSIGNAL in send() flags
to stop SIGPIPE being generated (but send() still returns EPIPE).
Drop the logging level when a client session cannot be extablished.
Can be reproduced when server requires certificates, but client does not
provide any certificate when using coaps+tcp:// and Mbed TLS.
Window 1
$ coap-server -c server.pem -C ca.pem
Window 2
$ coap-client coaps+tcp://127.0.0.1
$ echo $?
Add in new coap_block_b_t structure that tracks BERT usage, and
use new functions coap_*block_b_* that are in addition to the old
coap_*block_* functions that use coap_block_b_t.
coap_rng() needs to return 0 on success, and negative error on failure.
Corrected some logging function names.
Corrected the return value in coap_prng_default() to be always 1 on success
and 0 on failure to be consistent with coap_rand_func_t.
Updated coap_prng() to return 0 if an error in the used random function.
check_symbol_exists() only works for defines etc., not struct, so look for
CMSG_FIRSTHDR instead.
Make sure _GNU_SOURCE is defined to pick up the in6_pktinfo definition needed
for the logic using cmsghdr.
Two cases for not updating active sockets[] with file descriptors from a
session (non epoll code)
coap_retransmit() can release a session
coap_dtls_handle_timeout() can disconnect a session
Move the restransmit test code to before any updates to socket[].
Update coap_dtls_handle_timeout() to return a value indicating a DTLS timeout
has occurred. At the same time move the coap_dtls_handle_timeout() checks
into the first sessions iteration loop, removing having to iterate through the
sessions twice if DTLS.
Track the RCV mtu size separately from the XMT mtu, so that sufficiently
large PDUs can be built for receiving incoming data.
Wait until reliable session is complete and the initial CSM have been exchanged
before building any new PDUs for transmission so that they can hold the
appropriate amount of Max-Message-Size data.
Add in support into coap-server and coap-client for defining the
Max-Message-Size to use by adding in 2 new functions
coap_context_set_csm_max_message_size() and
coap_context_get_csm_max_message_size().
Add in flexibility into coap-server to control the initial example_data size.
Requires #844 to prevent recursive mutex locking when initiating proxy ongoing
session to upstream server.
Move around some of the COAP_CONSTRAINED_STACK mutex locking to prevent
recursive locking (issue when a proxy initiates an ongoing reliable client
connection).