{"action":"created","comment":{"url":"https://api.github.com/repos/kentonv/node-capnp/pulls/comments/25573798","id":25573798,"diff_hunk":"@@ -1775,20 +1776,26 @@ struct ConnenctionWrapper {\n };\n \n v8::Handle<v8::Value> connect(const v8::Arguments& args) {\n-  // connect(addr) -> connection\n+  // connect(addr, bootstrap) -> connection\n   //\n-  // Connect to the given address using the two-party protocol.\n+  // Connect to the given address using the two-party protocol, exporting a bootstrap capability if\n+  // given one.\n \n   KJV8_UNWRAP(CapnpContext, context, args.Data());\n   KJV8_STACK_STR(address, args[0], 64);\n \n   return liftKj([&]() -> v8::Handle<v8::Value> {\n+    kj::Maybe<capnp::Capability::Client> bootstrap =\n+        Wrapper::tryUnwrap<capnp::DynamicCapability::Client>(args[1]);\n+\n     auto promise = context.aiop->getNetwork().parseAddress(address)\n         .then([](kj::Own<kj::NetworkAddress>&& addr) {\n       return addr->connect();\n-    }).then([](kj::Own<kj::AsyncIoStream>&& stream) {\n-      return kj::refcounted<RpcConnection>(kj::mv(stream));\n-    });\n+    }).then(kj::mvCapture(bootstrap,","path":"src/node-capnp/capnp.cc","position":38,"original_position":38,"commit_id":"9475b992ab4775c8b6b69180d808c5427575f5f6","original_commit_id":"9475b992ab4775c8b6b69180d808c5427575f5f6","user":{"login":"kentonv","id":4001805,"avatar_url":"https://avatars.githubusercontent.com/u/4001805?v=3","gravatar_id":"","url":"https://api.github.com/users/kentonv","html_url":"https://github.com/kentonv","followers_url":"https://api.github.com/users/kentonv/followers","following_url":"https://api.github.com/users/kentonv/following{/other_user}","gists_url":"https://api.github.com/users/kentonv/gists{/gist_id}","starred_url":"https://api.github.com/users/kentonv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentonv/subscriptions","organizations_url":"https://api.github.com/users/kentonv/orgs","repos_url":"https://api.github.com/users/kentonv/repos","events_url":"https://api.github.com/users/kentonv/events{/privacy}","received_events_url":"https://api.github.com/users/kentonv/received_events","type":"User","site_admin":false},"body":"`kj::mv(bootstrap)` to avoid a refcount here.","created_at":"2015-03-02T00:05:46Z","updated_at":"2015-03-02T00:05:46Z","html_url":"https://github.com/kentonv/node-capnp/pull/13#discussion_r25573798","pull_request_url":"https://api.github.com/repos/kentonv/node-capnp/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/kentonv/node-capnp/pulls/comments/25573798"},"html":{"href":"https://github.com/kentonv/node-capnp/pull/13#discussion_r25573798"},"pull_request":{"href":"https://api.github.com/repos/kentonv/node-capnp/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/kentonv/node-capnp/pulls/13","id":30104663,"html_url":"https://github.com/kentonv/node-capnp/pull/13","diff_url":"https://github.com/kentonv/node-capnp/pull/13.diff","patch_url":"https://github.com/kentonv/node-capnp/pull/13.patch","issue_url":"https://api.github.com/repos/kentonv/node-capnp/issues/13","number":13,"state":"open","locked":false,"title":"Allow clients to export a bootstrap capability.","user":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-26T18:48:48Z","updated_at":"2015-03-02T00:05:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf0701554dbd451eb3639d4a39eb6d1847ab6042","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kentonv/node-capnp/pulls/13/commits","review_comments_url":"https://api.github.com/repos/kentonv/node-capnp/pulls/13/comments","review_comment_url":"https://api.github.com/repos/kentonv/node-capnp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kentonv/node-capnp/issues/13/comments","statuses_url":"https://api.github.com/repos/kentonv/node-capnp/statuses/9475b992ab4775c8b6b69180d808c5427575f5f6","head":{"label":"dwrensha:export-bootstrap","ref":"export-bootstrap","sha":"9475b992ab4775c8b6b69180d808c5427575f5f6","user":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"repo":{"id":22988171,"name":"node-capnp","full_name":"dwrensha/node-capnp","owner":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dwrensha/node-capnp","description":"Cap'n Proto bindings for Node.js","fork":true,"url":"https://api.github.com/repos/dwrensha/node-capnp","forks_url":"https://api.github.com/repos/dwrensha/node-capnp/forks","keys_url":"https://api.github.com/repos/dwrensha/node-capnp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dwrensha/node-capnp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dwrensha/node-capnp/teams","hooks_url":"https://api.github.com/repos/dwrensha/node-capnp/hooks","issue_events_url":"https://api.github.com/repos/dwrensha/node-capnp/issues/events{/number}","events_url":"https://api.github.com/repos/dwrensha/node-capnp/events","assignees_url":"https://api.github.com/repos/dwrensha/node-capnp/assignees{/user}","branches_url":"https://api.github.com/repos/dwrensha/node-capnp/branches{/branch}","tags_url":"https://api.github.com/repos/dwrensha/node-capnp/tags","blobs_url":"https://api.github.com/repos/dwrensha/node-capnp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dwrensha/node-capnp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dwrensha/node-capnp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dwrensha/node-capnp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dwrensha/node-capnp/statuses/{sha}","languages_url":"https://api.github.com/repos/dwrensha/node-capnp/languages","stargazers_url":"https://api.github.com/repos/dwrensha/node-capnp/stargazers","contributors_url":"https://api.github.com/repos/dwrensha/node-capnp/contributors","subscribers_url":"https://api.github.com/repos/dwrensha/node-capnp/subscribers","subscription_url":"https://api.github.com/repos/dwrensha/node-capnp/subscription","commits_url":"https://api.github.com/repos/dwrensha/node-capnp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dwrensha/node-capnp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dwrensha/node-capnp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dwrensha/node-capnp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dwrensha/node-capnp/contents/{+path}","compare_url":"https://api.github.com/repos/dwrensha/node-capnp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dwrensha/node-capnp/merges","archive_url":"https://api.github.com/repos/dwrensha/node-capnp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dwrensha/node-capnp/downloads","issues_url":"https://api.github.com/repos/dwrensha/node-capnp/issues{/number}","pulls_url":"https://api.github.com/repos/dwrensha/node-capnp/pulls{/number}","milestones_url":"https://api.github.com/repos/dwrensha/node-capnp/milestones{/number}","notifications_url":"https://api.github.com/repos/dwrensha/node-capnp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dwrensha/node-capnp/labels{/name}","releases_url":"https://api.github.com/repos/dwrensha/node-capnp/releases{/id}","created_at":"2014-08-15T11:55:35Z","updated_at":"2015-02-23T22:15:59Z","pushed_at":"2015-02-26T18:38:44Z","git_url":"git://github.com/dwrensha/node-capnp.git","ssh_url":"git@github.com:dwrensha/node-capnp.git","clone_url":"https://github.com/dwrensha/node-capnp.git","svn_url":"https://github.com/dwrensha/node-capnp","homepage":null,"size":286,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"kentonv:master","ref":"master","sha":"00dd6bb16c6c9cbff08fb25bca24b6c62436bd7e","user":{"login":"kentonv","id":4001805,"avatar_url":"https://avatars.githubusercontent.com/u/4001805?v=3","gravatar_id":"","url":"https://api.github.com/users/kentonv","html_url":"https://github.com/kentonv","followers_url":"https://api.github.com/users/kentonv/followers","following_url":"https://api.github.com/users/kentonv/following{/other_user}","gists_url":"https://api.github.com/users/kentonv/gists{/gist_id}","starred_url":"https://api.github.com/users/kentonv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentonv/subscriptions","organizations_url":"https://api.github.com/users/kentonv/orgs","repos_url":"https://api.github.com/users/kentonv/repos","events_url":"https://api.github.com/users/kentonv/events{/privacy}","received_events_url":"https://api.github.com/users/kentonv/received_events","type":"User","site_admin":false},"repo":{"id":18393245,"name":"node-capnp","full_name":"kentonv/node-capnp","owner":{"login":"kentonv","id":4001805,"avatar_url":"https://avatars.githubusercontent.com/u/4001805?v=3","gravatar_id":"","url":"https://api.github.com/users/kentonv","html_url":"https://github.com/kentonv","followers_url":"https://api.github.com/users/kentonv/followers","following_url":"https://api.github.com/users/kentonv/following{/other_user}","gists_url":"https://api.github.com/users/kentonv/gists{/gist_id}","starred_url":"https://api.github.com/users/kentonv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentonv/subscriptions","organizations_url":"https://api.github.com/users/kentonv/orgs","repos_url":"https://api.github.com/users/kentonv/repos","events_url":"https://api.github.com/users/kentonv/events{/privacy}","received_events_url":"https://api.github.com/users/kentonv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kentonv/node-capnp","description":"Cap'n Proto bindings for Node.js","fork":false,"url":"https://api.github.com/repos/kentonv/node-capnp","forks_url":"https://api.github.com/repos/kentonv/node-capnp/forks","keys_url":"https://api.github.com/repos/kentonv/node-capnp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kentonv/node-capnp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kentonv/node-capnp/teams","hooks_url":"https://api.github.com/repos/kentonv/node-capnp/hooks","issue_events_url":"https://api.github.com/repos/kentonv/node-capnp/issues/events{/number}","events_url":"https://api.github.com/repos/kentonv/node-capnp/events","assignees_url":"https://api.github.com/repos/kentonv/node-capnp/assignees{/user}","branches_url":"https://api.github.com/repos/kentonv/node-capnp/branches{/branch}","tags_url":"https://api.github.com/repos/kentonv/node-capnp/tags","blobs_url":"https://api.github.com/repos/kentonv/node-capnp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kentonv/node-capnp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kentonv/node-capnp/git/refs{/sha}","trees_url":"https://api.github.com/repos/kentonv/node-capnp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kentonv/node-capnp/statuses/{sha}","languages_url":"https://api.github.com/repos/kentonv/node-capnp/languages","stargazers_url":"https://api.github.com/repos/kentonv/node-capnp/stargazers","contributors_url":"https://api.github.com/repos/kentonv/node-capnp/contributors","subscribers_url":"https://api.github.com/repos/kentonv/node-capnp/subscribers","subscription_url":"https://api.github.com/repos/kentonv/node-capnp/subscription","commits_url":"https://api.github.com/repos/kentonv/node-capnp/commits{/sha}","git_commits_url":"https://api.github.com/repos/kentonv/node-capnp/git/commits{/sha}","comments_url":"https://api.github.com/repos/kentonv/node-capnp/comments{/number}","issue_comment_url":"https://api.github.com/repos/kentonv/node-capnp/issues/comments{/number}","contents_url":"https://api.github.com/repos/kentonv/node-capnp/contents/{+path}","compare_url":"https://api.github.com/repos/kentonv/node-capnp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kentonv/node-capnp/merges","archive_url":"https://api.github.com/repos/kentonv/node-capnp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kentonv/node-capnp/downloads","issues_url":"https://api.github.com/repos/kentonv/node-capnp/issues{/number}","pulls_url":"https://api.github.com/repos/kentonv/node-capnp/pulls{/number}","milestones_url":"https://api.github.com/repos/kentonv/node-capnp/milestones{/number}","notifications_url":"https://api.github.com/repos/kentonv/node-capnp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kentonv/node-capnp/labels{/name}","releases_url":"https://api.github.com/repos/kentonv/node-capnp/releases{/id}","created_at":"2014-04-03T06:20:16Z","updated_at":"2015-03-01T23:48:29Z","pushed_at":"2015-03-01T23:48:29Z","git_url":"git://github.com/kentonv/node-capnp.git","ssh_url":"git@github.com:kentonv/node-capnp.git","clone_url":"https://github.com/kentonv/node-capnp.git","svn_url":"https://github.com/kentonv/node-capnp","homepage":null,"size":443,"stargazers_count":42,"watchers_count":42,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kentonv/node-capnp/pulls/13"},"html":{"href":"https://github.com/kentonv/node-capnp/pull/13"},"issue":{"href":"https://api.github.com/repos/kentonv/node-capnp/issues/13"},"comments":{"href":"https://api.github.com/repos/kentonv/node-capnp/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/kentonv/node-capnp/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/kentonv/node-capnp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kentonv/node-capnp/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/kentonv/node-capnp/statuses/9475b992ab4775c8b6b69180d808c5427575f5f6"}}}}