1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gcoap: accept resources in any order

This commit is contained in:
Benjamin Valentin 2022-09-26 20:03:51 +02:00
parent 2039a10e71
commit da1f161c3c
2 changed files with 2 additions and 7 deletions

View File

@ -750,8 +750,7 @@ typedef struct {
* @brief A modular collection of resources for a server
*/
struct gcoap_listener {
const coap_resource_t *resources; /**< First element in the array of
* resources; must order alphabetically */
const coap_resource_t *resources; /**< First element in the array of resources */
size_t resources_len; /**< Length of array */
/**
* @brief Transport type for the listener

View File

@ -744,13 +744,9 @@ static int _request_matcher_default(gcoap_listener_t *listener,
int res = coap_match_path(*resource, uri);
/* URI mismatch */
if (res > 0) {
if (res != 0) {
continue;
}
/* resources expected in alphabetical order */
else if (res < 0) {
break;
}
/* potential match, check for method */
if (! ((*resource)->methods & method_flag)) {