{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/176923717","pull_request_review_id":106713877,"id":176923717,"diff_hunk":"@@ -0,0 +1,79 @@\n+'use strict';\n+\n+const { Buffer } = require('buffer');\n+const errors = require('internal/errors');\n+const { WriteWrap } = process.binding('stream_wrap');\n+\n+const errnoException = errors.errnoException;\n+\n+function handleWriteReq(req, data, encoding) {\n+  const { handle } = req;\n+\n+  switch (encoding) {\n+    case 'buffer':\n+      return handle.writeBuffer(req, data);\n+    case 'latin1':\n+    case 'binary':\n+      return handle.writeLatin1String(req, data);\n+    case 'utf8':\n+    case 'utf-8':\n+      return handle.writeUtf8String(req, data);\n+    case 'ascii':\n+      return handle.writeAsciiString(req, data);\n+    case 'ucs2':\n+    case 'ucs-2':\n+    case 'utf16le':\n+    case 'utf-16le':\n+      return handle.writeUcs2String(req, data);\n+    default:\n+      return handle.writeBuffer(req, Buffer.from(data, encoding));\n+  }\n+}\n+\n+function createWriteWrap(handle, oncomplete) {\n+  const req = new WriteWrap();\n+\n+  req.handle = handle;\n+  req.oncomplete = oncomplete;\n+  req.async = false;\n+\n+  return req;\n+}\n+\n+function writevGeneric(self, req, data, cb) {\n+  const allBuffers = data.allBuffers;\n+  let chunks;\n+  let i;\n+  if (allBuffers) {\n+    chunks = data;\n+    for (i = 0; i < data.length; i++)\n+      data[i] = data[i].chunk;\n+  } else {\n+    chunks = new Array(data.length << 1);\n+    for (i = 0; i < data.length; i++) {\n+      const entry = data[i];","path":"lib/internal/stream_base_commons.js","position":54,"original_position":54,"commit_id":"43b912d815567fa9fcc1cd6ba0331bebbc92d07f","original_commit_id":"43b912d815567fa9fcc1cd6ba0331bebbc92d07f","user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars0.githubusercontent.com/u/52195?v=4","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"body":"can you make this a var as it was?","created_at":"2018-03-25T00:01:08Z","updated_at":"2018-03-25T00:01:56Z","html_url":"https://github.com/nodejs/node/pull/19527#discussion_r176923717","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/19527","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/176923717"},"html":{"href":"https://github.com/nodejs/node/pull/19527#discussion_r176923717"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/19527"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/19527","id":176672006,"html_url":"https://github.com/nodejs/node/pull/19527","diff_url":"https://github.com/nodejs/node/pull/19527.diff","patch_url":"https://github.com/nodejs/node/pull/19527.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/19527","number":19527,"state":"open","locked":false,"title":"Merge http2 stream & net socket","user":{"login":"aks-","id":8316625,"avatar_url":"https://avatars0.githubusercontent.com/u/8316625?v=4","gravatar_id":"","url":"https://api.github.com/users/aks-","html_url":"https://github.com/aks-","followers_url":"https://api.github.com/users/aks-/followers","following_url":"https://api.github.com/users/aks-/following{/other_user}","gists_url":"https://api.github.com/users/aks-/gists{/gist_id}","starred_url":"https://api.github.com/users/aks-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks-/subscriptions","organizations_url":"https://api.github.com/users/aks-/orgs","repos_url":"https://api.github.com/users/aks-/repos","events_url":"https://api.github.com/users/aks-/events{/privacy}","received_events_url":"https://api.github.com/users/aks-/received_events","type":"User","site_admin":false},"body":"extract out codebase which is identical in both net.js and http2/core.js into new `stream_base` object. \r\n\r\nthis should conclude https://github.com/nodejs/node/issues/19060\r\n\r\ni'm working on another pr where we can standardize the property name between net.js and http2/core.js. and refactor it further.\r\n\r\n##### Checklist\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [ ] tests and/or benchmarks are included\r\n- [ ] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)","created_at":"2018-03-22T04:21:27Z","updated_at":"2018-03-25T00:01:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2130b60bf94b36b89b68e2ca58990d74cba4734","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":281232761,"url":"https://api.github.com/repos/nodejs/node/labels/lib%20/%20src","name":"lib / src","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/19527/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/19527/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/19527/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/43b912d815567fa9fcc1cd6ba0331bebbc92d07f","head":{"label":"aks-:merge-http2-stream-net-socket","ref":"merge-http2-stream-net-socket","sha":"43b912d815567fa9fcc1cd6ba0331bebbc92d07f","user":{"login":"aks-","id":8316625,"avatar_url":"https://avatars0.githubusercontent.com/u/8316625?v=4","gravatar_id":"","url":"https://api.github.com/users/aks-","html_url":"https://github.com/aks-","followers_url":"https://api.github.com/users/aks-/followers","following_url":"https://api.github.com/users/aks-/following{/other_user}","gists_url":"https://api.github.com/users/aks-/gists{/gist_id}","starred_url":"https://api.github.com/users/aks-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks-/subscriptions","organizations_url":"https://api.github.com/users/aks-/orgs","repos_url":"https://api.github.com/users/aks-/repos","events_url":"https://api.github.com/users/aks-/events{/privacy}","received_events_url":"https://api.github.com/users/aks-/received_events","type":"User","site_admin":false},"repo":{"id":39578612,"name":"io.js","full_name":"aks-/io.js","owner":{"login":"aks-","id":8316625,"avatar_url":"https://avatars0.githubusercontent.com/u/8316625?v=4","gravatar_id":"","url":"https://api.github.com/users/aks-","html_url":"https://github.com/aks-","followers_url":"https://api.github.com/users/aks-/followers","following_url":"https://api.github.com/users/aks-/following{/other_user}","gists_url":"https://api.github.com/users/aks-/gists{/gist_id}","starred_url":"https://api.github.com/users/aks-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks-/subscriptions","organizations_url":"https://api.github.com/users/aks-/orgs","repos_url":"https://api.github.com/users/aks-/repos","events_url":"https://api.github.com/users/aks-/events{/privacy}","received_events_url":"https://api.github.com/users/aks-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aks-/io.js","description":"Future Node.js releases will be based on io.js","fork":true,"url":"https://api.github.com/repos/aks-/io.js","forks_url":"https://api.github.com/repos/aks-/io.js/forks","keys_url":"https://api.github.com/repos/aks-/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aks-/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aks-/io.js/teams","hooks_url":"https://api.github.com/repos/aks-/io.js/hooks","issue_events_url":"https://api.github.com/repos/aks-/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/aks-/io.js/events","assignees_url":"https://api.github.com/repos/aks-/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/aks-/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/aks-/io.js/tags","blobs_url":"https://api.github.com/repos/aks-/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aks-/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aks-/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/aks-/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aks-/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/aks-/io.js/languages","stargazers_url":"https://api.github.com/repos/aks-/io.js/stargazers","contributors_url":"https://api.github.com/repos/aks-/io.js/contributors","subscribers_url":"https://api.github.com/repos/aks-/io.js/subscribers","subscription_url":"https://api.github.com/repos/aks-/io.js/subscription","commits_url":"https://api.github.com/repos/aks-/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/aks-/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/aks-/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/aks-/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/aks-/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/aks-/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aks-/io.js/merges","archive_url":"https://api.github.com/repos/aks-/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aks-/io.js/downloads","issues_url":"https://api.github.com/repos/aks-/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/aks-/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/aks-/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/aks-/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aks-/io.js/labels{/name}","releases_url":"https://api.github.com/repos/aks-/io.js/releases{/id}","deployments_url":"https://api.github.com/repos/aks-/io.js/deployments","created_at":"2015-07-23T16:31:07Z","updated_at":"2015-07-23T16:31:11Z","pushed_at":"2018-03-24T17:41:59Z","git_url":"git://github.com/aks-/io.js.git","ssh_url":"git@github.com:aks-/io.js.git","clone_url":"https://github.com/aks-/io.js.git","svn_url":"https://github.com/aks-/io.js","homepage":"https://iojs.org","size":314010,"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":"nodejs:master","ref":"master","sha":"b41ed29b80ea1454132e5707a978ad2ebd6b29a2","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2018-03-24T23:32:38Z","pushed_at":"2018-03-24T22:36:17Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":358674,"stargazers_count":46784,"watchers_count":46784,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9803,"mirror_url":null,"archived":false,"open_issues_count":864,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":9803,"open_issues":864,"watchers":46784,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/19527"},"html":{"href":"https://github.com/nodejs/node/pull/19527"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/19527"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/19527/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/19527/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/19527/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/43b912d815567fa9fcc1cd6ba0331bebbc92d07f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mcollina"}}