obgm / libcoap

A CoAP (RFC 7252) implementation in C
Other
777 stars 421 forks source link

path_query parsing: Remove need to define scratch buffer #1448

Closed mrdeep1 closed 1 week ago

mrdeep1 commented 1 week ago

Create new options coap_uri_into_optlist(), coap_path_into_optlist() and coap_query_into_optlist() to be used instead of coap_uri_into_options(), coap_split_path() and coap_split_query() functions so the requirement for a scratch buffer is not needed.

Getting the minimum size for a scratch buffer is not straight forward and potential for unexpected boundary condition errors to occurif too small.

Correct parsing and stripping out of "%2E%2E" ("..") and "%2E" (".") path segments. ".." now removes the previous segment (if it exists).

Update documentation and unit testcases.

Update examples to use new options.