{"action":"opened","number":1181,"pull_request":{"url":"https://api.github.com/repos/contiki-os/contiki/pulls/1181","id":41139378,"html_url":"https://github.com/contiki-os/contiki/pull/1181","diff_url":"https://github.com/contiki-os/contiki/pull/1181.diff","patch_url":"https://github.com/contiki-os/contiki/pull/1181.patch","issue_url":"https://api.github.com/repos/contiki-os/contiki/issues/1181","number":1181,"state":"open","locked":false,"title":"Fix default CoAP header block2 size","user":{"login":"arthurfabre","id":3017009,"avatar_url":"https://avatars.githubusercontent.com/u/3017009?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurfabre","html_url":"https://github.com/arthurfabre","followers_url":"https://api.github.com/users/arthurfabre/followers","following_url":"https://api.github.com/users/arthurfabre/following{/other_user}","gists_url":"https://api.github.com/users/arthurfabre/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurfabre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurfabre/subscriptions","organizations_url":"https://api.github.com/users/arthurfabre/orgs","repos_url":"https://api.github.com/users/arthurfabre/repos","events_url":"https://api.github.com/users/arthurfabre/events{/privacy}","received_events_url":"https://api.github.com/users/arthurfabre/received_events","type":"User","site_admin":false},"body":"When a client sends a CoAP request without specifying a block2 size, the server should choose one.\r\nThe CoAP engine sets this to `REST_MAX_CHUNK_SIZE`, which is not a valid block size as it is not a power of two.\r\nAs a result, resources can return a payload that isn't a valid block size.\r\nSome clients (Californium is affected, Cooper does not seem to be) do not check the block2 size with the actual payload size, and can therefore end up with duplicated data.\r\n\r\nFor example, on the Z1 platform:\r\n\r\n* An initial CoAP request is sent without a block2 header\r\n* The CoAP engine calls the resource handler with `preferred_size` set to `REST_MAX_CHUNK_SIZE`, in this case 48.\r\n* The resource returns a payload of size 48.\r\n* The client receives the payload, and stores all 48 bytes.\r\n* The client sends a further CoAP block request for the rest of the payload,\r\nwith the block2 size set to 32.\r\n* The resource returns bytes 32-64.\r\n* The client stores the payload. Bytes 32-48 are now duplicated.\r\n\r\n","created_at":"2015-07-29T15:51:38Z","updated_at":"2015-07-29T15:51:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/contiki-os/contiki/pulls/1181/commits","review_comments_url":"https://api.github.com/repos/contiki-os/contiki/pulls/1181/comments","review_comment_url":"https://api.github.com/repos/contiki-os/contiki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contiki-os/contiki/issues/1181/comments","statuses_url":"https://api.github.com/repos/contiki-os/contiki/statuses/5403b2a211034144137ab0ec52b995a3c23d8e37","head":{"label":"feshie:pr-fix-coap-size","ref":"pr-fix-coap-size","sha":"5403b2a211034144137ab0ec52b995a3c23d8e37","user":{"login":"feshie","id":6614606,"avatar_url":"https://avatars.githubusercontent.com/u/6614606?v=3","gravatar_id":"","url":"https://api.github.com/users/feshie","html_url":"https://github.com/feshie","followers_url":"https://api.github.com/users/feshie/followers","following_url":"https://api.github.com/users/feshie/following{/other_user}","gists_url":"https://api.github.com/users/feshie/gists{/gist_id}","starred_url":"https://api.github.com/users/feshie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feshie/subscriptions","organizations_url":"https://api.github.com/users/feshie/orgs","repos_url":"https://api.github.com/users/feshie/repos","events_url":"https://api.github.com/users/feshie/events{/privacy}","received_events_url":"https://api.github.com/users/feshie/received_events","type":"Organization","site_admin":false},"repo":{"id":18758769,"name":"contiki","full_name":"feshie/contiki","owner":{"login":"feshie","id":6614606,"avatar_url":"https://avatars.githubusercontent.com/u/6614606?v=3","gravatar_id":"","url":"https://api.github.com/users/feshie","html_url":"https://github.com/feshie","followers_url":"https://api.github.com/users/feshie/followers","following_url":"https://api.github.com/users/feshie/following{/other_user}","gists_url":"https://api.github.com/users/feshie/gists{/gist_id}","starred_url":"https://api.github.com/users/feshie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feshie/subscriptions","organizations_url":"https://api.github.com/users/feshie/orgs","repos_url":"https://api.github.com/users/feshie/repos","events_url":"https://api.github.com/users/feshie/events{/privacy}","received_events_url":"https://api.github.com/users/feshie/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feshie/contiki","description":"The contiki repository for the Mountain Sensing project","fork":true,"url":"https://api.github.com/repos/feshie/contiki","forks_url":"https://api.github.com/repos/feshie/contiki/forks","keys_url":"https://api.github.com/repos/feshie/contiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feshie/contiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feshie/contiki/teams","hooks_url":"https://api.github.com/repos/feshie/contiki/hooks","issue_events_url":"https://api.github.com/repos/feshie/contiki/issues/events{/number}","events_url":"https://api.github.com/repos/feshie/contiki/events","assignees_url":"https://api.github.com/repos/feshie/contiki/assignees{/user}","branches_url":"https://api.github.com/repos/feshie/contiki/branches{/branch}","tags_url":"https://api.github.com/repos/feshie/contiki/tags","blobs_url":"https://api.github.com/repos/feshie/contiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feshie/contiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feshie/contiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/feshie/contiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feshie/contiki/statuses/{sha}","languages_url":"https://api.github.com/repos/feshie/contiki/languages","stargazers_url":"https://api.github.com/repos/feshie/contiki/stargazers","contributors_url":"https://api.github.com/repos/feshie/contiki/contributors","subscribers_url":"https://api.github.com/repos/feshie/contiki/subscribers","subscription_url":"https://api.github.com/repos/feshie/contiki/subscription","commits_url":"https://api.github.com/repos/feshie/contiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/feshie/contiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/feshie/contiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/feshie/contiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/feshie/contiki/contents/{+path}","compare_url":"https://api.github.com/repos/feshie/contiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feshie/contiki/merges","archive_url":"https://api.github.com/repos/feshie/contiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feshie/contiki/downloads","issues_url":"https://api.github.com/repos/feshie/contiki/issues{/number}","pulls_url":"https://api.github.com/repos/feshie/contiki/pulls{/number}","milestones_url":"https://api.github.com/repos/feshie/contiki/milestones{/number}","notifications_url":"https://api.github.com/repos/feshie/contiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feshie/contiki/labels{/name}","releases_url":"https://api.github.com/repos/feshie/contiki/releases{/id}","created_at":"2014-04-14T11:47:23Z","updated_at":"2015-04-29T16:05:56Z","pushed_at":"2015-07-29T15:38:10Z","git_url":"git://github.com/feshie/contiki.git","ssh_url":"git@github.com:feshie/contiki.git","clone_url":"https://github.com/feshie/contiki.git","svn_url":"https://github.com/feshie/contiki","homepage":"http://mountainsensing.org/","size":65451,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":18,"forks":1,"open_issues":18,"watchers":1,"default_branch":"mountain-sensing-master"}},"base":{"label":"contiki-os:master","ref":"master","sha":"d5956d5c75be708ce2491844b7e8766a49c762f2","user":{"login":"contiki-os","id":2511296,"avatar_url":"https://avatars.githubusercontent.com/u/2511296?v=3","gravatar_id":"","url":"https://api.github.com/users/contiki-os","html_url":"https://github.com/contiki-os","followers_url":"https://api.github.com/users/contiki-os/followers","following_url":"https://api.github.com/users/contiki-os/following{/other_user}","gists_url":"https://api.github.com/users/contiki-os/gists{/gist_id}","starred_url":"https://api.github.com/users/contiki-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiki-os/subscriptions","organizations_url":"https://api.github.com/users/contiki-os/orgs","repos_url":"https://api.github.com/users/contiki-os/repos","events_url":"https://api.github.com/users/contiki-os/events{/privacy}","received_events_url":"https://api.github.com/users/contiki-os/received_events","type":"Organization","site_admin":false},"repo":{"id":6365284,"name":"contiki","full_name":"contiki-os/contiki","owner":{"login":"contiki-os","id":2511296,"avatar_url":"https://avatars.githubusercontent.com/u/2511296?v=3","gravatar_id":"","url":"https://api.github.com/users/contiki-os","html_url":"https://github.com/contiki-os","followers_url":"https://api.github.com/users/contiki-os/followers","following_url":"https://api.github.com/users/contiki-os/following{/other_user}","gists_url":"https://api.github.com/users/contiki-os/gists{/gist_id}","starred_url":"https://api.github.com/users/contiki-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiki-os/subscriptions","organizations_url":"https://api.github.com/users/contiki-os/orgs","repos_url":"https://api.github.com/users/contiki-os/repos","events_url":"https://api.github.com/users/contiki-os/events{/privacy}","received_events_url":"https://api.github.com/users/contiki-os/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contiki-os/contiki","description":"The official git repository for Contiki, the open source OS for the Internet of Things","fork":false,"url":"https://api.github.com/repos/contiki-os/contiki","forks_url":"https://api.github.com/repos/contiki-os/contiki/forks","keys_url":"https://api.github.com/repos/contiki-os/contiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contiki-os/contiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contiki-os/contiki/teams","hooks_url":"https://api.github.com/repos/contiki-os/contiki/hooks","issue_events_url":"https://api.github.com/repos/contiki-os/contiki/issues/events{/number}","events_url":"https://api.github.com/repos/contiki-os/contiki/events","assignees_url":"https://api.github.com/repos/contiki-os/contiki/assignees{/user}","branches_url":"https://api.github.com/repos/contiki-os/contiki/branches{/branch}","tags_url":"https://api.github.com/repos/contiki-os/contiki/tags","blobs_url":"https://api.github.com/repos/contiki-os/contiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contiki-os/contiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contiki-os/contiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/contiki-os/contiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contiki-os/contiki/statuses/{sha}","languages_url":"https://api.github.com/repos/contiki-os/contiki/languages","stargazers_url":"https://api.github.com/repos/contiki-os/contiki/stargazers","contributors_url":"https://api.github.com/repos/contiki-os/contiki/contributors","subscribers_url":"https://api.github.com/repos/contiki-os/contiki/subscribers","subscription_url":"https://api.github.com/repos/contiki-os/contiki/subscription","commits_url":"https://api.github.com/repos/contiki-os/contiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/contiki-os/contiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/contiki-os/contiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/contiki-os/contiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/contiki-os/contiki/contents/{+path}","compare_url":"https://api.github.com/repos/contiki-os/contiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contiki-os/contiki/merges","archive_url":"https://api.github.com/repos/contiki-os/contiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contiki-os/contiki/downloads","issues_url":"https://api.github.com/repos/contiki-os/contiki/issues{/number}","pulls_url":"https://api.github.com/repos/contiki-os/contiki/pulls{/number}","milestones_url":"https://api.github.com/repos/contiki-os/contiki/milestones{/number}","notifications_url":"https://api.github.com/repos/contiki-os/contiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contiki-os/contiki/labels{/name}","releases_url":"https://api.github.com/repos/contiki-os/contiki/releases{/id}","created_at":"2012-10-24T05:59:36Z","updated_at":"2015-07-29T04:20:43Z","pushed_at":"2015-07-29T10:56:04Z","git_url":"git://github.com/contiki-os/contiki.git","ssh_url":"git@github.com:contiki-os/contiki.git","clone_url":"https://github.com/contiki-os/contiki.git","svn_url":"https://github.com/contiki-os/contiki","homepage":"http://www.contiki-os.org/","size":89614,"stargazers_count":1431,"watchers_count":1431,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1022,"mirror_url":null,"open_issues_count":189,"forks":1022,"open_issues":189,"watchers":1431,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/1181"},"html":{"href":"https://github.com/contiki-os/contiki/pull/1181"},"issue":{"href":"https://api.github.com/repos/contiki-os/contiki/issues/1181"},"comments":{"href":"https://api.github.com/repos/contiki-os/contiki/issues/1181/comments"},"review_comments":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/1181/comments"},"review_comment":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contiki-os/contiki/pulls/1181/commits"},"statuses":{"href":"https://api.github.com/repos/contiki-os/contiki/statuses/5403b2a211034144137ab0ec52b995a3c23d8e37"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":3,"changed_files":1}}