{"action":"created","comment":{"url":"https://api.github.com/repos/haskell/network/pulls/comments/166450950","pull_request_review_id":94514946,"id":166450950,"diff_hunk":"@@ -155,9 +166,39 @@ serverAddr = \"127.0.0.1\"\n testMsg :: ByteString\n testMsg = \"This is a test message.\"\n \n+unixAddr :: String\n+unixAddr = \"/tmp/network-test\"\n+\n ------------------------------------------------------------------------\n -- Test helpers\n \n+-- | Establish a connection between client and server and then run\n+-- 'clientAct' and 'serverAct', in different threads.  Both actions\n+-- get passed a connected 'Socket', used for communicating between\n+-- client and server.  'unixTest' makes sure that the 'Socket' is\n+-- closed after the actions have run.\n+unixTest :: (Socket -> IO a) -> ((Socket, SockAddr) -> IO b) -> IO ()\n+unixTest clientAct serverAct = do\n+    test clientSetup clientAct serverSetup server\n+  where\n+    clientSetup = do\n+        sock <- socket AF_UNIX Stream defaultProtocol\n+        connect sock (SockAddrUnix unixAddr)\n+        return sock\n+\n+    serverSetup = do\n+        sock <- socket AF_UNIX Stream defaultProtocol\n+        bind sock (SockAddrUnix unixAddr)","path":"tests/SimpleSpec.hs","position":51,"original_position":51,"commit_id":"cb034d21b602bbbde8c1eddac7f54c8e11840549","original_commit_id":"cb034d21b602bbbde8c1eddac7f54c8e11840549","user":{"login":"vdukhovni","id":1107986,"avatar_url":"https://avatars2.githubusercontent.com/u/1107986?v=4","gravatar_id":"","url":"https://api.github.com/users/vdukhovni","html_url":"https://github.com/vdukhovni","followers_url":"https://api.github.com/users/vdukhovni/followers","following_url":"https://api.github.com/users/vdukhovni/following{/other_user}","gists_url":"https://api.github.com/users/vdukhovni/gists{/gist_id}","starred_url":"https://api.github.com/users/vdukhovni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdukhovni/subscriptions","organizations_url":"https://api.github.com/users/vdukhovni/orgs","repos_url":"https://api.github.com/users/vdukhovni/repos","events_url":"https://api.github.com/users/vdukhovni/events{/privacy}","received_events_url":"https://api.github.com/users/vdukhovni/received_events","type":"User","site_admin":false},"body":"Here, to make the test repeatable, before `bind` we need to `unlink` the socket path, else the bind will fail.","created_at":"2018-02-06T21:40:44Z","updated_at":"2018-02-06T21:40:44Z","html_url":"https://github.com/haskell/network/pull/305#discussion_r166450950","pull_request_url":"https://api.github.com/repos/haskell/network/pulls/305","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/haskell/network/pulls/comments/166450950"},"html":{"href":"https://github.com/haskell/network/pull/305#discussion_r166450950"},"pull_request":{"href":"https://api.github.com/repos/haskell/network/pulls/305"}}},"pull_request":{"url":"https://api.github.com/repos/haskell/network/pulls/305","id":167279528,"html_url":"https://github.com/haskell/network/pull/305","diff_url":"https://github.com/haskell/network/pull/305.diff","patch_url":"https://github.com/haskell/network/pull/305.patch","issue_url":"https://api.github.com/repos/haskell/network/issues/305","number":305,"state":"open","locked":false,"title":"Peek sockaddr for unix domain sockets according to non-null-terminating semantics","user":{"login":"JonCoens","id":714413,"avatar_url":"https://avatars1.githubusercontent.com/u/714413?v=4","gravatar_id":"","url":"https://api.github.com/users/JonCoens","html_url":"https://github.com/JonCoens","followers_url":"https://api.github.com/users/JonCoens/followers","following_url":"https://api.github.com/users/JonCoens/following{/other_user}","gists_url":"https://api.github.com/users/JonCoens/gists{/gist_id}","starred_url":"https://api.github.com/users/JonCoens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonCoens/subscriptions","organizations_url":"https://api.github.com/users/JonCoens/orgs","repos_url":"https://api.github.com/users/JonCoens/repos","events_url":"https://api.github.com/users/JonCoens/events{/privacy}","received_events_url":"https://api.github.com/users/JonCoens/received_events","type":"User","site_admin":false},"body":"On certain linux distros, the returned sockaddr for a unix domain socket isn't guaranteed to be null terminated. This implements the recommended portable method to handle potentially non-null-terminated strings in `sun_path`.\r\nSee http://man7.org/linux/man-pages/man7/unix.7.html\r\n\r\nThe previous behavior would potentially read uninitialized memory and attempt to locale decode it\r\n\r\nTest Plan: New unit test for unix domain sockets, which previously failed on centos\r\n\r\nI would like to fix this for 2.6.3, but none of my dev environments can build the 2.6 branch.","created_at":"2018-02-05T23:08:31Z","updated_at":"2018-02-06T21:40:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56c2120ee6526011e27370f9000bc0b20dd69ace","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/haskell/network/pulls/305/commits","review_comments_url":"https://api.github.com/repos/haskell/network/pulls/305/comments","review_comment_url":"https://api.github.com/repos/haskell/network/pulls/comments{/number}","comments_url":"https://api.github.com/repos/haskell/network/issues/305/comments","statuses_url":"https://api.github.com/repos/haskell/network/statuses/cb034d21b602bbbde8c1eddac7f54c8e11840549","head":{"label":"JonCoens:peekaddr","ref":"peekaddr","sha":"cb034d21b602bbbde8c1eddac7f54c8e11840549","user":{"login":"JonCoens","id":714413,"avatar_url":"https://avatars1.githubusercontent.com/u/714413?v=4","gravatar_id":"","url":"https://api.github.com/users/JonCoens","html_url":"https://github.com/JonCoens","followers_url":"https://api.github.com/users/JonCoens/followers","following_url":"https://api.github.com/users/JonCoens/following{/other_user}","gists_url":"https://api.github.com/users/JonCoens/gists{/gist_id}","starred_url":"https://api.github.com/users/JonCoens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonCoens/subscriptions","organizations_url":"https://api.github.com/users/JonCoens/orgs","repos_url":"https://api.github.com/users/JonCoens/repos","events_url":"https://api.github.com/users/JonCoens/events{/privacy}","received_events_url":"https://api.github.com/users/JonCoens/received_events","type":"User","site_admin":false},"repo":{"id":120028130,"name":"network","full_name":"JonCoens/network","owner":{"login":"JonCoens","id":714413,"avatar_url":"https://avatars1.githubusercontent.com/u/714413?v=4","gravatar_id":"","url":"https://api.github.com/users/JonCoens","html_url":"https://github.com/JonCoens","followers_url":"https://api.github.com/users/JonCoens/followers","following_url":"https://api.github.com/users/JonCoens/following{/other_user}","gists_url":"https://api.github.com/users/JonCoens/gists{/gist_id}","starred_url":"https://api.github.com/users/JonCoens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonCoens/subscriptions","organizations_url":"https://api.github.com/users/JonCoens/orgs","repos_url":"https://api.github.com/users/JonCoens/repos","events_url":"https://api.github.com/users/JonCoens/events{/privacy}","received_events_url":"https://api.github.com/users/JonCoens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JonCoens/network","description":"Low-level networking interface","fork":true,"url":"https://api.github.com/repos/JonCoens/network","forks_url":"https://api.github.com/repos/JonCoens/network/forks","keys_url":"https://api.github.com/repos/JonCoens/network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JonCoens/network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JonCoens/network/teams","hooks_url":"https://api.github.com/repos/JonCoens/network/hooks","issue_events_url":"https://api.github.com/repos/JonCoens/network/issues/events{/number}","events_url":"https://api.github.com/repos/JonCoens/network/events","assignees_url":"https://api.github.com/repos/JonCoens/network/assignees{/user}","branches_url":"https://api.github.com/repos/JonCoens/network/branches{/branch}","tags_url":"https://api.github.com/repos/JonCoens/network/tags","blobs_url":"https://api.github.com/repos/JonCoens/network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JonCoens/network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JonCoens/network/git/refs{/sha}","trees_url":"https://api.github.com/repos/JonCoens/network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JonCoens/network/statuses/{sha}","languages_url":"https://api.github.com/repos/JonCoens/network/languages","stargazers_url":"https://api.github.com/repos/JonCoens/network/stargazers","contributors_url":"https://api.github.com/repos/JonCoens/network/contributors","subscribers_url":"https://api.github.com/repos/JonCoens/network/subscribers","subscription_url":"https://api.github.com/repos/JonCoens/network/subscription","commits_url":"https://api.github.com/repos/JonCoens/network/commits{/sha}","git_commits_url":"https://api.github.com/repos/JonCoens/network/git/commits{/sha}","comments_url":"https://api.github.com/repos/JonCoens/network/comments{/number}","issue_comment_url":"https://api.github.com/repos/JonCoens/network/issues/comments{/number}","contents_url":"https://api.github.com/repos/JonCoens/network/contents/{+path}","compare_url":"https://api.github.com/repos/JonCoens/network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JonCoens/network/merges","archive_url":"https://api.github.com/repos/JonCoens/network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JonCoens/network/downloads","issues_url":"https://api.github.com/repos/JonCoens/network/issues{/number}","pulls_url":"https://api.github.com/repos/JonCoens/network/pulls{/number}","milestones_url":"https://api.github.com/repos/JonCoens/network/milestones{/number}","notifications_url":"https://api.github.com/repos/JonCoens/network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JonCoens/network/labels{/name}","releases_url":"https://api.github.com/repos/JonCoens/network/releases{/id}","deployments_url":"https://api.github.com/repos/JonCoens/network/deployments","created_at":"2018-02-02T20:31:03Z","updated_at":"2018-02-02T20:31:05Z","pushed_at":"2018-02-06T17:11:18Z","git_url":"git://github.com/JonCoens/network.git","ssh_url":"git@github.com:JonCoens/network.git","clone_url":"https://github.com/JonCoens/network.git","svn_url":"https://github.com/JonCoens/network","homepage":"","size":1343,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"haskell:master","ref":"master","sha":"b9f34639e62dc24f1f7a815a5ebf6a042d1c0340","user":{"login":"haskell","id":450574,"avatar_url":"https://avatars1.githubusercontent.com/u/450574?v=4","gravatar_id":"","url":"https://api.github.com/users/haskell","html_url":"https://github.com/haskell","followers_url":"https://api.github.com/users/haskell/followers","following_url":"https://api.github.com/users/haskell/following{/other_user}","gists_url":"https://api.github.com/users/haskell/gists{/gist_id}","starred_url":"https://api.github.com/users/haskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haskell/subscriptions","organizations_url":"https://api.github.com/users/haskell/orgs","repos_url":"https://api.github.com/users/haskell/repos","events_url":"https://api.github.com/users/haskell/events{/privacy}","received_events_url":"https://api.github.com/users/haskell/received_events","type":"Organization","site_admin":false},"repo":{"id":1030046,"name":"network","full_name":"haskell/network","owner":{"login":"haskell","id":450574,"avatar_url":"https://avatars1.githubusercontent.com/u/450574?v=4","gravatar_id":"","url":"https://api.github.com/users/haskell","html_url":"https://github.com/haskell","followers_url":"https://api.github.com/users/haskell/followers","following_url":"https://api.github.com/users/haskell/following{/other_user}","gists_url":"https://api.github.com/users/haskell/gists{/gist_id}","starred_url":"https://api.github.com/users/haskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haskell/subscriptions","organizations_url":"https://api.github.com/users/haskell/orgs","repos_url":"https://api.github.com/users/haskell/repos","events_url":"https://api.github.com/users/haskell/events{/privacy}","received_events_url":"https://api.github.com/users/haskell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/haskell/network","description":"Low-level networking interface","fork":false,"url":"https://api.github.com/repos/haskell/network","forks_url":"https://api.github.com/repos/haskell/network/forks","keys_url":"https://api.github.com/repos/haskell/network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haskell/network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haskell/network/teams","hooks_url":"https://api.github.com/repos/haskell/network/hooks","issue_events_url":"https://api.github.com/repos/haskell/network/issues/events{/number}","events_url":"https://api.github.com/repos/haskell/network/events","assignees_url":"https://api.github.com/repos/haskell/network/assignees{/user}","branches_url":"https://api.github.com/repos/haskell/network/branches{/branch}","tags_url":"https://api.github.com/repos/haskell/network/tags","blobs_url":"https://api.github.com/repos/haskell/network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haskell/network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haskell/network/git/refs{/sha}","trees_url":"https://api.github.com/repos/haskell/network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haskell/network/statuses/{sha}","languages_url":"https://api.github.com/repos/haskell/network/languages","stargazers_url":"https://api.github.com/repos/haskell/network/stargazers","contributors_url":"https://api.github.com/repos/haskell/network/contributors","subscribers_url":"https://api.github.com/repos/haskell/network/subscribers","subscription_url":"https://api.github.com/repos/haskell/network/subscription","commits_url":"https://api.github.com/repos/haskell/network/commits{/sha}","git_commits_url":"https://api.github.com/repos/haskell/network/git/commits{/sha}","comments_url":"https://api.github.com/repos/haskell/network/comments{/number}","issue_comment_url":"https://api.github.com/repos/haskell/network/issues/comments{/number}","contents_url":"https://api.github.com/repos/haskell/network/contents/{+path}","compare_url":"https://api.github.com/repos/haskell/network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haskell/network/merges","archive_url":"https://api.github.com/repos/haskell/network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haskell/network/downloads","issues_url":"https://api.github.com/repos/haskell/network/issues{/number}","pulls_url":"https://api.github.com/repos/haskell/network/pulls{/number}","milestones_url":"https://api.github.com/repos/haskell/network/milestones{/number}","notifications_url":"https://api.github.com/repos/haskell/network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haskell/network/labels{/name}","releases_url":"https://api.github.com/repos/haskell/network/releases{/id}","deployments_url":"https://api.github.com/repos/haskell/network/deployments","created_at":"2010-10-27T21:37:32Z","updated_at":"2018-02-03T13:26:51Z","pushed_at":"2018-02-06T17:11:19Z","git_url":"git://github.com/haskell/network.git","ssh_url":"git@github.com:haskell/network.git","clone_url":"https://github.com/haskell/network.git","svn_url":"https://github.com/haskell/network","homepage":"","size":1335,"stargazers_count":152,"watchers_count":152,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":113,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":113,"open_issues":17,"watchers":152,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/haskell/network/pulls/305"},"html":{"href":"https://github.com/haskell/network/pull/305"},"issue":{"href":"https://api.github.com/repos/haskell/network/issues/305"},"comments":{"href":"https://api.github.com/repos/haskell/network/issues/305/comments"},"review_comments":{"href":"https://api.github.com/repos/haskell/network/pulls/305/comments"},"review_comment":{"href":"https://api.github.com/repos/haskell/network/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/haskell/network/pulls/305/commits"},"statuses":{"href":"https://api.github.com/repos/haskell/network/statuses/cb034d21b602bbbde8c1eddac7f54c8e11840549"}},"author_association":"NONE"}}
{"actor":{"display_login":"vdukhovni"}}