{"action":"created","comment":{"url":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/comments/239477853","pull_request_review_id":182270871,"id":239477853,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTQ3Nzg1Mw==","diff_hunk":"@@ -0,0 +1,393 @@\n+module U = Unix\n+open Core\n+open Async\n+\n+let error_msgf fmt = Format.ksprintf (fun s -> Error (`Msg s)) fmt\n+\n+[@@@warning \"-32\"]\n+\n+(* This really belongs just about anywhere else: generic unix name resolution. *)\n+let resolve host service =\n+  let tcp = U.getprotobyname \"tcp\" in\n+  match U.getaddrinfo host service [U.AI_PROTOCOL tcp.p_proto] with\n+  | [] -> return (error_msgf \"No address for %s:%s\" host service)\n+  | ai :: _ -> return (Ok ai.ai_addr)\n+\n+let gettimeofday = Unix.gettimeofday\n+\n+module Async_cstruct = struct\n+  (* XXX(dinosaure): this module generate from a socket:\n+     - a safe reader and a safe writer without exception leaks\n+     - non-blocking reader/writer iff socket handles it\n+     - semantically, writer writes entirely the buffer (it returns unit)\n+     - semantically, reader informs if socket is close ([`Eof]) or not *)\n+\n+  let protect ~name ~f socket a =\n+    Monitor.try_with ~name (fun () ->\n+        f a\n+        >>= fun res ->\n+        match Socket.getopt socket Socket.Opt.error with\n+        (* XXX(dinosaure): see [sockopt.c], return 0 if nothing. *)\n+        | 0 -> return (Ok res)\n+        | errno ->\n+            return\n+              (Error (U.Unix_error (Unix.Error.of_system_int ~errno, name, \"\")))\n+    )\n+    >>= function Ok res -> return res | Error exn -> return (Error exn)\n+\n+  let bad_fd () = assert false","path":"async/lib/tls_async.ml","position":38,"original_position":38,"commit_id":"4f30d6e314318d2ee2a84be7e955d34020cf5ec5","original_commit_id":"4f30d6e314318d2ee2a84be7e955d34020cf5ec5","user":{"login":"seliopou","id":25269,"node_id":"MDQ6VXNlcjI1MjY5","avatar_url":"https://avatars1.githubusercontent.com/u/25269?v=4","gravatar_id":"","url":"https://api.github.com/users/seliopou","html_url":"https://github.com/seliopou","followers_url":"https://api.github.com/users/seliopou/followers","following_url":"https://api.github.com/users/seliopou/following{/other_user}","gists_url":"https://api.github.com/users/seliopou/gists{/gist_id}","starred_url":"https://api.github.com/users/seliopou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seliopou/subscriptions","organizations_url":"https://api.github.com/users/seliopou/orgs","repos_url":"https://api.github.com/users/seliopou/repos","events_url":"https://api.github.com/users/seliopou/events{/privacy}","received_events_url":"https://api.github.com/users/seliopou/received_events","type":"User","site_admin":false},"body":"This should be an informative error message.","created_at":"2018-12-06T14:42:51Z","updated_at":"2018-12-06T14:42:51Z","html_url":"https://github.com/janestreet/ocaml-tls/pull/1#discussion_r239477853","pull_request_url":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/comments/239477853"},"html":{"href":"https://github.com/janestreet/ocaml-tls/pull/1#discussion_r239477853"},"pull_request":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1","id":211759986,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNzU5OTg2","html_url":"https://github.com/janestreet/ocaml-tls/pull/1","diff_url":"https://github.com/janestreet/ocaml-tls/pull/1.diff","patch_url":"https://github.com/janestreet/ocaml-tls/pull/1.patch","issue_url":"https://api.github.com/repos/janestreet/ocaml-tls/issues/1","number":1,"state":"open","locked":false,"title":"Async support","user":{"login":"dinosaure","id":321910,"node_id":"MDQ6VXNlcjMyMTkxMA==","avatar_url":"https://avatars2.githubusercontent.com/u/321910?v=4","gravatar_id":"","url":"https://api.github.com/users/dinosaure","html_url":"https://github.com/dinosaure","followers_url":"https://api.github.com/users/dinosaure/followers","following_url":"https://api.github.com/users/dinosaure/following{/other_user}","gists_url":"https://api.github.com/users/dinosaure/gists{/gist_id}","starred_url":"https://api.github.com/users/dinosaure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinosaure/subscriptions","organizations_url":"https://api.github.com/users/dinosaure/orgs","repos_url":"https://api.github.com/users/dinosaure/repos","events_url":"https://api.github.com/users/dinosaure/events{/privacy}","received_events_url":"https://api.github.com/users/dinosaure/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-29T13:48:02Z","updated_at":"2018-12-06T14:42:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"043fe3152f4d9fb4374bd69b069daa480eef40b2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1/commits","review_comments_url":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1/comments","review_comment_url":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/comments{/number}","comments_url":"https://api.github.com/repos/janestreet/ocaml-tls/issues/1/comments","statuses_url":"https://api.github.com/repos/janestreet/ocaml-tls/statuses/4f30d6e314318d2ee2a84be7e955d34020cf5ec5","head":{"label":"dinosaure:async","ref":"async","sha":"4f30d6e314318d2ee2a84be7e955d34020cf5ec5","user":{"login":"dinosaure","id":321910,"node_id":"MDQ6VXNlcjMyMTkxMA==","avatar_url":"https://avatars2.githubusercontent.com/u/321910?v=4","gravatar_id":"","url":"https://api.github.com/users/dinosaure","html_url":"https://github.com/dinosaure","followers_url":"https://api.github.com/users/dinosaure/followers","following_url":"https://api.github.com/users/dinosaure/following{/other_user}","gists_url":"https://api.github.com/users/dinosaure/gists{/gist_id}","starred_url":"https://api.github.com/users/dinosaure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinosaure/subscriptions","organizations_url":"https://api.github.com/users/dinosaure/orgs","repos_url":"https://api.github.com/users/dinosaure/repos","events_url":"https://api.github.com/users/dinosaure/events{/privacy}","received_events_url":"https://api.github.com/users/dinosaure/received_events","type":"User","site_admin":false},"repo":{"id":139442081,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk0NDIwODE=","name":"ocaml-tls","full_name":"dinosaure/ocaml-tls","private":false,"owner":{"login":"dinosaure","id":321910,"node_id":"MDQ6VXNlcjMyMTkxMA==","avatar_url":"https://avatars2.githubusercontent.com/u/321910?v=4","gravatar_id":"","url":"https://api.github.com/users/dinosaure","html_url":"https://github.com/dinosaure","followers_url":"https://api.github.com/users/dinosaure/followers","following_url":"https://api.github.com/users/dinosaure/following{/other_user}","gists_url":"https://api.github.com/users/dinosaure/gists{/gist_id}","starred_url":"https://api.github.com/users/dinosaure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinosaure/subscriptions","organizations_url":"https://api.github.com/users/dinosaure/orgs","repos_url":"https://api.github.com/users/dinosaure/repos","events_url":"https://api.github.com/users/dinosaure/events{/privacy}","received_events_url":"https://api.github.com/users/dinosaure/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dinosaure/ocaml-tls","description":"TLS in pure OCaml","fork":true,"url":"https://api.github.com/repos/dinosaure/ocaml-tls","forks_url":"https://api.github.com/repos/dinosaure/ocaml-tls/forks","keys_url":"https://api.github.com/repos/dinosaure/ocaml-tls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dinosaure/ocaml-tls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dinosaure/ocaml-tls/teams","hooks_url":"https://api.github.com/repos/dinosaure/ocaml-tls/hooks","issue_events_url":"https://api.github.com/repos/dinosaure/ocaml-tls/issues/events{/number}","events_url":"https://api.github.com/repos/dinosaure/ocaml-tls/events","assignees_url":"https://api.github.com/repos/dinosaure/ocaml-tls/assignees{/user}","branches_url":"https://api.github.com/repos/dinosaure/ocaml-tls/branches{/branch}","tags_url":"https://api.github.com/repos/dinosaure/ocaml-tls/tags","blobs_url":"https://api.github.com/repos/dinosaure/ocaml-tls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dinosaure/ocaml-tls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dinosaure/ocaml-tls/git/refs{/sha}","trees_url":"https://api.github.com/repos/dinosaure/ocaml-tls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dinosaure/ocaml-tls/statuses/{sha}","languages_url":"https://api.github.com/repos/dinosaure/ocaml-tls/languages","stargazers_url":"https://api.github.com/repos/dinosaure/ocaml-tls/stargazers","contributors_url":"https://api.github.com/repos/dinosaure/ocaml-tls/contributors","subscribers_url":"https://api.github.com/repos/dinosaure/ocaml-tls/subscribers","subscription_url":"https://api.github.com/repos/dinosaure/ocaml-tls/subscription","commits_url":"https://api.github.com/repos/dinosaure/ocaml-tls/commits{/sha}","git_commits_url":"https://api.github.com/repos/dinosaure/ocaml-tls/git/commits{/sha}","comments_url":"https://api.github.com/repos/dinosaure/ocaml-tls/comments{/number}","issue_comment_url":"https://api.github.com/repos/dinosaure/ocaml-tls/issues/comments{/number}","contents_url":"https://api.github.com/repos/dinosaure/ocaml-tls/contents/{+path}","compare_url":"https://api.github.com/repos/dinosaure/ocaml-tls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dinosaure/ocaml-tls/merges","archive_url":"https://api.github.com/repos/dinosaure/ocaml-tls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dinosaure/ocaml-tls/downloads","issues_url":"https://api.github.com/repos/dinosaure/ocaml-tls/issues{/number}","pulls_url":"https://api.github.com/repos/dinosaure/ocaml-tls/pulls{/number}","milestones_url":"https://api.github.com/repos/dinosaure/ocaml-tls/milestones{/number}","notifications_url":"https://api.github.com/repos/dinosaure/ocaml-tls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dinosaure/ocaml-tls/labels{/name}","releases_url":"https://api.github.com/repos/dinosaure/ocaml-tls/releases{/id}","deployments_url":"https://api.github.com/repos/dinosaure/ocaml-tls/deployments","created_at":"2018-07-02T12:40:45Z","updated_at":"2018-07-02T12:40:47Z","pushed_at":"2018-10-30T12:54:41Z","git_url":"git://github.com/dinosaure/ocaml-tls.git","ssh_url":"git@github.com:dinosaure/ocaml-tls.git","clone_url":"https://github.com/dinosaure/ocaml-tls.git","svn_url":"https://github.com/dinosaure/ocaml-tls","homepage":"","size":3560,"stargazers_count":0,"watchers_count":0,"language":"OCaml","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":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"janestreet:master","ref":"master","sha":"c8247309f5b21af0d41fbe456c9abb1c4d810edc","user":{"login":"janestreet","id":3384712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODQ3MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3384712?v=4","gravatar_id":"","url":"https://api.github.com/users/janestreet","html_url":"https://github.com/janestreet","followers_url":"https://api.github.com/users/janestreet/followers","following_url":"https://api.github.com/users/janestreet/following{/other_user}","gists_url":"https://api.github.com/users/janestreet/gists{/gist_id}","starred_url":"https://api.github.com/users/janestreet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janestreet/subscriptions","organizations_url":"https://api.github.com/users/janestreet/orgs","repos_url":"https://api.github.com/users/janestreet/repos","events_url":"https://api.github.com/users/janestreet/events{/privacy}","received_events_url":"https://api.github.com/users/janestreet/received_events","type":"Organization","site_admin":false},"repo":{"id":146606335,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY2MDYzMzU=","name":"ocaml-tls","full_name":"janestreet/ocaml-tls","private":false,"owner":{"login":"janestreet","id":3384712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODQ3MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3384712?v=4","gravatar_id":"","url":"https://api.github.com/users/janestreet","html_url":"https://github.com/janestreet","followers_url":"https://api.github.com/users/janestreet/followers","following_url":"https://api.github.com/users/janestreet/following{/other_user}","gists_url":"https://api.github.com/users/janestreet/gists{/gist_id}","starred_url":"https://api.github.com/users/janestreet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janestreet/subscriptions","organizations_url":"https://api.github.com/users/janestreet/orgs","repos_url":"https://api.github.com/users/janestreet/repos","events_url":"https://api.github.com/users/janestreet/events{/privacy}","received_events_url":"https://api.github.com/users/janestreet/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/janestreet/ocaml-tls","description":"TLS in pure OCaml","fork":true,"url":"https://api.github.com/repos/janestreet/ocaml-tls","forks_url":"https://api.github.com/repos/janestreet/ocaml-tls/forks","keys_url":"https://api.github.com/repos/janestreet/ocaml-tls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janestreet/ocaml-tls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janestreet/ocaml-tls/teams","hooks_url":"https://api.github.com/repos/janestreet/ocaml-tls/hooks","issue_events_url":"https://api.github.com/repos/janestreet/ocaml-tls/issues/events{/number}","events_url":"https://api.github.com/repos/janestreet/ocaml-tls/events","assignees_url":"https://api.github.com/repos/janestreet/ocaml-tls/assignees{/user}","branches_url":"https://api.github.com/repos/janestreet/ocaml-tls/branches{/branch}","tags_url":"https://api.github.com/repos/janestreet/ocaml-tls/tags","blobs_url":"https://api.github.com/repos/janestreet/ocaml-tls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janestreet/ocaml-tls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janestreet/ocaml-tls/git/refs{/sha}","trees_url":"https://api.github.com/repos/janestreet/ocaml-tls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janestreet/ocaml-tls/statuses/{sha}","languages_url":"https://api.github.com/repos/janestreet/ocaml-tls/languages","stargazers_url":"https://api.github.com/repos/janestreet/ocaml-tls/stargazers","contributors_url":"https://api.github.com/repos/janestreet/ocaml-tls/contributors","subscribers_url":"https://api.github.com/repos/janestreet/ocaml-tls/subscribers","subscription_url":"https://api.github.com/repos/janestreet/ocaml-tls/subscription","commits_url":"https://api.github.com/repos/janestreet/ocaml-tls/commits{/sha}","git_commits_url":"https://api.github.com/repos/janestreet/ocaml-tls/git/commits{/sha}","comments_url":"https://api.github.com/repos/janestreet/ocaml-tls/comments{/number}","issue_comment_url":"https://api.github.com/repos/janestreet/ocaml-tls/issues/comments{/number}","contents_url":"https://api.github.com/repos/janestreet/ocaml-tls/contents/{+path}","compare_url":"https://api.github.com/repos/janestreet/ocaml-tls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janestreet/ocaml-tls/merges","archive_url":"https://api.github.com/repos/janestreet/ocaml-tls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janestreet/ocaml-tls/downloads","issues_url":"https://api.github.com/repos/janestreet/ocaml-tls/issues{/number}","pulls_url":"https://api.github.com/repos/janestreet/ocaml-tls/pulls{/number}","milestones_url":"https://api.github.com/repos/janestreet/ocaml-tls/milestones{/number}","notifications_url":"https://api.github.com/repos/janestreet/ocaml-tls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janestreet/ocaml-tls/labels{/name}","releases_url":"https://api.github.com/repos/janestreet/ocaml-tls/releases{/id}","deployments_url":"https://api.github.com/repos/janestreet/ocaml-tls/deployments","created_at":"2018-08-29T13:45:26Z","updated_at":"2018-08-29T13:45:29Z","pushed_at":"2018-10-30T12:54:42Z","git_url":"git://github.com/janestreet/ocaml-tls.git","ssh_url":"git@github.com:janestreet/ocaml-tls.git","clone_url":"https://github.com/janestreet/ocaml-tls.git","svn_url":"https://github.com/janestreet/ocaml-tls","homepage":"","size":3527,"stargazers_count":0,"watchers_count":0,"language":"OCaml","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":1,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1"},"html":{"href":"https://github.com/janestreet/ocaml-tls/pull/1"},"issue":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/issues/1"},"comments":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/janestreet/ocaml-tls/statuses/4f30d6e314318d2ee2a84be7e955d34020cf5ec5"}},"author_association":"NONE"}}
{"actor":{"display_login":"seliopou"}}