{"action":"created","comment":{"url":"https://api.github.com/repos/soyfestivo/socialite/pulls/comments/174340870","pull_request_review_id":103678242,"id":174340870,"diff_hunk":"@@ -0,0 +1,286 @@\n+#include <iostream>\n+#include <stdlib.h>\n+#include <sys/socket.h>\n+#include <arpa/inet.h>\n+#include <sys/stat.h>\n+#include <sys/types.h>\n+#include <netinet/in.h>\n+#include <unistd.h>\n+#include <cstring>\n+#include <regex>\n+#include <fstream>\n+\n+#include <openssl/ssl.h>\n+#include <openssl/err.h>\n+\n+#include \"server.h\"\n+\n+using std::cout;\n+using std::string;\n+using std::regex;\n+using std::smatch;\n+using std::stoi;\n+using Socialite::NetStream;\n+\n+struct connection_thread_h {\n+\tSocialite::Server* server;\n+\tNetStream* stream;\n+};\n+\n+// implied SSL given cert and key file paths\n+Socialite::Server::Server(int portNumber, string cert, string key, int maxThreads, int flags) {\n+\tstreamPolicy = std::pair<string, int>(\"none\", 0);\n+\tthreads = new Juggler::ThreadManager(maxThreads + 1); // +1 for listening thread\n+\tmainLoopThreadId = -1;\n+\tsetupError = false;\n+\tif(flags & S_ONE_THREAD_ONLY) {\n+\t\tthreadPerConnection = true;\n+\t}\n+\telse {\n+\t\tthreadPerConnection = false;\n+\t}\n+\tport = portNumber;\n+\trunningSSL = true;\n+\twaitingCount = 4;\n+\n+\tif(!setupSSL(cert, key)) {\n+\t\tsetupError = true;\n+\t\tprintf(\"ERROR: setupSSL\\n\");","path":"lib/server.cpp","position":48,"original_position":48,"commit_id":"e29ec2bd13b38c7454a18ad93417205a72ea4b48","original_commit_id":"e29ec2bd13b38c7454a18ad93417205a72ea4b48","user":{"login":"soyfestivo","id":1487328,"avatar_url":"https://avatars3.githubusercontent.com/u/1487328?v=4","gravatar_id":"","url":"https://api.github.com/users/soyfestivo","html_url":"https://github.com/soyfestivo","followers_url":"https://api.github.com/users/soyfestivo/followers","following_url":"https://api.github.com/users/soyfestivo/following{/other_user}","gists_url":"https://api.github.com/users/soyfestivo/gists{/gist_id}","starred_url":"https://api.github.com/users/soyfestivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyfestivo/subscriptions","organizations_url":"https://api.github.com/users/soyfestivo/orgs","repos_url":"https://api.github.com/users/soyfestivo/repos","events_url":"https://api.github.com/users/soyfestivo/events{/privacy}","received_events_url":"https://api.github.com/users/soyfestivo/received_events","type":"User","site_admin":false},"body":"It'd be great to `throw` and error rather than just printing it","created_at":"2018-03-14T02:51:27Z","updated_at":"2018-03-14T02:51:27Z","html_url":"https://github.com/soyfestivo/socialite/pull/2#discussion_r174340870","pull_request_url":"https://api.github.com/repos/soyfestivo/socialite/pulls/2","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/soyfestivo/socialite/pulls/comments/174340870"},"html":{"href":"https://github.com/soyfestivo/socialite/pull/2#discussion_r174340870"},"pull_request":{"href":"https://api.github.com/repos/soyfestivo/socialite/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/soyfestivo/socialite/pulls/2","id":174840756,"html_url":"https://github.com/soyfestivo/socialite/pull/2","diff_url":"https://github.com/soyfestivo/socialite/pull/2.diff","patch_url":"https://github.com/soyfestivo/socialite/pull/2.patch","issue_url":"https://api.github.com/repos/soyfestivo/socialite/issues/2","number":2,"state":"open","locked":false,"title":"Add web server","user":{"login":"soyfestivo","id":1487328,"avatar_url":"https://avatars3.githubusercontent.com/u/1487328?v=4","gravatar_id":"","url":"https://api.github.com/users/soyfestivo","html_url":"https://github.com/soyfestivo","followers_url":"https://api.github.com/users/soyfestivo/followers","following_url":"https://api.github.com/users/soyfestivo/following{/other_user}","gists_url":"https://api.github.com/users/soyfestivo/gists{/gist_id}","starred_url":"https://api.github.com/users/soyfestivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyfestivo/subscriptions","organizations_url":"https://api.github.com/users/soyfestivo/orgs","repos_url":"https://api.github.com/users/soyfestivo/repos","events_url":"https://api.github.com/users/soyfestivo/events{/privacy}","received_events_url":"https://api.github.com/users/soyfestivo/received_events","type":"User","site_admin":false},"body":"1. Add in the `Socialite::Server` and `Socialite::Web::Server` classes","created_at":"2018-03-14T02:45:04Z","updated_at":"2018-03-14T02:51:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"516e2fbda394b5009c4eeed339ec768def5bf578","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/soyfestivo/socialite/pulls/2/commits","review_comments_url":"https://api.github.com/repos/soyfestivo/socialite/pulls/2/comments","review_comment_url":"https://api.github.com/repos/soyfestivo/socialite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/soyfestivo/socialite/issues/2/comments","statuses_url":"https://api.github.com/repos/soyfestivo/socialite/statuses/e29ec2bd13b38c7454a18ad93417205a72ea4b48","head":{"label":"soyfestivo:add_web_server","ref":"add_web_server","sha":"e29ec2bd13b38c7454a18ad93417205a72ea4b48","user":{"login":"soyfestivo","id":1487328,"avatar_url":"https://avatars3.githubusercontent.com/u/1487328?v=4","gravatar_id":"","url":"https://api.github.com/users/soyfestivo","html_url":"https://github.com/soyfestivo","followers_url":"https://api.github.com/users/soyfestivo/followers","following_url":"https://api.github.com/users/soyfestivo/following{/other_user}","gists_url":"https://api.github.com/users/soyfestivo/gists{/gist_id}","starred_url":"https://api.github.com/users/soyfestivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyfestivo/subscriptions","organizations_url":"https://api.github.com/users/soyfestivo/orgs","repos_url":"https://api.github.com/users/soyfestivo/repos","events_url":"https://api.github.com/users/soyfestivo/events{/privacy}","received_events_url":"https://api.github.com/users/soyfestivo/received_events","type":"User","site_admin":false},"repo":{"id":124488797,"name":"socialite","full_name":"soyfestivo/socialite","owner":{"login":"soyfestivo","id":1487328,"avatar_url":"https://avatars3.githubusercontent.com/u/1487328?v=4","gravatar_id":"","url":"https://api.github.com/users/soyfestivo","html_url":"https://github.com/soyfestivo","followers_url":"https://api.github.com/users/soyfestivo/followers","following_url":"https://api.github.com/users/soyfestivo/following{/other_user}","gists_url":"https://api.github.com/users/soyfestivo/gists{/gist_id}","starred_url":"https://api.github.com/users/soyfestivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyfestivo/subscriptions","organizations_url":"https://api.github.com/users/soyfestivo/orgs","repos_url":"https://api.github.com/users/soyfestivo/repos","events_url":"https://api.github.com/users/soyfestivo/events{/privacy}","received_events_url":"https://api.github.com/users/soyfestivo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soyfestivo/socialite","description":"Useful networking classes in C++","fork":false,"url":"https://api.github.com/repos/soyfestivo/socialite","forks_url":"https://api.github.com/repos/soyfestivo/socialite/forks","keys_url":"https://api.github.com/repos/soyfestivo/socialite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soyfestivo/socialite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soyfestivo/socialite/teams","hooks_url":"https://api.github.com/repos/soyfestivo/socialite/hooks","issue_events_url":"https://api.github.com/repos/soyfestivo/socialite/issues/events{/number}","events_url":"https://api.github.com/repos/soyfestivo/socialite/events","assignees_url":"https://api.github.com/repos/soyfestivo/socialite/assignees{/user}","branches_url":"https://api.github.com/repos/soyfestivo/socialite/branches{/branch}","tags_url":"https://api.github.com/repos/soyfestivo/socialite/tags","blobs_url":"https://api.github.com/repos/soyfestivo/socialite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soyfestivo/socialite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soyfestivo/socialite/git/refs{/sha}","trees_url":"https://api.github.com/repos/soyfestivo/socialite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soyfestivo/socialite/statuses/{sha}","languages_url":"https://api.github.com/repos/soyfestivo/socialite/languages","stargazers_url":"https://api.github.com/repos/soyfestivo/socialite/stargazers","contributors_url":"https://api.github.com/repos/soyfestivo/socialite/contributors","subscribers_url":"https://api.github.com/repos/soyfestivo/socialite/subscribers","subscription_url":"https://api.github.com/repos/soyfestivo/socialite/subscription","commits_url":"https://api.github.com/repos/soyfestivo/socialite/commits{/sha}","git_commits_url":"https://api.github.com/repos/soyfestivo/socialite/git/commits{/sha}","comments_url":"https://api.github.com/repos/soyfestivo/socialite/comments{/number}","issue_comment_url":"https://api.github.com/repos/soyfestivo/socialite/issues/comments{/number}","contents_url":"https://api.github.com/repos/soyfestivo/socialite/contents/{+path}","compare_url":"https://api.github.com/repos/soyfestivo/socialite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soyfestivo/socialite/merges","archive_url":"https://api.github.com/repos/soyfestivo/socialite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soyfestivo/socialite/downloads","issues_url":"https://api.github.com/repos/soyfestivo/socialite/issues{/number}","pulls_url":"https://api.github.com/repos/soyfestivo/socialite/pulls{/number}","milestones_url":"https://api.github.com/repos/soyfestivo/socialite/milestones{/number}","notifications_url":"https://api.github.com/repos/soyfestivo/socialite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soyfestivo/socialite/labels{/name}","releases_url":"https://api.github.com/repos/soyfestivo/socialite/releases{/id}","deployments_url":"https://api.github.com/repos/soyfestivo/socialite/deployments","created_at":"2018-03-09T04:44:18Z","updated_at":"2018-03-09T05:12:33Z","pushed_at":"2018-03-14T02:45:05Z","git_url":"git://github.com/soyfestivo/socialite.git","ssh_url":"git@github.com:soyfestivo/socialite.git","clone_url":"https://github.com/soyfestivo/socialite.git","svn_url":"https://github.com/soyfestivo/socialite","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"soyfestivo:master","ref":"master","sha":"95fd2c15869835717a603217244c8f7d3eec946b","user":{"login":"soyfestivo","id":1487328,"avatar_url":"https://avatars3.githubusercontent.com/u/1487328?v=4","gravatar_id":"","url":"https://api.github.com/users/soyfestivo","html_url":"https://github.com/soyfestivo","followers_url":"https://api.github.com/users/soyfestivo/followers","following_url":"https://api.github.com/users/soyfestivo/following{/other_user}","gists_url":"https://api.github.com/users/soyfestivo/gists{/gist_id}","starred_url":"https://api.github.com/users/soyfestivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyfestivo/subscriptions","organizations_url":"https://api.github.com/users/soyfestivo/orgs","repos_url":"https://api.github.com/users/soyfestivo/repos","events_url":"https://api.github.com/users/soyfestivo/events{/privacy}","received_events_url":"https://api.github.com/users/soyfestivo/received_events","type":"User","site_admin":false},"repo":{"id":124488797,"name":"socialite","full_name":"soyfestivo/socialite","owner":{"login":"soyfestivo","id":1487328,"avatar_url":"https://avatars3.githubusercontent.com/u/1487328?v=4","gravatar_id":"","url":"https://api.github.com/users/soyfestivo","html_url":"https://github.com/soyfestivo","followers_url":"https://api.github.com/users/soyfestivo/followers","following_url":"https://api.github.com/users/soyfestivo/following{/other_user}","gists_url":"https://api.github.com/users/soyfestivo/gists{/gist_id}","starred_url":"https://api.github.com/users/soyfestivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyfestivo/subscriptions","organizations_url":"https://api.github.com/users/soyfestivo/orgs","repos_url":"https://api.github.com/users/soyfestivo/repos","events_url":"https://api.github.com/users/soyfestivo/events{/privacy}","received_events_url":"https://api.github.com/users/soyfestivo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soyfestivo/socialite","description":"Useful networking classes in C++","fork":false,"url":"https://api.github.com/repos/soyfestivo/socialite","forks_url":"https://api.github.com/repos/soyfestivo/socialite/forks","keys_url":"https://api.github.com/repos/soyfestivo/socialite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soyfestivo/socialite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soyfestivo/socialite/teams","hooks_url":"https://api.github.com/repos/soyfestivo/socialite/hooks","issue_events_url":"https://api.github.com/repos/soyfestivo/socialite/issues/events{/number}","events_url":"https://api.github.com/repos/soyfestivo/socialite/events","assignees_url":"https://api.github.com/repos/soyfestivo/socialite/assignees{/user}","branches_url":"https://api.github.com/repos/soyfestivo/socialite/branches{/branch}","tags_url":"https://api.github.com/repos/soyfestivo/socialite/tags","blobs_url":"https://api.github.com/repos/soyfestivo/socialite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soyfestivo/socialite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soyfestivo/socialite/git/refs{/sha}","trees_url":"https://api.github.com/repos/soyfestivo/socialite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soyfestivo/socialite/statuses/{sha}","languages_url":"https://api.github.com/repos/soyfestivo/socialite/languages","stargazers_url":"https://api.github.com/repos/soyfestivo/socialite/stargazers","contributors_url":"https://api.github.com/repos/soyfestivo/socialite/contributors","subscribers_url":"https://api.github.com/repos/soyfestivo/socialite/subscribers","subscription_url":"https://api.github.com/repos/soyfestivo/socialite/subscription","commits_url":"https://api.github.com/repos/soyfestivo/socialite/commits{/sha}","git_commits_url":"https://api.github.com/repos/soyfestivo/socialite/git/commits{/sha}","comments_url":"https://api.github.com/repos/soyfestivo/socialite/comments{/number}","issue_comment_url":"https://api.github.com/repos/soyfestivo/socialite/issues/comments{/number}","contents_url":"https://api.github.com/repos/soyfestivo/socialite/contents/{+path}","compare_url":"https://api.github.com/repos/soyfestivo/socialite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soyfestivo/socialite/merges","archive_url":"https://api.github.com/repos/soyfestivo/socialite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soyfestivo/socialite/downloads","issues_url":"https://api.github.com/repos/soyfestivo/socialite/issues{/number}","pulls_url":"https://api.github.com/repos/soyfestivo/socialite/pulls{/number}","milestones_url":"https://api.github.com/repos/soyfestivo/socialite/milestones{/number}","notifications_url":"https://api.github.com/repos/soyfestivo/socialite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soyfestivo/socialite/labels{/name}","releases_url":"https://api.github.com/repos/soyfestivo/socialite/releases{/id}","deployments_url":"https://api.github.com/repos/soyfestivo/socialite/deployments","created_at":"2018-03-09T04:44:18Z","updated_at":"2018-03-09T05:12:33Z","pushed_at":"2018-03-14T02:45:05Z","git_url":"git://github.com/soyfestivo/socialite.git","ssh_url":"git@github.com:soyfestivo/socialite.git","clone_url":"https://github.com/soyfestivo/socialite.git","svn_url":"https://github.com/soyfestivo/socialite","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/soyfestivo/socialite/pulls/2"},"html":{"href":"https://github.com/soyfestivo/socialite/pull/2"},"issue":{"href":"https://api.github.com/repos/soyfestivo/socialite/issues/2"},"comments":{"href":"https://api.github.com/repos/soyfestivo/socialite/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/soyfestivo/socialite/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/soyfestivo/socialite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/soyfestivo/socialite/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/soyfestivo/socialite/statuses/e29ec2bd13b38c7454a18ad93417205a72ea4b48"}},"author_association":"OWNER"}}
{"actor":{"display_login":"soyfestivo"}}