1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

nanocoap: coap_tree_handler(): accept resources in any order

This commit is contained in:
Benjamin Valentin 2022-09-26 20:32:30 +02:00
parent da1f161c3c
commit a37b283ebe

View File

@ -454,18 +454,14 @@ ssize_t coap_tree_handler(coap_pkt_t *pkt, uint8_t *resp_buf,
}
int res = coap_match_path(resource, uri);
if (res > 0) {
if (res != 0) {
continue;
}
else if (res < 0) {
break;
}
else {
coap_request_ctx_t ctx = {
.resource = resource,
};
return resource->handler(pkt, resp_buf, resp_buf_len, &ctx);
}
coap_request_ctx_t ctx = {
.resource = resource,
};
return resource->handler(pkt, resp_buf, resp_buf_len, &ctx);
}
return coap_build_reply(pkt, COAP_CODE_404, resp_buf, resp_buf_len, 0);