{"action":"created","comment":{"url":"https://api.github.com/repos/wahern/cqueues/pulls/comments/78117042","id":78117042,"diff_hunk":"@@ -2362,46 +2397,53 @@ static long bio_ctrl(BIO *bio, int cmd, long udata_i, void *udata_p) {\n } /* bio_ctrl() */\n \n static int bio_create(BIO *bio) {\n-\tbio->init = 0;\n-\tbio->shutdown = 0;\n-\tbio->num = 0;\n-\tbio->ptr = NULL;\n+\tBIO_set_init(bio, 0);\n+\tBIO_set_shutdown(bio, 0);\n+\tBIO_set_data(bio, NULL);\n \n \treturn 1;\n } /* bio_create() */\n \n static int bio_destroy(BIO *bio) {\n-\tbio->init = 0;\n-\tbio->shutdown = 0;\n-\tbio->num = 0;\n-\tbio->ptr = NULL;\n+\tBIO_set_init(bio, 0);\n+\tBIO_set_shutdown(bio, 0);\n+\tBIO_set_data(bio, NULL);\n \n \treturn 1;\n } /* bio_destroy() */\n \n-static BIO_METHOD bio_methods = {\n-\tBIO_TYPE_SOURCE_SINK,\n-\t\"struct socket*\",\n-\tbio_write,\n-\tbio_read,\n-\tbio_puts,\n-\tNULL,\n-\tbio_ctrl,\n-\tbio_create,\n-\tbio_destroy,\n-\tNULL,\n-};\n+static BIO_METHOD *bio_methods;\n \n static BIO *so_newbio(struct socket *so, int *error) {\n \tBIO *bio;\n \n-\tif (!(bio = BIO_new(&bio_methods))) {\n+\tif (bio_methods == NULL) {\n+\t\tint type = BIO_get_new_index();\n+\t\tif (type == -1) {\n+\t\t\t*error = SO_EOPENSSL;\n+\t\t\treturn NULL;\n+\t\t}\n+\t\ttype |= BIO_TYPE_SOURCE_SINK|BIO_TYPE_DESCRIPTOR;\n+\t\tbio_methods = BIO_meth_new(type, \"struct socket*\");","path":"src/lib/socket.c","position":134,"original_position":134,"commit_id":"e7679dc519f4a2c0214449920e7970e8e83852f4","original_commit_id":"e7679dc519f4a2c0214449920e7970e8e83852f4","user":{"login":"daurnimator","id":127971,"avatar_url":"https://avatars.githubusercontent.com/u/127971?v=3","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"body":"I guess I can move it into `socket_init`?\r\nThat would be threadsafe, wouldn't it?","created_at":"2016-09-09T01:26:05Z","updated_at":"2016-09-09T01:26:05Z","html_url":"https://github.com/wahern/cqueues/pull/162#discussion_r78117042","pull_request_url":"https://api.github.com/repos/wahern/cqueues/pulls/162","_links":{"self":{"href":"https://api.github.com/repos/wahern/cqueues/pulls/comments/78117042"},"html":{"href":"https://github.com/wahern/cqueues/pull/162#discussion_r78117042"},"pull_request":{"href":"https://api.github.com/repos/wahern/cqueues/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/wahern/cqueues/pulls/162","id":84119632,"html_url":"https://github.com/wahern/cqueues/pull/162","diff_url":"https://github.com/wahern/cqueues/pull/162.diff","patch_url":"https://github.com/wahern/cqueues/pull/162.patch","issue_url":"https://api.github.com/repos/wahern/cqueues/issues/162","number":162,"state":"open","locked":false,"title":"Porting work for OpenSSL 1.1.0","user":{"login":"daurnimator","id":127971,"avatar_url":"https://avatars.githubusercontent.com/u/127971?v=3","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"body":"For #160 \r\n\r\nOne issue remains: the auto-sensing of client vs server mode based on `SSL_METHOD`'s `ssl_connect` member.\r\nThis doesn't seem to have a workable solution, as the induction was incorrect in the first place: a given `SSL_CTX` can be for clients, servers, or both ==> the client/server flag should be passed out of band (as it is in luasec, see #136).","created_at":"2016-09-06T13:13:19Z","updated_at":"2016-09-09T01:26:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67267d096d7f67a71613898330506f4ab44cc072","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wahern/cqueues/pulls/162/commits","review_comments_url":"https://api.github.com/repos/wahern/cqueues/pulls/162/comments","review_comment_url":"https://api.github.com/repos/wahern/cqueues/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wahern/cqueues/issues/162/comments","statuses_url":"https://api.github.com/repos/wahern/cqueues/statuses/e7679dc519f4a2c0214449920e7970e8e83852f4","head":{"label":"daurnimator:160-openssl_1_1_0","ref":"160-openssl_1_1_0","sha":"e7679dc519f4a2c0214449920e7970e8e83852f4","user":{"login":"daurnimator","id":127971,"avatar_url":"https://avatars.githubusercontent.com/u/127971?v=3","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"repo":{"id":28144267,"name":"cqueues","full_name":"daurnimator/cqueues","owner":{"login":"daurnimator","id":127971,"avatar_url":"https://avatars.githubusercontent.com/u/127971?v=3","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daurnimator/cqueues","description":"Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.","fork":true,"url":"https://api.github.com/repos/daurnimator/cqueues","forks_url":"https://api.github.com/repos/daurnimator/cqueues/forks","keys_url":"https://api.github.com/repos/daurnimator/cqueues/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daurnimator/cqueues/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daurnimator/cqueues/teams","hooks_url":"https://api.github.com/repos/daurnimator/cqueues/hooks","issue_events_url":"https://api.github.com/repos/daurnimator/cqueues/issues/events{/number}","events_url":"https://api.github.com/repos/daurnimator/cqueues/events","assignees_url":"https://api.github.com/repos/daurnimator/cqueues/assignees{/user}","branches_url":"https://api.github.com/repos/daurnimator/cqueues/branches{/branch}","tags_url":"https://api.github.com/repos/daurnimator/cqueues/tags","blobs_url":"https://api.github.com/repos/daurnimator/cqueues/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daurnimator/cqueues/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daurnimator/cqueues/git/refs{/sha}","trees_url":"https://api.github.com/repos/daurnimator/cqueues/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daurnimator/cqueues/statuses/{sha}","languages_url":"https://api.github.com/repos/daurnimator/cqueues/languages","stargazers_url":"https://api.github.com/repos/daurnimator/cqueues/stargazers","contributors_url":"https://api.github.com/repos/daurnimator/cqueues/contributors","subscribers_url":"https://api.github.com/repos/daurnimator/cqueues/subscribers","subscription_url":"https://api.github.com/repos/daurnimator/cqueues/subscription","commits_url":"https://api.github.com/repos/daurnimator/cqueues/commits{/sha}","git_commits_url":"https://api.github.com/repos/daurnimator/cqueues/git/commits{/sha}","comments_url":"https://api.github.com/repos/daurnimator/cqueues/comments{/number}","issue_comment_url":"https://api.github.com/repos/daurnimator/cqueues/issues/comments{/number}","contents_url":"https://api.github.com/repos/daurnimator/cqueues/contents/{+path}","compare_url":"https://api.github.com/repos/daurnimator/cqueues/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daurnimator/cqueues/merges","archive_url":"https://api.github.com/repos/daurnimator/cqueues/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daurnimator/cqueues/downloads","issues_url":"https://api.github.com/repos/daurnimator/cqueues/issues{/number}","pulls_url":"https://api.github.com/repos/daurnimator/cqueues/pulls{/number}","milestones_url":"https://api.github.com/repos/daurnimator/cqueues/milestones{/number}","notifications_url":"https://api.github.com/repos/daurnimator/cqueues/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daurnimator/cqueues/labels{/name}","releases_url":"https://api.github.com/repos/daurnimator/cqueues/releases{/id}","deployments_url":"https://api.github.com/repos/daurnimator/cqueues/deployments","created_at":"2014-12-17T16:01:28Z","updated_at":"2015-03-11T22:41:51Z","pushed_at":"2016-09-06T15:05:32Z","git_url":"git://github.com/daurnimator/cqueues.git","ssh_url":"git@github.com:daurnimator/cqueues.git","clone_url":"https://github.com/daurnimator/cqueues.git","svn_url":"https://github.com/daurnimator/cqueues","homepage":"http://25thandclement.com/~william/projects/cqueues.html","size":4170,"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":"wahern:master","ref":"master","sha":"8dea1e54a7bf3b1a95a79dddbf38b2f8f97ec602","user":{"login":"wahern","id":6007976,"avatar_url":"https://avatars.githubusercontent.com/u/6007976?v=3","gravatar_id":"","url":"https://api.github.com/users/wahern","html_url":"https://github.com/wahern","followers_url":"https://api.github.com/users/wahern/followers","following_url":"https://api.github.com/users/wahern/following{/other_user}","gists_url":"https://api.github.com/users/wahern/gists{/gist_id}","starred_url":"https://api.github.com/users/wahern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wahern/subscriptions","organizations_url":"https://api.github.com/users/wahern/orgs","repos_url":"https://api.github.com/users/wahern/repos","events_url":"https://api.github.com/users/wahern/events{/privacy}","received_events_url":"https://api.github.com/users/wahern/received_events","type":"User","site_admin":false},"repo":{"id":15096127,"name":"cqueues","full_name":"wahern/cqueues","owner":{"login":"wahern","id":6007976,"avatar_url":"https://avatars.githubusercontent.com/u/6007976?v=3","gravatar_id":"","url":"https://api.github.com/users/wahern","html_url":"https://github.com/wahern","followers_url":"https://api.github.com/users/wahern/followers","following_url":"https://api.github.com/users/wahern/following{/other_user}","gists_url":"https://api.github.com/users/wahern/gists{/gist_id}","starred_url":"https://api.github.com/users/wahern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wahern/subscriptions","organizations_url":"https://api.github.com/users/wahern/orgs","repos_url":"https://api.github.com/users/wahern/repos","events_url":"https://api.github.com/users/wahern/events{/privacy}","received_events_url":"https://api.github.com/users/wahern/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wahern/cqueues","description":"Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.","fork":false,"url":"https://api.github.com/repos/wahern/cqueues","forks_url":"https://api.github.com/repos/wahern/cqueues/forks","keys_url":"https://api.github.com/repos/wahern/cqueues/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wahern/cqueues/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wahern/cqueues/teams","hooks_url":"https://api.github.com/repos/wahern/cqueues/hooks","issue_events_url":"https://api.github.com/repos/wahern/cqueues/issues/events{/number}","events_url":"https://api.github.com/repos/wahern/cqueues/events","assignees_url":"https://api.github.com/repos/wahern/cqueues/assignees{/user}","branches_url":"https://api.github.com/repos/wahern/cqueues/branches{/branch}","tags_url":"https://api.github.com/repos/wahern/cqueues/tags","blobs_url":"https://api.github.com/repos/wahern/cqueues/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wahern/cqueues/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wahern/cqueues/git/refs{/sha}","trees_url":"https://api.github.com/repos/wahern/cqueues/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wahern/cqueues/statuses/{sha}","languages_url":"https://api.github.com/repos/wahern/cqueues/languages","stargazers_url":"https://api.github.com/repos/wahern/cqueues/stargazers","contributors_url":"https://api.github.com/repos/wahern/cqueues/contributors","subscribers_url":"https://api.github.com/repos/wahern/cqueues/subscribers","subscription_url":"https://api.github.com/repos/wahern/cqueues/subscription","commits_url":"https://api.github.com/repos/wahern/cqueues/commits{/sha}","git_commits_url":"https://api.github.com/repos/wahern/cqueues/git/commits{/sha}","comments_url":"https://api.github.com/repos/wahern/cqueues/comments{/number}","issue_comment_url":"https://api.github.com/repos/wahern/cqueues/issues/comments{/number}","contents_url":"https://api.github.com/repos/wahern/cqueues/contents/{+path}","compare_url":"https://api.github.com/repos/wahern/cqueues/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wahern/cqueues/merges","archive_url":"https://api.github.com/repos/wahern/cqueues/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wahern/cqueues/downloads","issues_url":"https://api.github.com/repos/wahern/cqueues/issues{/number}","pulls_url":"https://api.github.com/repos/wahern/cqueues/pulls{/number}","milestones_url":"https://api.github.com/repos/wahern/cqueues/milestones{/number}","notifications_url":"https://api.github.com/repos/wahern/cqueues/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wahern/cqueues/labels{/name}","releases_url":"https://api.github.com/repos/wahern/cqueues/releases{/id}","deployments_url":"https://api.github.com/repos/wahern/cqueues/deployments","created_at":"2013-12-11T02:38:57Z","updated_at":"2016-09-09T00:56:17Z","pushed_at":"2016-09-08T23:09:48Z","git_url":"git://github.com/wahern/cqueues.git","ssh_url":"git@github.com:wahern/cqueues.git","clone_url":"https://github.com/wahern/cqueues.git","svn_url":"https://github.com/wahern/cqueues","homepage":"http://25thandclement.com/~william/projects/cqueues.html","size":4164,"stargazers_count":72,"watchers_count":72,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":73,"forks":11,"open_issues":73,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wahern/cqueues/pulls/162"},"html":{"href":"https://github.com/wahern/cqueues/pull/162"},"issue":{"href":"https://api.github.com/repos/wahern/cqueues/issues/162"},"comments":{"href":"https://api.github.com/repos/wahern/cqueues/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/wahern/cqueues/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/wahern/cqueues/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wahern/cqueues/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/wahern/cqueues/statuses/e7679dc519f4a2c0214449920e7970e8e83852f4"}}}}
{"actor":{"display_login":"daurnimator"}}