{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/iotjs/pulls/comments/214857421","pull_request_review_id":151995349,"id":214857421,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDg1NzQyMQ==","diff_hunk":"@@ -244,8 +255,17 @@ JS_FUNCTION(PrepareHandshakeRequest) {\n     return JS_CREATE_ERROR(COMMON, \"Invalid host and/or path arguments!\");\n   };\n \n-  generated_key = ws_generate_key(jsref);\n-  size_t generated_key_len = strlen((char *)generated_key);\n+  void *native_p;\n+  JNativeInfoType *out_native_info;\n+  bool has_p =\n+      jerry_get_object_native_pointer(jsref, &native_p, &out_native_info);\n+  if (!has_p || out_native_info != &wsclient_native_info) {\n+    return WS_ERR_NATIVE_POINTER_ERR;\n+  }\n+  iotjs_wsclient_t *wsclient = (iotjs_wsclient_t *)native_p;\n+\n+  wsclient->generated_key = ws_generate_key(jsref);\n+  size_t generated_key_len = 24;","path":"src/modules/iotjs_module_websocket.c","position":71,"original_position":71,"commit_id":"bff0f493ca974b95c863f3b0d2cc9939d0e926c6","original_commit_id":"bff0f493ca974b95c863f3b0d2cc9939d0e926c6","user":{"login":"DanielBallaSZTE","id":20175069,"node_id":"MDQ6VXNlcjIwMTc1MDY5","avatar_url":"https://avatars0.githubusercontent.com/u/20175069?v=4","gravatar_id":"","url":"https://api.github.com/users/DanielBallaSZTE","html_url":"https://github.com/DanielBallaSZTE","followers_url":"https://api.github.com/users/DanielBallaSZTE/followers","following_url":"https://api.github.com/users/DanielBallaSZTE/following{/other_user}","gists_url":"https://api.github.com/users/DanielBallaSZTE/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielBallaSZTE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielBallaSZTE/subscriptions","organizations_url":"https://api.github.com/users/DanielBallaSZTE/orgs","repos_url":"https://api.github.com/users/DanielBallaSZTE/repos","events_url":"https://api.github.com/users/DanielBallaSZTE/events{/privacy}","received_events_url":"https://api.github.com/users/DanielBallaSZTE/received_events","type":"User","site_admin":false},"body":"Hmm you are right, IoT.js should be terminated, since it is an uncaught exception, but the user could just catch the error, and continue running the program. \r\nThe base64 encoding can fail as well.\r\nBy the way, thank you for clarifying your point, now I get it. You suggestion is right on using  `strlen`.\r\n\r\n","created_at":"2018-09-04T10:03:41Z","updated_at":"2018-09-04T10:03:41Z","html_url":"https://github.com/Samsung/iotjs/pull/1721#discussion_r214857421","pull_request_url":"https://api.github.com/repos/Samsung/iotjs/pulls/1721","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/comments/214857421"},"html":{"href":"https://github.com/Samsung/iotjs/pull/1721#discussion_r214857421"},"pull_request":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1721"}},"in_reply_to_id":213541996},"pull_request":{"url":"https://api.github.com/repos/Samsung/iotjs/pulls/1721","id":205937961,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1OTM3OTYx","html_url":"https://github.com/Samsung/iotjs/pull/1721","diff_url":"https://github.com/Samsung/iotjs/pull/1721.diff","patch_url":"https://github.com/Samsung/iotjs/pull/1721.patch","issue_url":"https://api.github.com/repos/Samsung/iotjs/issues/1721","number":1721,"state":"open","locked":false,"title":"Fix websocket client to support multiple clients at the same time.","user":{"login":"imiklos","id":36988640,"node_id":"MDQ6VXNlcjM2OTg4NjQw","avatar_url":"https://avatars0.githubusercontent.com/u/36988640?v=4","gravatar_id":"","url":"https://api.github.com/users/imiklos","html_url":"https://github.com/imiklos","followers_url":"https://api.github.com/users/imiklos/followers","following_url":"https://api.github.com/users/imiklos/following{/other_user}","gists_url":"https://api.github.com/users/imiklos/gists{/gist_id}","starred_url":"https://api.github.com/users/imiklos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imiklos/subscriptions","organizations_url":"https://api.github.com/users/imiklos/orgs","repos_url":"https://api.github.com/users/imiklos/repos","events_url":"https://api.github.com/users/imiklos/events{/privacy}","received_events_url":"https://api.github.com/users/imiklos/received_events","type":"User","site_admin":false},"body":"The generated key for the handshake validation has moved to the header.\r\n\r\nIoT.js-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu","created_at":"2018-08-03T06:35:18Z","updated_at":"2018-09-04T10:03:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e1d1bce4efa0209e6a4d75f19f1f6f0231b6f06","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/iotjs/pulls/1721/commits","review_comments_url":"https://api.github.com/repos/Samsung/iotjs/pulls/1721/comments","review_comment_url":"https://api.github.com/repos/Samsung/iotjs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/iotjs/issues/1721/comments","statuses_url":"https://api.github.com/repos/Samsung/iotjs/statuses/bff0f493ca974b95c863f3b0d2cc9939d0e926c6","head":{"label":"imiklos:iotjs_websocket_fixkey","ref":"iotjs_websocket_fixkey","sha":"bff0f493ca974b95c863f3b0d2cc9939d0e926c6","user":{"login":"imiklos","id":36988640,"node_id":"MDQ6VXNlcjM2OTg4NjQw","avatar_url":"https://avatars0.githubusercontent.com/u/36988640?v=4","gravatar_id":"","url":"https://api.github.com/users/imiklos","html_url":"https://github.com/imiklos","followers_url":"https://api.github.com/users/imiklos/followers","following_url":"https://api.github.com/users/imiklos/following{/other_user}","gists_url":"https://api.github.com/users/imiklos/gists{/gist_id}","starred_url":"https://api.github.com/users/imiklos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imiklos/subscriptions","organizations_url":"https://api.github.com/users/imiklos/orgs","repos_url":"https://api.github.com/users/imiklos/repos","events_url":"https://api.github.com/users/imiklos/events{/privacy}","received_events_url":"https://api.github.com/users/imiklos/received_events","type":"User","site_admin":false},"repo":{"id":127115959,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcxMTU5NTk=","name":"iotjs","full_name":"imiklos/iotjs","owner":{"login":"imiklos","id":36988640,"node_id":"MDQ6VXNlcjM2OTg4NjQw","avatar_url":"https://avatars0.githubusercontent.com/u/36988640?v=4","gravatar_id":"","url":"https://api.github.com/users/imiklos","html_url":"https://github.com/imiklos","followers_url":"https://api.github.com/users/imiklos/followers","following_url":"https://api.github.com/users/imiklos/following{/other_user}","gists_url":"https://api.github.com/users/imiklos/gists{/gist_id}","starred_url":"https://api.github.com/users/imiklos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imiklos/subscriptions","organizations_url":"https://api.github.com/users/imiklos/orgs","repos_url":"https://api.github.com/users/imiklos/repos","events_url":"https://api.github.com/users/imiklos/events{/privacy}","received_events_url":"https://api.github.com/users/imiklos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imiklos/iotjs","description":"Platform for Internet of Things with JavaScript http://www.iotjs.net ","fork":true,"url":"https://api.github.com/repos/imiklos/iotjs","forks_url":"https://api.github.com/repos/imiklos/iotjs/forks","keys_url":"https://api.github.com/repos/imiklos/iotjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imiklos/iotjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imiklos/iotjs/teams","hooks_url":"https://api.github.com/repos/imiklos/iotjs/hooks","issue_events_url":"https://api.github.com/repos/imiklos/iotjs/issues/events{/number}","events_url":"https://api.github.com/repos/imiklos/iotjs/events","assignees_url":"https://api.github.com/repos/imiklos/iotjs/assignees{/user}","branches_url":"https://api.github.com/repos/imiklos/iotjs/branches{/branch}","tags_url":"https://api.github.com/repos/imiklos/iotjs/tags","blobs_url":"https://api.github.com/repos/imiklos/iotjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imiklos/iotjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imiklos/iotjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/imiklos/iotjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imiklos/iotjs/statuses/{sha}","languages_url":"https://api.github.com/repos/imiklos/iotjs/languages","stargazers_url":"https://api.github.com/repos/imiklos/iotjs/stargazers","contributors_url":"https://api.github.com/repos/imiklos/iotjs/contributors","subscribers_url":"https://api.github.com/repos/imiklos/iotjs/subscribers","subscription_url":"https://api.github.com/repos/imiklos/iotjs/subscription","commits_url":"https://api.github.com/repos/imiklos/iotjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/imiklos/iotjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/imiklos/iotjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/imiklos/iotjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/imiklos/iotjs/contents/{+path}","compare_url":"https://api.github.com/repos/imiklos/iotjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imiklos/iotjs/merges","archive_url":"https://api.github.com/repos/imiklos/iotjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imiklos/iotjs/downloads","issues_url":"https://api.github.com/repos/imiklos/iotjs/issues{/number}","pulls_url":"https://api.github.com/repos/imiklos/iotjs/pulls{/number}","milestones_url":"https://api.github.com/repos/imiklos/iotjs/milestones{/number}","notifications_url":"https://api.github.com/repos/imiklos/iotjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imiklos/iotjs/labels{/name}","releases_url":"https://api.github.com/repos/imiklos/iotjs/releases{/id}","deployments_url":"https://api.github.com/repos/imiklos/iotjs/deployments","created_at":"2018-03-28T09:22:35Z","updated_at":"2018-09-04T08:39:34Z","pushed_at":"2018-09-04T08:39:32Z","git_url":"git://github.com/imiklos/iotjs.git","ssh_url":"git@github.com:imiklos/iotjs.git","clone_url":"https://github.com/imiklos/iotjs.git","svn_url":"https://github.com/imiklos/iotjs","homepage":"","size":64217,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Samsung:master","ref":"master","sha":"b2c741ded06bc05cc9d187c80039c2dee8f7a68f","user":{"login":"Samsung","id":6210390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAzOTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6210390?v=4","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":33589470,"node_id":"MDEwOlJlcG9zaXRvcnkzMzU4OTQ3MA==","name":"iotjs","full_name":"Samsung/iotjs","owner":{"login":"Samsung","id":6210390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAzOTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6210390?v=4","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/iotjs","description":"Platform for Internet of Things with JavaScript http://www.iotjs.net ","fork":false,"url":"https://api.github.com/repos/Samsung/iotjs","forks_url":"https://api.github.com/repos/Samsung/iotjs/forks","keys_url":"https://api.github.com/repos/Samsung/iotjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/iotjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/iotjs/teams","hooks_url":"https://api.github.com/repos/Samsung/iotjs/hooks","issue_events_url":"https://api.github.com/repos/Samsung/iotjs/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/iotjs/events","assignees_url":"https://api.github.com/repos/Samsung/iotjs/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/iotjs/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/iotjs/tags","blobs_url":"https://api.github.com/repos/Samsung/iotjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/iotjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/iotjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/iotjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/iotjs/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/iotjs/languages","stargazers_url":"https://api.github.com/repos/Samsung/iotjs/stargazers","contributors_url":"https://api.github.com/repos/Samsung/iotjs/contributors","subscribers_url":"https://api.github.com/repos/Samsung/iotjs/subscribers","subscription_url":"https://api.github.com/repos/Samsung/iotjs/subscription","commits_url":"https://api.github.com/repos/Samsung/iotjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/iotjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/iotjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/iotjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/iotjs/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/iotjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/iotjs/merges","archive_url":"https://api.github.com/repos/Samsung/iotjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/iotjs/downloads","issues_url":"https://api.github.com/repos/Samsung/iotjs/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/iotjs/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/iotjs/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/iotjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/iotjs/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/iotjs/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/iotjs/deployments","created_at":"2015-04-08T06:41:39Z","updated_at":"2018-08-31T10:17:42Z","pushed_at":"2018-09-04T09:26:31Z","git_url":"git://github.com/Samsung/iotjs.git","ssh_url":"git@github.com:Samsung/iotjs.git","clone_url":"https://github.com/Samsung/iotjs.git","svn_url":"https://github.com/Samsung/iotjs","homepage":"","size":64182,"stargazers_count":1803,"watchers_count":1803,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":343,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":343,"open_issues":21,"watchers":1803,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1721"},"html":{"href":"https://github.com/Samsung/iotjs/pull/1721"},"issue":{"href":"https://api.github.com/repos/Samsung/iotjs/issues/1721"},"comments":{"href":"https://api.github.com/repos/Samsung/iotjs/issues/1721/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1721/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1721/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/iotjs/statuses/bff0f493ca974b95c863f3b0d2cc9939d0e926c6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"DanielBallaSZTE"}}