{"action":"created","comment":{"url":"https://api.github.com/repos/8devices/wakaama/pulls/comments/176024316","pull_request_review_id":105651800,"id":176024316,"diff_hunk":"@@ -182,3 +188,114 @@ int rest_subscriptions_put_cb(const ulfius_req_t *req, ulfius_resp_t *resp, void\n     return err;\n }\n \n+int rest_subscriptions_delete_cb(const ulfius_req_t *req, ulfius_resp_t *resp, void *context)\n+{\n+    rest_context_t *rest = (rest_context_t *)context;\n+    const char *name;\n+    lwm2m_client_t *client;\n+    char path[100];\n+    size_t len;\n+    lwm2m_uri_t uri;\n+    lwm2m_observation_t *targetP;\n+    rest_observe_context_t *observe_context = NULL;\n+    int res;\n+\n+    /*\n+     * IMPORTANT!!! Error handling is split into two parts:\n+     * First, validate client request and, in case of an error, fail fast and\n+     * return any related 4xx code.\n+     * Second, once the request is validated, start allocating neccessary\n+     * resources and, in case of an error, jump (goto) to cleanup section at\n+     * the end of the function.\n+     */\n+\n+    /* Find requested client */\n+    name = u_map_get(req->map_url, \"name\");\n+    client = rest_endpoints_find_client(rest->lwm2m->clientList, name);\n+    if (client == NULL)\n+    {\n+        ulfius_set_empty_body_response(resp, 404);\n+        return U_CALLBACK_CONTINUE;\n+    }\n+\n+    /* Reconstruct and validate client path */\n+    len = snprintf(path, sizeof(path), \"/subscriptions/%s/\", name);\n+\n+    if (req->http_url == NULL || strlen(req->http_url) >= sizeof(path) || len >= sizeof(path))\n+    {\n+        fprintf(stderr, \"%s(): invalid http request (%s)!\\n\", __func__, req->http_url);\n+        return U_CALLBACK_ERROR;\n+    }\n+\n+    // this is probaly redundant if there's only one matching ulfius filter\n+    if (strncmp(path, req->http_url, len) != 0)","path":"examples/rest-server/rest-subscriptions.c","position":57,"original_position":57,"commit_id":"ae963705ac4f1ac0ce3c1114ba02fb5d68a66496","original_commit_id":"ae963705ac4f1ac0ce3c1114ba02fb5d68a66496","user":{"login":"valinskas","id":1107625,"avatar_url":"https://avatars1.githubusercontent.com/u/1107625?v=4","gravatar_id":"","url":"https://api.github.com/users/valinskas","html_url":"https://github.com/valinskas","followers_url":"https://api.github.com/users/valinskas/followers","following_url":"https://api.github.com/users/valinskas/following{/other_user}","gists_url":"https://api.github.com/users/valinskas/gists{/gist_id}","starred_url":"https://api.github.com/users/valinskas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valinskas/subscriptions","organizations_url":"https://api.github.com/users/valinskas/orgs","repos_url":"https://api.github.com/users/valinskas/repos","events_url":"https://api.github.com/users/valinskas/events{/privacy}","received_events_url":"https://api.github.com/users/valinskas/received_events","type":"User","site_admin":false},"body":"ok \r\n","created_at":"2018-03-21T09:42:56Z","updated_at":"2018-03-21T09:42:57Z","html_url":"https://github.com/8devices/wakaama/pull/17#discussion_r176024316","pull_request_url":"https://api.github.com/repos/8devices/wakaama/pulls/17","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/8devices/wakaama/pulls/comments/176024316"},"html":{"href":"https://github.com/8devices/wakaama/pull/17#discussion_r176024316"},"pull_request":{"href":"https://api.github.com/repos/8devices/wakaama/pulls/17"}},"in_reply_to_id":175342740},"pull_request":{"url":"https://api.github.com/repos/8devices/wakaama/pulls/17","id":175508830,"html_url":"https://github.com/8devices/wakaama/pull/17","diff_url":"https://github.com/8devices/wakaama/pull/17.diff","patch_url":"https://github.com/8devices/wakaama/pull/17.patch","issue_url":"https://api.github.com/repos/8devices/wakaama/issues/17","number":17,"state":"open","locked":false,"title":"Implement observation removal","user":{"login":"Lycopersicum","id":25051247,"avatar_url":"https://avatars3.githubusercontent.com/u/25051247?v=4","gravatar_id":"","url":"https://api.github.com/users/Lycopersicum","html_url":"https://github.com/Lycopersicum","followers_url":"https://api.github.com/users/Lycopersicum/followers","following_url":"https://api.github.com/users/Lycopersicum/following{/other_user}","gists_url":"https://api.github.com/users/Lycopersicum/gists{/gist_id}","starred_url":"https://api.github.com/users/Lycopersicum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lycopersicum/subscriptions","organizations_url":"https://api.github.com/users/Lycopersicum/orgs","repos_url":"https://api.github.com/users/Lycopersicum/repos","events_url":"https://api.github.com/users/Lycopersicum/events{/privacy}","received_events_url":"https://api.github.com/users/Lycopersicum/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-16T11:37:49Z","updated_at":"2018-03-21T09:42:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fc1cdc39d6f8cbbedc3e7b96707804d9ec7ae25","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/8devices/wakaama/pulls/17/commits","review_comments_url":"https://api.github.com/repos/8devices/wakaama/pulls/17/comments","review_comment_url":"https://api.github.com/repos/8devices/wakaama/pulls/comments{/number}","comments_url":"https://api.github.com/repos/8devices/wakaama/issues/17/comments","statuses_url":"https://api.github.com/repos/8devices/wakaama/statuses/ae963705ac4f1ac0ce3c1114ba02fb5d68a66496","head":{"label":"8devices:implement-observation-removal","ref":"implement-observation-removal","sha":"ae963705ac4f1ac0ce3c1114ba02fb5d68a66496","user":{"login":"8devices","id":900261,"avatar_url":"https://avatars1.githubusercontent.com/u/900261?v=4","gravatar_id":"","url":"https://api.github.com/users/8devices","html_url":"https://github.com/8devices","followers_url":"https://api.github.com/users/8devices/followers","following_url":"https://api.github.com/users/8devices/following{/other_user}","gists_url":"https://api.github.com/users/8devices/gists{/gist_id}","starred_url":"https://api.github.com/users/8devices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/8devices/subscriptions","organizations_url":"https://api.github.com/users/8devices/orgs","repos_url":"https://api.github.com/users/8devices/repos","events_url":"https://api.github.com/users/8devices/events{/privacy}","received_events_url":"https://api.github.com/users/8devices/received_events","type":"Organization","site_admin":false},"repo":{"id":97206749,"name":"wakaama","full_name":"8devices/wakaama","owner":{"login":"8devices","id":900261,"avatar_url":"https://avatars1.githubusercontent.com/u/900261?v=4","gravatar_id":"","url":"https://api.github.com/users/8devices","html_url":"https://github.com/8devices","followers_url":"https://api.github.com/users/8devices/followers","following_url":"https://api.github.com/users/8devices/following{/other_user}","gists_url":"https://api.github.com/users/8devices/gists{/gist_id}","starred_url":"https://api.github.com/users/8devices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/8devices/subscriptions","organizations_url":"https://api.github.com/users/8devices/orgs","repos_url":"https://api.github.com/users/8devices/repos","events_url":"https://api.github.com/users/8devices/events{/privacy}","received_events_url":"https://api.github.com/users/8devices/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/8devices/wakaama","description":"Eclipse Wakaama (formerly liblwm2m) is an implementation of the Open Mobile Alliance's LightWeight M2M protocol (LWM2M).","fork":true,"url":"https://api.github.com/repos/8devices/wakaama","forks_url":"https://api.github.com/repos/8devices/wakaama/forks","keys_url":"https://api.github.com/repos/8devices/wakaama/keys{/key_id}","collaborators_url":"https://api.github.com/repos/8devices/wakaama/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/8devices/wakaama/teams","hooks_url":"https://api.github.com/repos/8devices/wakaama/hooks","issue_events_url":"https://api.github.com/repos/8devices/wakaama/issues/events{/number}","events_url":"https://api.github.com/repos/8devices/wakaama/events","assignees_url":"https://api.github.com/repos/8devices/wakaama/assignees{/user}","branches_url":"https://api.github.com/repos/8devices/wakaama/branches{/branch}","tags_url":"https://api.github.com/repos/8devices/wakaama/tags","blobs_url":"https://api.github.com/repos/8devices/wakaama/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/8devices/wakaama/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/8devices/wakaama/git/refs{/sha}","trees_url":"https://api.github.com/repos/8devices/wakaama/git/trees{/sha}","statuses_url":"https://api.github.com/repos/8devices/wakaama/statuses/{sha}","languages_url":"https://api.github.com/repos/8devices/wakaama/languages","stargazers_url":"https://api.github.com/repos/8devices/wakaama/stargazers","contributors_url":"https://api.github.com/repos/8devices/wakaama/contributors","subscribers_url":"https://api.github.com/repos/8devices/wakaama/subscribers","subscription_url":"https://api.github.com/repos/8devices/wakaama/subscription","commits_url":"https://api.github.com/repos/8devices/wakaama/commits{/sha}","git_commits_url":"https://api.github.com/repos/8devices/wakaama/git/commits{/sha}","comments_url":"https://api.github.com/repos/8devices/wakaama/comments{/number}","issue_comment_url":"https://api.github.com/repos/8devices/wakaama/issues/comments{/number}","contents_url":"https://api.github.com/repos/8devices/wakaama/contents/{+path}","compare_url":"https://api.github.com/repos/8devices/wakaama/compare/{base}...{head}","merges_url":"https://api.github.com/repos/8devices/wakaama/merges","archive_url":"https://api.github.com/repos/8devices/wakaama/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/8devices/wakaama/downloads","issues_url":"https://api.github.com/repos/8devices/wakaama/issues{/number}","pulls_url":"https://api.github.com/repos/8devices/wakaama/pulls{/number}","milestones_url":"https://api.github.com/repos/8devices/wakaama/milestones{/number}","notifications_url":"https://api.github.com/repos/8devices/wakaama/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/8devices/wakaama/labels{/name}","releases_url":"https://api.github.com/repos/8devices/wakaama/releases{/id}","deployments_url":"https://api.github.com/repos/8devices/wakaama/deployments","created_at":"2017-07-14T07:35:24Z","updated_at":"2018-03-16T12:02:25Z","pushed_at":"2018-03-21T09:40:07Z","git_url":"git://github.com/8devices/wakaama.git","ssh_url":"git@github.com:8devices/wakaama.git","clone_url":"https://github.com/8devices/wakaama.git","svn_url":"https://github.com/8devices/wakaama","homepage":"","size":2350,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":13,"license":null,"forks":1,"open_issues":13,"watchers":0,"default_branch":"master-rest"}},"base":{"label":"8devices:master-rest","ref":"master-rest","sha":"4a11a871de00ab82602cbc0b30df34ad4bed0ee6","user":{"login":"8devices","id":900261,"avatar_url":"https://avatars1.githubusercontent.com/u/900261?v=4","gravatar_id":"","url":"https://api.github.com/users/8devices","html_url":"https://github.com/8devices","followers_url":"https://api.github.com/users/8devices/followers","following_url":"https://api.github.com/users/8devices/following{/other_user}","gists_url":"https://api.github.com/users/8devices/gists{/gist_id}","starred_url":"https://api.github.com/users/8devices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/8devices/subscriptions","organizations_url":"https://api.github.com/users/8devices/orgs","repos_url":"https://api.github.com/users/8devices/repos","events_url":"https://api.github.com/users/8devices/events{/privacy}","received_events_url":"https://api.github.com/users/8devices/received_events","type":"Organization","site_admin":false},"repo":{"id":97206749,"name":"wakaama","full_name":"8devices/wakaama","owner":{"login":"8devices","id":900261,"avatar_url":"https://avatars1.githubusercontent.com/u/900261?v=4","gravatar_id":"","url":"https://api.github.com/users/8devices","html_url":"https://github.com/8devices","followers_url":"https://api.github.com/users/8devices/followers","following_url":"https://api.github.com/users/8devices/following{/other_user}","gists_url":"https://api.github.com/users/8devices/gists{/gist_id}","starred_url":"https://api.github.com/users/8devices/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/8devices/subscriptions","organizations_url":"https://api.github.com/users/8devices/orgs","repos_url":"https://api.github.com/users/8devices/repos","events_url":"https://api.github.com/users/8devices/events{/privacy}","received_events_url":"https://api.github.com/users/8devices/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/8devices/wakaama","description":"Eclipse Wakaama (formerly liblwm2m) is an implementation of the Open Mobile Alliance's LightWeight M2M protocol (LWM2M).","fork":true,"url":"https://api.github.com/repos/8devices/wakaama","forks_url":"https://api.github.com/repos/8devices/wakaama/forks","keys_url":"https://api.github.com/repos/8devices/wakaama/keys{/key_id}","collaborators_url":"https://api.github.com/repos/8devices/wakaama/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/8devices/wakaama/teams","hooks_url":"https://api.github.com/repos/8devices/wakaama/hooks","issue_events_url":"https://api.github.com/repos/8devices/wakaama/issues/events{/number}","events_url":"https://api.github.com/repos/8devices/wakaama/events","assignees_url":"https://api.github.com/repos/8devices/wakaama/assignees{/user}","branches_url":"https://api.github.com/repos/8devices/wakaama/branches{/branch}","tags_url":"https://api.github.com/repos/8devices/wakaama/tags","blobs_url":"https://api.github.com/repos/8devices/wakaama/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/8devices/wakaama/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/8devices/wakaama/git/refs{/sha}","trees_url":"https://api.github.com/repos/8devices/wakaama/git/trees{/sha}","statuses_url":"https://api.github.com/repos/8devices/wakaama/statuses/{sha}","languages_url":"https://api.github.com/repos/8devices/wakaama/languages","stargazers_url":"https://api.github.com/repos/8devices/wakaama/stargazers","contributors_url":"https://api.github.com/repos/8devices/wakaama/contributors","subscribers_url":"https://api.github.com/repos/8devices/wakaama/subscribers","subscription_url":"https://api.github.com/repos/8devices/wakaama/subscription","commits_url":"https://api.github.com/repos/8devices/wakaama/commits{/sha}","git_commits_url":"https://api.github.com/repos/8devices/wakaama/git/commits{/sha}","comments_url":"https://api.github.com/repos/8devices/wakaama/comments{/number}","issue_comment_url":"https://api.github.com/repos/8devices/wakaama/issues/comments{/number}","contents_url":"https://api.github.com/repos/8devices/wakaama/contents/{+path}","compare_url":"https://api.github.com/repos/8devices/wakaama/compare/{base}...{head}","merges_url":"https://api.github.com/repos/8devices/wakaama/merges","archive_url":"https://api.github.com/repos/8devices/wakaama/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/8devices/wakaama/downloads","issues_url":"https://api.github.com/repos/8devices/wakaama/issues{/number}","pulls_url":"https://api.github.com/repos/8devices/wakaama/pulls{/number}","milestones_url":"https://api.github.com/repos/8devices/wakaama/milestones{/number}","notifications_url":"https://api.github.com/repos/8devices/wakaama/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/8devices/wakaama/labels{/name}","releases_url":"https://api.github.com/repos/8devices/wakaama/releases{/id}","deployments_url":"https://api.github.com/repos/8devices/wakaama/deployments","created_at":"2017-07-14T07:35:24Z","updated_at":"2018-03-16T12:02:25Z","pushed_at":"2018-03-21T09:40:07Z","git_url":"git://github.com/8devices/wakaama.git","ssh_url":"git@github.com:8devices/wakaama.git","clone_url":"https://github.com/8devices/wakaama.git","svn_url":"https://github.com/8devices/wakaama","homepage":"","size":2350,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":13,"license":null,"forks":1,"open_issues":13,"watchers":0,"default_branch":"master-rest"}},"_links":{"self":{"href":"https://api.github.com/repos/8devices/wakaama/pulls/17"},"html":{"href":"https://github.com/8devices/wakaama/pull/17"},"issue":{"href":"https://api.github.com/repos/8devices/wakaama/issues/17"},"comments":{"href":"https://api.github.com/repos/8devices/wakaama/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/8devices/wakaama/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/8devices/wakaama/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/8devices/wakaama/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/8devices/wakaama/statuses/ae963705ac4f1ac0ce3c1114ba02fb5d68a66496"}},"author_association":"NONE"}}
{"actor":{"display_login":"valinskas"}}