{"action":"created","comment":{"url":"https://api.github.com/repos/Rokid/ShadowNode/pulls/comments/175472535","pull_request_review_id":105002822,"id":175472535,"diff_hunk":"@@ -153,6 +153,20 @@ JS_FUNCTION(MqttGetConnect) {\n   return retbuf;\n }\n \n+\n+void alloc_payload_buf(unsigned char **buf, int expected_size, int *alloc_size) {\n+  static int buf_size = 1 * 1024 * 1024;\n+  static unsigned char *buf_ = NULL;\n+  if (buf_ == NULL) {\n+    buf_ = malloc((size_t)buf_size * sizeof(unsigned char));","path":"src/modules/iotjs_module_mqtt.c","position":9,"original_position":9,"commit_id":"407dcde00e7f5df19507af5f86e808b264d689b7","original_commit_id":"407dcde00e7f5df19507af5f86e808b264d689b7","user":{"login":"yorkie","id":1935767,"avatar_url":"https://avatars3.githubusercontent.com/u/1935767?v=4","gravatar_id":"","url":"https://api.github.com/users/yorkie","html_url":"https://github.com/yorkie","followers_url":"https://api.github.com/users/yorkie/followers","following_url":"https://api.github.com/users/yorkie/following{/other_user}","gists_url":"https://api.github.com/users/yorkie/gists{/gist_id}","starred_url":"https://api.github.com/users/yorkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorkie/subscriptions","organizations_url":"https://api.github.com/users/yorkie/orgs","repos_url":"https://api.github.com/users/yorkie/repos","events_url":"https://api.github.com/users/yorkie/events{/privacy}","received_events_url":"https://api.github.com/users/yorkie/received_events","type":"User","site_admin":false},"body":"And where do the `buf_` get freed?","created_at":"2018-03-19T15:17:34Z","updated_at":"2018-03-19T15:19:10Z","html_url":"https://github.com/Rokid/ShadowNode/pull/81#discussion_r175472535","pull_request_url":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Rokid/ShadowNode/pulls/comments/175472535"},"html":{"href":"https://github.com/Rokid/ShadowNode/pull/81#discussion_r175472535"},"pull_request":{"href":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81"}},"in_reply_to_id":175472223},"pull_request":{"url":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81","id":175900371,"html_url":"https://github.com/Rokid/ShadowNode/pull/81","diff_url":"https://github.com/Rokid/ShadowNode/pull/81.diff","patch_url":"https://github.com/Rokid/ShadowNode/pull/81.patch","issue_url":"https://api.github.com/repos/Rokid/ShadowNode/issues/81","number":81,"state":"open","locked":false,"title":"bug fix","user":{"login":"lolBig","id":3438038,"avatar_url":"https://avatars3.githubusercontent.com/u/3438038?v=4","gravatar_id":"","url":"https://api.github.com/users/lolBig","html_url":"https://github.com/lolBig","followers_url":"https://api.github.com/users/lolBig/followers","following_url":"https://api.github.com/users/lolBig/following{/other_user}","gists_url":"https://api.github.com/users/lolBig/gists{/gist_id}","starred_url":"https://api.github.com/users/lolBig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolBig/subscriptions","organizations_url":"https://api.github.com/users/lolBig/orgs","repos_url":"https://api.github.com/users/lolBig/repos","events_url":"https://api.github.com/users/lolBig/events{/privacy}","received_events_url":"https://api.github.com/users/lolBig/received_events","type":"User","site_admin":false},"body":"- limit buffer size with 16k(defined by MBEDTLS_SSL_MAX_CONTENT_LEN) for iotjs_tlswrap_encode_data\r\n- tls encode incoming data multi times when data is larger than 16k\r\n- alloc 1m heap memroy for MqttGetPublish buffer instead of dynamic stack memory","created_at":"2018-03-19T13:33:49Z","updated_at":"2018-03-19T15:19:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ba69f2556edd70edb2963ee0d56b69d62378922","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81/commits","review_comments_url":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81/comments","review_comment_url":"https://api.github.com/repos/Rokid/ShadowNode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Rokid/ShadowNode/issues/81/comments","statuses_url":"https://api.github.com/repos/Rokid/ShadowNode/statuses/407dcde00e7f5df19507af5f86e808b264d689b7","head":{"label":"lolBig:master","ref":"master","sha":"407dcde00e7f5df19507af5f86e808b264d689b7","user":{"login":"lolBig","id":3438038,"avatar_url":"https://avatars3.githubusercontent.com/u/3438038?v=4","gravatar_id":"","url":"https://api.github.com/users/lolBig","html_url":"https://github.com/lolBig","followers_url":"https://api.github.com/users/lolBig/followers","following_url":"https://api.github.com/users/lolBig/following{/other_user}","gists_url":"https://api.github.com/users/lolBig/gists{/gist_id}","starred_url":"https://api.github.com/users/lolBig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolBig/subscriptions","organizations_url":"https://api.github.com/users/lolBig/orgs","repos_url":"https://api.github.com/users/lolBig/repos","events_url":"https://api.github.com/users/lolBig/events{/privacy}","received_events_url":"https://api.github.com/users/lolBig/received_events","type":"User","site_admin":false},"repo":{"id":125312816,"name":"ShadowNode","full_name":"lolBig/ShadowNode","owner":{"login":"lolBig","id":3438038,"avatar_url":"https://avatars3.githubusercontent.com/u/3438038?v=4","gravatar_id":"","url":"https://api.github.com/users/lolBig","html_url":"https://github.com/lolBig","followers_url":"https://api.github.com/users/lolBig/followers","following_url":"https://api.github.com/users/lolBig/following{/other_user}","gists_url":"https://api.github.com/users/lolBig/gists{/gist_id}","starred_url":"https://api.github.com/users/lolBig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolBig/subscriptions","organizations_url":"https://api.github.com/users/lolBig/orgs","repos_url":"https://api.github.com/users/lolBig/repos","events_url":"https://api.github.com/users/lolBig/events{/privacy}","received_events_url":"https://api.github.com/users/lolBig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lolBig/ShadowNode","description":"Use Node.js in your embeddable devices :)","fork":true,"url":"https://api.github.com/repos/lolBig/ShadowNode","forks_url":"https://api.github.com/repos/lolBig/ShadowNode/forks","keys_url":"https://api.github.com/repos/lolBig/ShadowNode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lolBig/ShadowNode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lolBig/ShadowNode/teams","hooks_url":"https://api.github.com/repos/lolBig/ShadowNode/hooks","issue_events_url":"https://api.github.com/repos/lolBig/ShadowNode/issues/events{/number}","events_url":"https://api.github.com/repos/lolBig/ShadowNode/events","assignees_url":"https://api.github.com/repos/lolBig/ShadowNode/assignees{/user}","branches_url":"https://api.github.com/repos/lolBig/ShadowNode/branches{/branch}","tags_url":"https://api.github.com/repos/lolBig/ShadowNode/tags","blobs_url":"https://api.github.com/repos/lolBig/ShadowNode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lolBig/ShadowNode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lolBig/ShadowNode/git/refs{/sha}","trees_url":"https://api.github.com/repos/lolBig/ShadowNode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lolBig/ShadowNode/statuses/{sha}","languages_url":"https://api.github.com/repos/lolBig/ShadowNode/languages","stargazers_url":"https://api.github.com/repos/lolBig/ShadowNode/stargazers","contributors_url":"https://api.github.com/repos/lolBig/ShadowNode/contributors","subscribers_url":"https://api.github.com/repos/lolBig/ShadowNode/subscribers","subscription_url":"https://api.github.com/repos/lolBig/ShadowNode/subscription","commits_url":"https://api.github.com/repos/lolBig/ShadowNode/commits{/sha}","git_commits_url":"https://api.github.com/repos/lolBig/ShadowNode/git/commits{/sha}","comments_url":"https://api.github.com/repos/lolBig/ShadowNode/comments{/number}","issue_comment_url":"https://api.github.com/repos/lolBig/ShadowNode/issues/comments{/number}","contents_url":"https://api.github.com/repos/lolBig/ShadowNode/contents/{+path}","compare_url":"https://api.github.com/repos/lolBig/ShadowNode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lolBig/ShadowNode/merges","archive_url":"https://api.github.com/repos/lolBig/ShadowNode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lolBig/ShadowNode/downloads","issues_url":"https://api.github.com/repos/lolBig/ShadowNode/issues{/number}","pulls_url":"https://api.github.com/repos/lolBig/ShadowNode/pulls{/number}","milestones_url":"https://api.github.com/repos/lolBig/ShadowNode/milestones{/number}","notifications_url":"https://api.github.com/repos/lolBig/ShadowNode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lolBig/ShadowNode/labels{/name}","releases_url":"https://api.github.com/repos/lolBig/ShadowNode/releases{/id}","deployments_url":"https://api.github.com/repos/lolBig/ShadowNode/deployments","created_at":"2018-03-15T04:37:30Z","updated_at":"2018-03-19T14:02:18Z","pushed_at":"2018-03-19T14:02:18Z","git_url":"git://github.com/lolBig/ShadowNode.git","ssh_url":"git@github.com:lolBig/ShadowNode.git","clone_url":"https://github.com/lolBig/ShadowNode.git","svn_url":"https://github.com/lolBig/ShadowNode","homepage":"","size":7954,"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},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Rokid:master","ref":"master","sha":"d85b4b55fdd7f58b15ca2a7f29a6727db1efd489","user":{"login":"Rokid","id":19773259,"avatar_url":"https://avatars2.githubusercontent.com/u/19773259?v=4","gravatar_id":"","url":"https://api.github.com/users/Rokid","html_url":"https://github.com/Rokid","followers_url":"https://api.github.com/users/Rokid/followers","following_url":"https://api.github.com/users/Rokid/following{/other_user}","gists_url":"https://api.github.com/users/Rokid/gists{/gist_id}","starred_url":"https://api.github.com/users/Rokid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rokid/subscriptions","organizations_url":"https://api.github.com/users/Rokid/orgs","repos_url":"https://api.github.com/users/Rokid/repos","events_url":"https://api.github.com/users/Rokid/events{/privacy}","received_events_url":"https://api.github.com/users/Rokid/received_events","type":"Organization","site_admin":false},"repo":{"id":114971968,"name":"ShadowNode","full_name":"Rokid/ShadowNode","owner":{"login":"Rokid","id":19773259,"avatar_url":"https://avatars2.githubusercontent.com/u/19773259?v=4","gravatar_id":"","url":"https://api.github.com/users/Rokid","html_url":"https://github.com/Rokid","followers_url":"https://api.github.com/users/Rokid/followers","following_url":"https://api.github.com/users/Rokid/following{/other_user}","gists_url":"https://api.github.com/users/Rokid/gists{/gist_id}","starred_url":"https://api.github.com/users/Rokid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rokid/subscriptions","organizations_url":"https://api.github.com/users/Rokid/orgs","repos_url":"https://api.github.com/users/Rokid/repos","events_url":"https://api.github.com/users/Rokid/events{/privacy}","received_events_url":"https://api.github.com/users/Rokid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Rokid/ShadowNode","description":"Use Node.js in your embeddable devices :)","fork":false,"url":"https://api.github.com/repos/Rokid/ShadowNode","forks_url":"https://api.github.com/repos/Rokid/ShadowNode/forks","keys_url":"https://api.github.com/repos/Rokid/ShadowNode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rokid/ShadowNode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rokid/ShadowNode/teams","hooks_url":"https://api.github.com/repos/Rokid/ShadowNode/hooks","issue_events_url":"https://api.github.com/repos/Rokid/ShadowNode/issues/events{/number}","events_url":"https://api.github.com/repos/Rokid/ShadowNode/events","assignees_url":"https://api.github.com/repos/Rokid/ShadowNode/assignees{/user}","branches_url":"https://api.github.com/repos/Rokid/ShadowNode/branches{/branch}","tags_url":"https://api.github.com/repos/Rokid/ShadowNode/tags","blobs_url":"https://api.github.com/repos/Rokid/ShadowNode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rokid/ShadowNode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rokid/ShadowNode/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rokid/ShadowNode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rokid/ShadowNode/statuses/{sha}","languages_url":"https://api.github.com/repos/Rokid/ShadowNode/languages","stargazers_url":"https://api.github.com/repos/Rokid/ShadowNode/stargazers","contributors_url":"https://api.github.com/repos/Rokid/ShadowNode/contributors","subscribers_url":"https://api.github.com/repos/Rokid/ShadowNode/subscribers","subscription_url":"https://api.github.com/repos/Rokid/ShadowNode/subscription","commits_url":"https://api.github.com/repos/Rokid/ShadowNode/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rokid/ShadowNode/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rokid/ShadowNode/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rokid/ShadowNode/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rokid/ShadowNode/contents/{+path}","compare_url":"https://api.github.com/repos/Rokid/ShadowNode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rokid/ShadowNode/merges","archive_url":"https://api.github.com/repos/Rokid/ShadowNode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rokid/ShadowNode/downloads","issues_url":"https://api.github.com/repos/Rokid/ShadowNode/issues{/number}","pulls_url":"https://api.github.com/repos/Rokid/ShadowNode/pulls{/number}","milestones_url":"https://api.github.com/repos/Rokid/ShadowNode/milestones{/number}","notifications_url":"https://api.github.com/repos/Rokid/ShadowNode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rokid/ShadowNode/labels{/name}","releases_url":"https://api.github.com/repos/Rokid/ShadowNode/releases{/id}","deployments_url":"https://api.github.com/repos/Rokid/ShadowNode/deployments","created_at":"2017-12-21T06:40:28Z","updated_at":"2018-03-19T07:24:10Z","pushed_at":"2018-03-19T14:02:18Z","git_url":"git://github.com/Rokid/ShadowNode.git","ssh_url":"git@github.com:Rokid/ShadowNode.git","clone_url":"https://github.com/Rokid/ShadowNode.git","svn_url":"https://github.com/Rokid/ShadowNode","homepage":"","size":7942,"stargazers_count":171,"watchers_count":171,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":12,"watchers":171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81"},"html":{"href":"https://github.com/Rokid/ShadowNode/pull/81"},"issue":{"href":"https://api.github.com/repos/Rokid/ShadowNode/issues/81"},"comments":{"href":"https://api.github.com/repos/Rokid/ShadowNode/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/Rokid/ShadowNode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Rokid/ShadowNode/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/Rokid/ShadowNode/statuses/407dcde00e7f5df19507af5f86e808b264d689b7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"yorkie"}}