{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/79329216","id":79329216,"diff_hunk":"@@ -58,23 +60,84 @@ function deflateResetDictionaryTest() {\n   let output = '';\n   const deflate = zlib.createDeflate({ dictionary: spdyDict });\n   const inflate = zlib.createInflate({ dictionary: spdyDict });\n+  inflate.setEncoding('utf-8');\n \n-  deflate.on('data', function(chunk) {\n+  // Wrapper+data for each round of input => 4 calls\n+  deflate.on('data', common.mustCall(function(chunk) {\n     if (doneReset)\n       inflate.write(chunk);\n-  });\n+  }, 4));\n \n-  inflate.on('data', function(chunk) {\n+  inflate.on('data', common.mustCall(function(chunk) {\n     output += chunk;\n-  });\n+  }));\n \n-  deflate.on('end', function() {\n+  deflate.on('end', common.mustCall(function() {\n     inflate.end();\n-  });\n+  }));\n+\n+  inflate.on('end', common.mustCall(function() {\n+    assert.strictEqual(input, output);\n+  }));\n \n-  inflate.on('end', function() {\n-    assert.equal(input, output);\n+  deflate.write(input);\n+  deflate.flush(function() {\n+    deflate.reset();\n+    doneReset = true;\n+    deflate.write(input);\n+    deflate.end();\n   });\n+}\n+\n+function rawDictionaryTest() {\n+  let output = '';\n+  const deflate = zlib.createDeflateRaw({ dictionary: spdyDict });\n+  const inflate = zlib.createInflateRaw({ dictionary: spdyDict });\n+  inflate.setEncoding('utf-8');\n+\n+  deflate.on('data', common.mustCall(function(chunk) {\n+    inflate.write(chunk);\n+  }));\n+\n+  inflate.on('data', common.mustCall(function(chunk) {\n+    output += chunk;\n+  }));\n+\n+  deflate.on('end', common.mustCall(function() {\n+    inflate.end();\n+  }));\n+\n+  inflate.on('end', common.mustCall(function() {\n+    assert.strictEqual(input, output);\n+  }));\n+\n+  deflate.write(input);\n+  deflate.end();\n+}\n+\n+function deflateRawResetDictionaryTest() {\n+  let doneReset = false;\n+  let output = '';\n+  const deflate = zlib.createDeflateRaw({ dictionary: spdyDict });\n+  const inflate = zlib.createInflateRaw({ dictionary: spdyDict });\n+  inflate.setEncoding('utf-8');\n+\n+  deflate.on('data', common.mustCall(function(chunk) {\n+    if (doneReset)\n+      inflate.write(chunk);\n+  }, 2));","path":"test/parallel/test-zlib-dictionary.js","position":null,"original_position":120,"commit_id":"f1a0bdd1752a80e9d2bd66d0574be0ee80ad24dc","original_commit_id":"bd05b5045dfa5208e1bc482871c7a72d70aaa857","user":{"login":"thusoy","id":1466123,"avatar_url":"https://avatars.githubusercontent.com/u/1466123?v=3","gravatar_id":"","url":"https://api.github.com/users/thusoy","html_url":"https://github.com/thusoy","followers_url":"https://api.github.com/users/thusoy/followers","following_url":"https://api.github.com/users/thusoy/following{/other_user}","gists_url":"https://api.github.com/users/thusoy/gists{/gist_id}","starred_url":"https://api.github.com/users/thusoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thusoy/subscriptions","organizations_url":"https://api.github.com/users/thusoy/orgs","repos_url":"https://api.github.com/users/thusoy/repos","events_url":"https://api.github.com/users/thusoy/events{/privacy}","received_events_url":"https://api.github.com/users/thusoy/received_events","type":"User","site_admin":false},"body":"Fair point, seems like a leaky implementation detail. I removed the `mustCall`s from non-assertion functions, as if the assertion passes the others are guaranteed to have run, and it will fail if the assertion isn't called.","created_at":"2016-09-19T05:23:36Z","updated_at":"2016-09-19T05:23:36Z","html_url":"https://github.com/nodejs/node/pull/8512#discussion_r79329216","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/8512","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/79329216"},"html":{"href":"https://github.com/nodejs/node/pull/8512#discussion_r79329216"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/8512"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/8512","id":84989157,"html_url":"https://github.com/nodejs/node/pull/8512","diff_url":"https://github.com/nodejs/node/pull/8512.diff","patch_url":"https://github.com/nodejs/node/pull/8512.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/8512","number":8512,"state":"open","locked":false,"title":"zlib: fix raw inflate with custom dictionary","user":{"login":"thusoy","id":1466123,"avatar_url":"https://avatars.githubusercontent.com/u/1466123?v=3","gravatar_id":"","url":"https://api.github.com/users/thusoy","html_url":"https://github.com/thusoy","followers_url":"https://api.github.com/users/thusoy/followers","following_url":"https://api.github.com/users/thusoy/following{/other_user}","gists_url":"https://api.github.com/users/thusoy/gists{/gist_id}","starred_url":"https://api.github.com/users/thusoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thusoy/subscriptions","organizations_url":"https://api.github.com/users/thusoy/orgs","repos_url":"https://api.github.com/users/thusoy/repos","events_url":"https://api.github.com/users/thusoy/events{/privacy}","received_events_url":"https://api.github.com/users/thusoy/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for your pull request. Please review below requirements.\r\n\r\nBug fixes and new features should include tests and possibly benchmarks.\r\n\r\nContributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\n<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->\r\nzlib\r\n\r\n\r\n##### Description of change\r\n<!-- Provide a description of the change below this comment. -->\r\n\r\nMoves inflateSetDictionary right after inflateInit2 when mode is\r\nINFLATERAW, since without the wrapper in appears zlib won't return\r\nZ_NEED_DICT as it would otherwise, and will thus attempt inflating\r\nwithout the dictionary, leading to an error.\r\n\r\nCloses #8507.","created_at":"2016-09-13T05:54:45Z","updated_at":"2016-09-19T05:23:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f88f8e22a481acbae944c67d587617ab9749f0cf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/8512/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/8512/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/8512/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/f1a0bdd1752a80e9d2bd66d0574be0ee80ad24dc","head":{"label":"thusoy:issue-8507","ref":"issue-8507","sha":"f1a0bdd1752a80e9d2bd66d0574be0ee80ad24dc","user":{"login":"thusoy","id":1466123,"avatar_url":"https://avatars.githubusercontent.com/u/1466123?v=3","gravatar_id":"","url":"https://api.github.com/users/thusoy","html_url":"https://github.com/thusoy","followers_url":"https://api.github.com/users/thusoy/followers","following_url":"https://api.github.com/users/thusoy/following{/other_user}","gists_url":"https://api.github.com/users/thusoy/gists{/gist_id}","starred_url":"https://api.github.com/users/thusoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thusoy/subscriptions","organizations_url":"https://api.github.com/users/thusoy/orgs","repos_url":"https://api.github.com/users/thusoy/repos","events_url":"https://api.github.com/users/thusoy/events{/privacy}","received_events_url":"https://api.github.com/users/thusoy/received_events","type":"User","site_admin":false},"repo":{"id":68078181,"name":"node","full_name":"thusoy/node","owner":{"login":"thusoy","id":1466123,"avatar_url":"https://avatars.githubusercontent.com/u/1466123?v=3","gravatar_id":"","url":"https://api.github.com/users/thusoy","html_url":"https://github.com/thusoy","followers_url":"https://api.github.com/users/thusoy/followers","following_url":"https://api.github.com/users/thusoy/following{/other_user}","gists_url":"https://api.github.com/users/thusoy/gists{/gist_id}","starred_url":"https://api.github.com/users/thusoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thusoy/subscriptions","organizations_url":"https://api.github.com/users/thusoy/orgs","repos_url":"https://api.github.com/users/thusoy/repos","events_url":"https://api.github.com/users/thusoy/events{/privacy}","received_events_url":"https://api.github.com/users/thusoy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thusoy/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/thusoy/node","forks_url":"https://api.github.com/repos/thusoy/node/forks","keys_url":"https://api.github.com/repos/thusoy/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thusoy/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thusoy/node/teams","hooks_url":"https://api.github.com/repos/thusoy/node/hooks","issue_events_url":"https://api.github.com/repos/thusoy/node/issues/events{/number}","events_url":"https://api.github.com/repos/thusoy/node/events","assignees_url":"https://api.github.com/repos/thusoy/node/assignees{/user}","branches_url":"https://api.github.com/repos/thusoy/node/branches{/branch}","tags_url":"https://api.github.com/repos/thusoy/node/tags","blobs_url":"https://api.github.com/repos/thusoy/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thusoy/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thusoy/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/thusoy/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thusoy/node/statuses/{sha}","languages_url":"https://api.github.com/repos/thusoy/node/languages","stargazers_url":"https://api.github.com/repos/thusoy/node/stargazers","contributors_url":"https://api.github.com/repos/thusoy/node/contributors","subscribers_url":"https://api.github.com/repos/thusoy/node/subscribers","subscription_url":"https://api.github.com/repos/thusoy/node/subscription","commits_url":"https://api.github.com/repos/thusoy/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/thusoy/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/thusoy/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/thusoy/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/thusoy/node/contents/{+path}","compare_url":"https://api.github.com/repos/thusoy/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thusoy/node/merges","archive_url":"https://api.github.com/repos/thusoy/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thusoy/node/downloads","issues_url":"https://api.github.com/repos/thusoy/node/issues{/number}","pulls_url":"https://api.github.com/repos/thusoy/node/pulls{/number}","milestones_url":"https://api.github.com/repos/thusoy/node/milestones{/number}","notifications_url":"https://api.github.com/repos/thusoy/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thusoy/node/labels{/name}","releases_url":"https://api.github.com/repos/thusoy/node/releases{/id}","deployments_url":"https://api.github.com/repos/thusoy/node/deployments","created_at":"2016-09-13T05:46:05Z","updated_at":"2016-09-13T05:46:25Z","pushed_at":"2016-09-19T05:22:22Z","git_url":"git://github.com/thusoy/node.git","ssh_url":"git@github.com:thusoy/node.git","clone_url":"https://github.com/thusoy/node.git","svn_url":"https://github.com/thusoy/node","homepage":"https://nodejs.org","size":227070,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"4c7688138366bc350ed0260583d457733f835828","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","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://avatars.githubusercontent.com/u/9950313?v=3","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":"2016-09-19T05:20:00Z","pushed_at":"2016-09-19T05:22:58Z","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":304797,"stargazers_count":26812,"watchers_count":26812,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4293,"mirror_url":null,"open_issues_count":845,"forks":4293,"open_issues":845,"watchers":26812,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/8512"},"html":{"href":"https://github.com/nodejs/node/pull/8512"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/8512"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/8512/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/8512/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/8512/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/f1a0bdd1752a80e9d2bd66d0574be0ee80ad24dc"}}}}
{"actor":{"display_login":"thusoy"}}