Commented out coap_opt_block_set_m() as it is not used anywhere, and needs
to get rewritten if needed.
Removed / changed references to coap_opt_const_value()
Created a new struct coap_str_const_t to handle const parameters
Add in 2 new functions to create / delete the new string type
coap_new_str_const()
coap_delete_str_const()
Added in coap_make_str_const() to help create the necessary string equivalents
of the ascii test string. Note that the byte array must be in the
local scope.
Make coap_string_equal() a macro to handle differing string types
Made uri_path a pointer in coap_resource_t
Made name and value a pointer in coap_attribute_t
Reasoning behind this was triggerred by test t_wellknown3() creating a
number of resources, all using the same string buffer, so they all ended up
with the same uri-path (last update to uri-path). In the days of hashing
uri-path for the lookup would have worked, but the wrong uri-path
presented from the resource. Now we always allocate uri-path if
application does not want it freed off - and always free it off at time
or resource removal. The same is also true for coap_add_attr().
Updated coap_resource_init(), coap_add_attr() and coap_find_attr() to
pass in string parameters, rather than use a pointer to data and a length.
Where appropriate
Replace 'unsigned char' with 'const uint8_t'
Replace 'str' with 'coap_str_const_t'
Replace 'str' with 'coap_string_t'
Prefix with 'const' some type casts
Remove 'const' prefix from some type casts
Created new 'CU_ASSERT_PTR_EQUAL_C(actual, expected)' to handle const variable matching
Where appropriate
Replace 'unsigned char' with 'const uint8_t'
Replace 'str' with 'coap_str_c_t'
Replace 'str' with 'coap_string_t'
Prefix with 'const' some type casts
Update coap_add_attr() calls inline with updated API
Update coap_resource_init() calls inline with updated API
Make use of coap_make_str_const() for defining parameters
tests*/.c
Update code to stop memory leaks (as found by valgrind)
examples/coap-rd.c
Track the fact that uri_path in coap_resource_t is now a pointer
As discussed in bug #185 [1], const strings should be protected
from being overwritten. This change adds -Wwrite-strings to the
compiler warning flags and fixes resulting warnings by making
static strings const.
[1] https://github.com/obgm/libcoap/issues/185
As gcc 7 complains that coap_register_handler() is too large to
be inlined automatically, the function definition now has been
moved to resource.c.
This change also updates the symbol mappings accordingly.
/*
* examples/coap_list.[ch] are DEPRECATED. You should be using
* struct coap_optlist_t instead with the following functions which are a part
* of libcoap.
*
* coap_new_optlist()
* coap_insert_optlist()
* coap_delete_optlist()
* coap_add_optlist_pdu()
*
* See 'man coap_pdu_setup' for further information.
*
* examples/coap_list.[ch] files will be removed in a future release
* They are left here to support building backward compatability of old versions
* of coap-client
*/
Updated man/coap.txt.in
Updated configure.ac
Updated man/Makefile.am
Also include the man pages where there are more than 9 definitions in the
SYNOPSIS as we are limited to 10 in hte NAMES section
man/coap_attribute.txt.in: Tidy up output
man/coap_context.txt.in: Correct ports and protocols in the examples
man/coap_observe.txt.in: Update with the new optlist functions
man/coap_recovery.txt.in: Include how recovery times are calculated
man/coap_resource.txt.in: Tidy up output
man/coap_tls_library.txt.in: Tidy up output
man/coap_handler.txt.in: Update with new library naming
Fix compiler warning for index variable being also a string function
Add in optlist functions
coap_new_optlist()
coap_add_optlist_pdu()
coap_insert_optlist()
coap_delete_optlist()
Remove coap_list_t structure and replace with coap_optlist_t to maintain
backward code compatability.
Make use of the new coap_optlist_* functions
Use the new coap_optlist_t structure
Remove unneeded header includes
warn() -> coap_log(LOG_WARNING, )
debug() -> coap_log(LOG_DEBUG, )
Upgrade to VS2017. Added a property sheet with user variables to configure the
target installation directory and location of openssl library from within the
Visual Studio GUI and in a manner compatible with msbuild. This method is
inspired by the GTK project. It supports out of tree builds, and separate or
common directories for debug and release builds. The new install project copies
the library files to the selected target directory. It has all other projects
in dependency, so to build the library and utilities, you just build the
"install" target and it will take care of building the library, executable,
then copy to a tree with a unix-like structure (bin, lib, include).
Also fixes missing files in the testdriver project.
This change adds a new m4 macro AX_CHECK_A2X_TO_MANPAGE that
invokes the a2x program passed in the environment variable A2X
to create a minimal manual page. If A2X is set correctly, failing
this test is a good indicator that the docbook DTD or the
docbook XSL stylesheets are missing.
There are 2 issues fixed here
Issue 1: In coap_write() (circa line 1074)
if (XXXX && (s->last_rx_tx + session_timeout <= now || YYYY)) {
coap_session_free(s);
} else {
if (XXXX) {
coap_tick_t s_timeout = now - (s->last_rx_tx + session_timeout);
s_timeout will end up as a large number as 'now' is less than
(s->last_rx_tx + session_timeout)
Fix is to reverse the expression
Issue 2: In coap_write() (two places circa lines 1122 and 1136)
If coap_dtls_handle_timeout(s) causes the session to go away,
tls_timeout is set to 0, and so timeout does not get updated (could be 0
and so coap_write() returns 0 causing a wait for the default time in the
select() call.
Fix is to set timeout to 1 to cause a minimal time waiting in the select()