[riot-notifications] [RIOT-OS/RIOT] sys/net/application_layer/nanocoap: Add path prefix option (#11098)

Leandro Lanzieri notifications at github.com
Mon Mar 4 18:09:18 CET 2019


leandrolanzieri commented on this pull request.



> @@ -399,7 +399,15 @@ static int _find_resource(coap_pkt_t *pdu, const coap_resource_t **resource_ptr,
                 resource++;
             }
 
-            int res = strcmp((char *)&uri[0], resource->path);
+            int res;
+            if ((resource->methods & COAP_MATCH_SUBTREE)) {
+                int len = strlen(resource->path);
+                res = memcmp(resource->path, uri, len);

You're right, changed!

-- 
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/11098#discussion_r262155870
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190304/f2ee7d97/attachment.html>


More information about the notifications mailing list