{"action":"created","comment":{"url":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/comments/138288355","pull_request_review_id":62061370,"id":138288355,"diff_hunk":"@@ -1,130 +1,20 @@\n package conn\n \n import (\n-\t\"context\"\n-\t\"errors\"\n-\t\"net\"\n-\t\"time\"\n-\n-\tic \"github.com/libp2p/go-libp2p-crypto\"\n-\ticonn \"github.com/libp2p/go-libp2p-interface-conn\"\n-\tpeer \"github.com/libp2p/go-libp2p-peer\"\n \tsecio \"github.com/libp2p/go-libp2p-secio\"\n \ttpt \"github.com/libp2p/go-libp2p-transport\"\n-\tma \"github.com/multiformats/go-multiaddr\"\n )\n \n // secureConn wraps another Conn object with an encrypted channel.\n type secureConn struct {\n-\tinsecure iconn.Conn    // the wrapped conn\n-\tsecure   secio.Session // secure Session\n-}\n-\n-// newConn constructs a new connection\n-func newSecureConn(ctx context.Context, sk ic.PrivKey, insecure iconn.Conn) (iconn.Conn, error) {\n-\n-\tif insecure == nil {\n-\t\treturn nil, errors.New(\"insecure is nil\")\n-\t}\n-\tif insecure.LocalPeer() == \"\" {\n-\t\treturn nil, errors.New(\"insecure.LocalPeer() is nil\")\n-\t}\n-\tif sk == nil {\n-\t\treturn nil, errors.New(\"private key is nil\")\n-\t}\n-\n-\t// NewSession performs the secure handshake, which takes multiple RTT\n-\tsessgen := secio.SessionGenerator{LocalID: insecure.LocalPeer(), PrivateKey: sk}\n-\tsecure, err := sessgen.NewSession(ctx, insecure)\n-\tif err != nil {\n-\t\treturn nil, err\n-\t}\n-\n-\tconn := &secureConn{\n-\t\tinsecure: insecure,\n-\t\tsecure:   secure,\n-\t}\n-\treturn conn, nil\n-}\n-\n-func (c *secureConn) Close() error {\n-\treturn c.secure.Close()\n-}\n-\n-// ID is an identifier unique to this connection.\n-func (c *secureConn) ID() string {\n-\treturn iconn.ID(c)\n-}\n-\n-func (c *secureConn) String() string {\n-\treturn iconn.String(c, \"secureConn\")\n-}\n-\n-func (c *secureConn) LocalAddr() net.Addr {\n-\treturn c.insecure.LocalAddr()\n-}\n-\n-func (c *secureConn) RemoteAddr() net.Addr {\n-\treturn c.insecure.RemoteAddr()\n-}\n-\n-func (c *secureConn) SetDeadline(t time.Time) error {\n-\treturn c.insecure.SetDeadline(t)\n-}\n-\n-func (c *secureConn) SetReadDeadline(t time.Time) error {\n-\treturn c.insecure.SetReadDeadline(t)\n-}\n-\n-func (c *secureConn) SetWriteDeadline(t time.Time) error {\n-\treturn c.insecure.SetWriteDeadline(t)\n-}\n-\n-// LocalMultiaddr is the Multiaddr on this side\n-func (c *secureConn) LocalMultiaddr() ma.Multiaddr {\n-\treturn c.insecure.LocalMultiaddr()\n+\ttpt.DuplexConn               // the wrapped conn","path":"secure_conn.go","position":null,"original_position":86,"commit_id":"dff3ff64dda3aa213612871e14a613d7c1b49cbe","original_commit_id":"886c78a781b451f6ad1fe675f7e7b9d780f91b92","user":{"login":"marten-seemann","id":1478487,"avatar_url":"https://avatars3.githubusercontent.com/u/1478487?v=4","gravatar_id":"","url":"https://api.github.com/users/marten-seemann","html_url":"https://github.com/marten-seemann","followers_url":"https://api.github.com/users/marten-seemann/followers","following_url":"https://api.github.com/users/marten-seemann/following{/other_user}","gists_url":"https://api.github.com/users/marten-seemann/gists{/gist_id}","starred_url":"https://api.github.com/users/marten-seemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marten-seemann/subscriptions","organizations_url":"https://api.github.com/users/marten-seemann/orgs","repos_url":"https://api.github.com/users/marten-seemann/repos","events_url":"https://api.github.com/users/marten-seemann/events{/privacy}","received_events_url":"https://api.github.com/users/marten-seemann/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2017-09-12T08:54:07Z","updated_at":"2017-09-12T08:54:07Z","html_url":"https://github.com/libp2p/go-libp2p-conn/pull/9#discussion_r138288355","pull_request_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/comments/138288355"},"html":{"href":"https://github.com/libp2p/go-libp2p-conn/pull/9#discussion_r138288355"},"pull_request":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9"}},"in_reply_to_id":137677446},"pull_request":{"url":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9","id":116127203,"html_url":"https://github.com/libp2p/go-libp2p-conn/pull/9","diff_url":"https://github.com/libp2p/go-libp2p-conn/pull/9.diff","patch_url":"https://github.com/libp2p/go-libp2p-conn/pull/9.patch","issue_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/issues/9","number":9,"state":"open","locked":false,"title":"do connection setup here","user":{"login":"marten-seemann","id":1478487,"avatar_url":"https://avatars3.githubusercontent.com/u/1478487?v=4","gravatar_id":"","url":"https://api.github.com/users/marten-seemann","html_url":"https://github.com/marten-seemann","followers_url":"https://api.github.com/users/marten-seemann/followers","following_url":"https://api.github.com/users/marten-seemann/following{/other_user}","gists_url":"https://api.github.com/users/marten-seemann/gists{/gist_id}","starred_url":"https://api.github.com/users/marten-seemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marten-seemann/subscriptions","organizations_url":"https://api.github.com/users/marten-seemann/orgs","repos_url":"https://api.github.com/users/marten-seemann/repos","events_url":"https://api.github.com/users/marten-seemann/events{/privacy}","received_events_url":"https://api.github.com/users/marten-seemann/received_events","type":"User","site_admin":false},"body":"This package now sets up new connections. A go-libp2p-conn.Conn is an encrypted, stream-multiplexed connection. If the underlying tpt.Conn is a single-stream connection, it is first encrypted (using secio) and then a stream multiplexer is used to provide multistream support. If the tpt.Conn supports transport-level stream multiplexing, the secio handshake is performed on a new stream.\r\n\r\nThis PR depends on https://github.com/libp2p/go-libp2p-transport/pull/20.\r\nThere are still a couple of TODOs here, especially regarding the timeouts for dialing connections as well as the connection protector.","created_at":"2017-04-17T12:07:23Z","updated_at":"2017-09-12T08:54:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c17538576a3ab5032f6d8111afd124c1166f458e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9/commits","review_comments_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9/comments","review_comment_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/issues/9/comments","statuses_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/statuses/dff3ff64dda3aa213612871e14a613d7c1b49cbe","head":{"label":"marten-seemann:master","ref":"master","sha":"dff3ff64dda3aa213612871e14a613d7c1b49cbe","user":{"login":"marten-seemann","id":1478487,"avatar_url":"https://avatars3.githubusercontent.com/u/1478487?v=4","gravatar_id":"","url":"https://api.github.com/users/marten-seemann","html_url":"https://github.com/marten-seemann","followers_url":"https://api.github.com/users/marten-seemann/followers","following_url":"https://api.github.com/users/marten-seemann/following{/other_user}","gists_url":"https://api.github.com/users/marten-seemann/gists{/gist_id}","starred_url":"https://api.github.com/users/marten-seemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marten-seemann/subscriptions","organizations_url":"https://api.github.com/users/marten-seemann/orgs","repos_url":"https://api.github.com/users/marten-seemann/repos","events_url":"https://api.github.com/users/marten-seemann/events{/privacy}","received_events_url":"https://api.github.com/users/marten-seemann/received_events","type":"User","site_admin":false},"repo":{"id":86027763,"name":"go-libp2p-conn","full_name":"marten-seemann/go-libp2p-conn","owner":{"login":"marten-seemann","id":1478487,"avatar_url":"https://avatars3.githubusercontent.com/u/1478487?v=4","gravatar_id":"","url":"https://api.github.com/users/marten-seemann","html_url":"https://github.com/marten-seemann","followers_url":"https://api.github.com/users/marten-seemann/followers","following_url":"https://api.github.com/users/marten-seemann/following{/other_user}","gists_url":"https://api.github.com/users/marten-seemann/gists{/gist_id}","starred_url":"https://api.github.com/users/marten-seemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marten-seemann/subscriptions","organizations_url":"https://api.github.com/users/marten-seemann/orgs","repos_url":"https://api.github.com/users/marten-seemann/repos","events_url":"https://api.github.com/users/marten-seemann/events{/privacy}","received_events_url":"https://api.github.com/users/marten-seemann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marten-seemann/go-libp2p-conn","description":"A package for libp2p connections","fork":true,"url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn","forks_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/forks","keys_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/teams","hooks_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/hooks","issue_events_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/issues/events{/number}","events_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/events","assignees_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/assignees{/user}","branches_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/branches{/branch}","tags_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/tags","blobs_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/git/refs{/sha}","trees_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/statuses/{sha}","languages_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/languages","stargazers_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/stargazers","contributors_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/contributors","subscribers_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/subscribers","subscription_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/subscription","commits_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/commits{/sha}","git_commits_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/git/commits{/sha}","comments_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/comments{/number}","issue_comment_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/issues/comments{/number}","contents_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/contents/{+path}","compare_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/merges","archive_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/downloads","issues_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/issues{/number}","pulls_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/pulls{/number}","milestones_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/milestones{/number}","notifications_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/labels{/name}","releases_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/releases{/id}","deployments_url":"https://api.github.com/repos/marten-seemann/go-libp2p-conn/deployments","created_at":"2017-03-24T04:39:23Z","updated_at":"2017-03-24T04:39:25Z","pushed_at":"2017-09-12T08:47:08Z","git_url":"git://github.com/marten-seemann/go-libp2p-conn.git","ssh_url":"git@github.com:marten-seemann/go-libp2p-conn.git","clone_url":"https://github.com/marten-seemann/go-libp2p-conn.git","svn_url":"https://github.com/marten-seemann/go-libp2p-conn","homepage":null,"size":125,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"libp2p:master","ref":"master","sha":"06dd189f99a931263b1f75155996809a907b405c","user":{"login":"libp2p","id":14838238,"avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"repo":{"id":69995683,"name":"go-libp2p-conn","full_name":"libp2p/go-libp2p-conn","owner":{"login":"libp2p","id":14838238,"avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libp2p/go-libp2p-conn","description":"A package for libp2p connections","fork":false,"url":"https://api.github.com/repos/libp2p/go-libp2p-conn","forks_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/forks","keys_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/teams","hooks_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/hooks","issue_events_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/events","assignees_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/tags","blobs_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/languages","stargazers_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/stargazers","contributors_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/contributors","subscribers_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/subscribers","subscription_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/subscription","commits_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/merges","archive_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/downloads","issues_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/go-libp2p-conn/deployments","created_at":"2016-10-04T18:48:22Z","updated_at":"2017-09-10T23:47:44Z","pushed_at":"2017-09-12T08:47:09Z","git_url":"git://github.com/libp2p/go-libp2p-conn.git","ssh_url":"git@github.com:libp2p/go-libp2p-conn.git","clone_url":"https://github.com/libp2p/go-libp2p-conn.git","svn_url":"https://github.com/libp2p/go-libp2p-conn","homepage":null,"size":109,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9"},"html":{"href":"https://github.com/libp2p/go-libp2p-conn/pull/9"},"issue":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/issues/9"},"comments":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/libp2p/go-libp2p-conn/statuses/dff3ff64dda3aa213612871e14a613d7c1b49cbe"}},"author_association":"NONE"}}
{"actor":{"display_login":"marten-seemann"}}