Create a new --enable-doxygen
Make --enable-documentation include both --enable-manpages and --enable-doxygen
and --disable-documentation include --disable-manpages and --disable-doxygen
Added several unit tests for coap_get_uri_path():
* Check corner cases such as one or more zero-length Uri-Paths.
* Check percent-encoding of reserved characters.
* Check non-reserved characters that should not be percent-encoded.
This change also removes a couple of trailing LWS by accident.
Include coap_resource_unknown_init() function for defining the unknown
resource.
Update hashing to use the resource's uri_path instead of key where appropriate
to avoid clashes when using the old hashed key.
coap_add_resource() now deletes previous resource with matching uri_path to
prevent duplication.
Remove now obsolete functions
coap_hash_request_uri()
coap_get_resource_from_key()
New function
coap_get_resource_from_uri_path()
*API Update coap_delete_resource() now deletes by resource, not by key.
At some point, str will get replaced in all of the code with coap_string_t.
This is to prevent potential name clashes when compiling application code.
Use coap_malloc_type(COAP_STRING,... instead of coap_malloc(...
Rename struct str as struct coap_string_t and 'typedef coap_string_t str' for
backwards compatabilty with the intent of removing str at some point to
prevent potential name clashes when compiling application code.
Add in new coap_string_equal() function for consistent comparing of strings.
With resource's hashed key being replaced by uri_path, old hash functions have
been removed and a new fuction coap_get_uri_path() added to abstract the
uri_path from the pdu.
Tidy up usage of is_unescaped_in_query() and slit it partially out to support
is_unescaped_in_path.
Update unsigned to uint16_t in appropriate places
As "coap_key_t key" is no longer used as the key for hashing resources onto
the hashlist which gave the potential for coap hashes clashing for the
resource Uri, "str uri" being used instead, so disable the building of the
coap_hash functions.
In addition, the .sym and .map file information now has duplicate
entries removed.
Expose the new functions
coap_resource_unknown_init()
coap_get_uri_path()
coap_get_resource_from_uri_path()
Drop the functions as old hashed key is no longer supported
coap_get_resource_from_key()
coap_hash_*()
Update handle_request() to call context->unknown_resource handler (if defined)
to support "RFC7252: 5.8.3. PUT" requirements.
Allow only handlers defined for unknown_resource
Update handle_request() to return 2.02 for an unknown resource (and
context->unknown_resource is not defined) for a DELETE request
"RFC7252: 5.8.4. DELETE"
Update code to use resource's uri_path not key as the item to hash for lookups
Make use of the new function coap_string_equal() when checking for
COAP_DEFAULT_URI_WELLKNOWN resource request.
Remove now obsolete hashed key code for is_wkc().
Need to support
"RFC7252: 5.8.3. PUT
If no resource exists, then the server MAY create a new resource with that
URI, resulting in a 2.01 (Created) Response Code."
Add in the function definition for the coap_add_resource_unknown().
Add in 'is_unknown' flag into coap_resource_t.
Make the resource uri_path be the hash lookup key, not the old hashed key, to
stop hash lookup clashes.
*API Change* Update coap_delete_resource() to not use the old hashed key.
Remove coap_get_resource_from_key() function and replace it with
coap_get_resource_from_uri_path().
Make the coap_resource_set_mode() more robust against bad parameters.
Remove #ifdef COAP_RESOURCES_NOHASH logic as no longer required
The library API lacks a way to store context for the handlers. A
LED-handler for example needs to now on which pin the specific LED
is connected in order to control it. Or a higher level API would like to save the
object pointer to the object responsible for the resource.
This change will introduce a void pointer for the user to save context.
He can then retrieve the context in the handler if needed.