[riot-notifications] [RIOT-OS/RIOT] uri_parser: provide function to split query (#16695)

Martine Lenders notifications at github.com
Wed Aug 4 12:10:48 CEST 2021


@miri64 commented on this pull request.



> +            case '&':
+                if (params[idx].value == NULL) {
+                    /* we should have picked up a parameter value by now */
+                    return -1;
+                }
+                params[idx].value_len = c - params[idx].value;
+                if (*c == '#') {
+                    /* we've reached the end of the query string, next comes an
+                     * anchor, enforce end of loop
+                     * XXX: can be removed when uri_parser has anchor support */
+                    c = query_end;
+                }
+                else if ((idx + 1) < params_len) {
+                    /* c is an ampersand (&), so mark the next char as the next
+                     * parameter's name name */
+                    params[++idx].name = (char *)c + 1U;

It's an API change, so I would prefer to keep it separate. If the API is changed before this PR is changed, I will adapt the PR, if not, I would prefer to keep it as is for consistency.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16695#discussion_r682478821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210804/738618bb/attachment.htm>


More information about the notifications mailing list