{"action":"created","comment":{"url":"https://api.github.com/repos/apache/thrift/pulls/comments/45580689","id":45580689,"diff_hunk":"@@ -1105,10 +1113,17 @@ void TNonblockingServer::listenSocket(THRIFT_SOCKET s) {\n   serverSocket_ = s;\n \n   if (!port_) {\n-    sockaddr_in addr;\n-    socklen_t size = sizeof(addr);\n-    if (!getsockname(serverSocket_, reinterpret_cast<sockaddr*>(&addr), &size)) {\n-      listenPort_ = ntohs(addr.sin_port);\n+    #ifdef _WIN32\n+      struct sockaddr_storage addr;\n+      struct sockaddr_in *pAddr = (sockaddr_in *) &addr;\n+      socklen_t size = sizeof(addr);\n+    #else\n+      struct sockaddr_in addr;\n+      struct sockaddr_in *pAddr = &addr;\n+      socklen_t size = sizeof(addr);\n+    #endif","path":"lib/cpp/src/thrift/server/TNonblockingServer.cpp","position":38,"original_position":38,"commit_id":"a2d9114a88e967767096f87f3c8f02488cb4e60e","original_commit_id":"a2d9114a88e967767096f87f3c8f02488cb4e60e","user":{"login":"nsuke","id":3064114,"avatar_url":"https://avatars.githubusercontent.com/u/3064114?v=3","gravatar_id":"","url":"https://api.github.com/users/nsuke","html_url":"https://github.com/nsuke","followers_url":"https://api.github.com/users/nsuke/followers","following_url":"https://api.github.com/users/nsuke/following{/other_user}","gists_url":"https://api.github.com/users/nsuke/gists{/gist_id}","starred_url":"https://api.github.com/users/nsuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsuke/subscriptions","organizations_url":"https://api.github.com/users/nsuke/orgs","repos_url":"https://api.github.com/users/nsuke/repos","events_url":"https://api.github.com/users/nsuke/events{/privacy}","received_events_url":"https://api.github.com/users/nsuke/received_events","type":"User","site_admin":false},"body":"OK, let's do it, then.\r\nHere again, I prefer keeping your version only rather than `#ifdef` for the sake of readability over saving transitive ~100 bytes allocation, unless others disagree.\r\nWhat do you think ? Do you have any concern ?","created_at":"2015-11-23T08:44:38Z","updated_at":"2015-11-23T08:44:38Z","html_url":"https://github.com/apache/thrift/pull/628#discussion_r45580689","pull_request_url":"https://api.github.com/repos/apache/thrift/pulls/628","_links":{"self":{"href":"https://api.github.com/repos/apache/thrift/pulls/comments/45580689"},"html":{"href":"https://github.com/apache/thrift/pull/628#discussion_r45580689"},"pull_request":{"href":"https://api.github.com/repos/apache/thrift/pulls/628"}}},"pull_request":{"url":"https://api.github.com/repos/apache/thrift/pulls/628","id":46108995,"html_url":"https://github.com/apache/thrift/pull/628","diff_url":"https://github.com/apache/thrift/pull/628.diff","patch_url":"https://github.com/apache/thrift/pull/628.patch","issue_url":"https://api.github.com/repos/apache/thrift/issues/628","number":628,"state":"open","locked":false,"title":"THRIFT-3437 - Fixed MinGW-w64 build && boost/functional conflict","user":{"login":"becrux","id":1201791,"avatar_url":"https://avatars.githubusercontent.com/u/1201791?v=3","gravatar_id":"","url":"https://api.github.com/users/becrux","html_url":"https://github.com/becrux","followers_url":"https://api.github.com/users/becrux/followers","following_url":"https://api.github.com/users/becrux/following{/other_user}","gists_url":"https://api.github.com/users/becrux/gists{/gist_id}","starred_url":"https://api.github.com/users/becrux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/becrux/subscriptions","organizations_url":"https://api.github.com/users/becrux/orgs","repos_url":"https://api.github.com/users/becrux/repos","events_url":"https://api.github.com/users/becrux/events{/privacy}","received_events_url":"https://api.github.com/users/becrux/received_events","type":"User","site_admin":false},"body":"Fixed MinGW-w64 build\r\nFixed Boost - TR1 conflict","created_at":"2015-09-27T21:12:35Z","updated_at":"2015-11-23T08:44:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f7e52bec87c07c40baaab6409d32b57fb7af03c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/thrift/pulls/628/commits","review_comments_url":"https://api.github.com/repos/apache/thrift/pulls/628/comments","review_comment_url":"https://api.github.com/repos/apache/thrift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/thrift/issues/628/comments","statuses_url":"https://api.github.com/repos/apache/thrift/statuses/a2d9114a88e967767096f87f3c8f02488cb4e60e","head":{"label":"becrux:master","ref":"master","sha":"a2d9114a88e967767096f87f3c8f02488cb4e60e","user":{"login":"becrux","id":1201791,"avatar_url":"https://avatars.githubusercontent.com/u/1201791?v=3","gravatar_id":"","url":"https://api.github.com/users/becrux","html_url":"https://github.com/becrux","followers_url":"https://api.github.com/users/becrux/followers","following_url":"https://api.github.com/users/becrux/following{/other_user}","gists_url":"https://api.github.com/users/becrux/gists{/gist_id}","starred_url":"https://api.github.com/users/becrux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/becrux/subscriptions","organizations_url":"https://api.github.com/users/becrux/orgs","repos_url":"https://api.github.com/users/becrux/repos","events_url":"https://api.github.com/users/becrux/events{/privacy}","received_events_url":"https://api.github.com/users/becrux/received_events","type":"User","site_admin":false},"repo":{"id":43264129,"name":"thrift","full_name":"becrux/thrift","owner":{"login":"becrux","id":1201791,"avatar_url":"https://avatars.githubusercontent.com/u/1201791?v=3","gravatar_id":"","url":"https://api.github.com/users/becrux","html_url":"https://github.com/becrux","followers_url":"https://api.github.com/users/becrux/followers","following_url":"https://api.github.com/users/becrux/following{/other_user}","gists_url":"https://api.github.com/users/becrux/gists{/gist_id}","starred_url":"https://api.github.com/users/becrux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/becrux/subscriptions","organizations_url":"https://api.github.com/users/becrux/orgs","repos_url":"https://api.github.com/users/becrux/repos","events_url":"https://api.github.com/users/becrux/events{/privacy}","received_events_url":"https://api.github.com/users/becrux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/becrux/thrift","description":"Mirror of Apache Thrift","fork":true,"url":"https://api.github.com/repos/becrux/thrift","forks_url":"https://api.github.com/repos/becrux/thrift/forks","keys_url":"https://api.github.com/repos/becrux/thrift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/becrux/thrift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/becrux/thrift/teams","hooks_url":"https://api.github.com/repos/becrux/thrift/hooks","issue_events_url":"https://api.github.com/repos/becrux/thrift/issues/events{/number}","events_url":"https://api.github.com/repos/becrux/thrift/events","assignees_url":"https://api.github.com/repos/becrux/thrift/assignees{/user}","branches_url":"https://api.github.com/repos/becrux/thrift/branches{/branch}","tags_url":"https://api.github.com/repos/becrux/thrift/tags","blobs_url":"https://api.github.com/repos/becrux/thrift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/becrux/thrift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/becrux/thrift/git/refs{/sha}","trees_url":"https://api.github.com/repos/becrux/thrift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/becrux/thrift/statuses/{sha}","languages_url":"https://api.github.com/repos/becrux/thrift/languages","stargazers_url":"https://api.github.com/repos/becrux/thrift/stargazers","contributors_url":"https://api.github.com/repos/becrux/thrift/contributors","subscribers_url":"https://api.github.com/repos/becrux/thrift/subscribers","subscription_url":"https://api.github.com/repos/becrux/thrift/subscription","commits_url":"https://api.github.com/repos/becrux/thrift/commits{/sha}","git_commits_url":"https://api.github.com/repos/becrux/thrift/git/commits{/sha}","comments_url":"https://api.github.com/repos/becrux/thrift/comments{/number}","issue_comment_url":"https://api.github.com/repos/becrux/thrift/issues/comments{/number}","contents_url":"https://api.github.com/repos/becrux/thrift/contents/{+path}","compare_url":"https://api.github.com/repos/becrux/thrift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/becrux/thrift/merges","archive_url":"https://api.github.com/repos/becrux/thrift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/becrux/thrift/downloads","issues_url":"https://api.github.com/repos/becrux/thrift/issues{/number}","pulls_url":"https://api.github.com/repos/becrux/thrift/pulls{/number}","milestones_url":"https://api.github.com/repos/becrux/thrift/milestones{/number}","notifications_url":"https://api.github.com/repos/becrux/thrift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/becrux/thrift/labels{/name}","releases_url":"https://api.github.com/repos/becrux/thrift/releases{/id}","created_at":"2015-09-27T20:41:24Z","updated_at":"2015-09-27T20:41:32Z","pushed_at":"2015-10-02T22:05:42Z","git_url":"git://github.com/becrux/thrift.git","ssh_url":"git@github.com:becrux/thrift.git","clone_url":"https://github.com/becrux/thrift.git","svn_url":"https://github.com/becrux/thrift","homepage":"","size":13570,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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":"apache:master","ref":"master","sha":"f2c9f1b968f2b5716cf6b96b36e133cd7e07cde6","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":310611,"name":"thrift","full_name":"apache/thrift","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/thrift","description":"Mirror of Apache Thrift","fork":false,"url":"https://api.github.com/repos/apache/thrift","forks_url":"https://api.github.com/repos/apache/thrift/forks","keys_url":"https://api.github.com/repos/apache/thrift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/thrift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/thrift/teams","hooks_url":"https://api.github.com/repos/apache/thrift/hooks","issue_events_url":"https://api.github.com/repos/apache/thrift/issues/events{/number}","events_url":"https://api.github.com/repos/apache/thrift/events","assignees_url":"https://api.github.com/repos/apache/thrift/assignees{/user}","branches_url":"https://api.github.com/repos/apache/thrift/branches{/branch}","tags_url":"https://api.github.com/repos/apache/thrift/tags","blobs_url":"https://api.github.com/repos/apache/thrift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/thrift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/thrift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/thrift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/thrift/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/thrift/languages","stargazers_url":"https://api.github.com/repos/apache/thrift/stargazers","contributors_url":"https://api.github.com/repos/apache/thrift/contributors","subscribers_url":"https://api.github.com/repos/apache/thrift/subscribers","subscription_url":"https://api.github.com/repos/apache/thrift/subscription","commits_url":"https://api.github.com/repos/apache/thrift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/thrift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/thrift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/thrift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/thrift/contents/{+path}","compare_url":"https://api.github.com/repos/apache/thrift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/thrift/merges","archive_url":"https://api.github.com/repos/apache/thrift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/thrift/downloads","issues_url":"https://api.github.com/repos/apache/thrift/issues{/number}","pulls_url":"https://api.github.com/repos/apache/thrift/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/thrift/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/thrift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/thrift/labels{/name}","releases_url":"https://api.github.com/repos/apache/thrift/releases{/id}","created_at":"2009-09-18T08:00:17Z","updated_at":"2015-11-23T08:29:38Z","pushed_at":"2015-11-23T08:11:10Z","git_url":"git://github.com/apache/thrift.git","ssh_url":"git@github.com:apache/thrift.git","clone_url":"https://github.com/apache/thrift.git","svn_url":"https://github.com/apache/thrift","homepage":"","size":18081,"stargazers_count":2165,"watchers_count":2165,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1293,"mirror_url":"git://git.apache.org/thrift.git","open_issues_count":66,"forks":1293,"open_issues":66,"watchers":2165,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/thrift/pulls/628"},"html":{"href":"https://github.com/apache/thrift/pull/628"},"issue":{"href":"https://api.github.com/repos/apache/thrift/issues/628"},"comments":{"href":"https://api.github.com/repos/apache/thrift/issues/628/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/thrift/pulls/628/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/thrift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/thrift/pulls/628/commits"},"statuses":{"href":"https://api.github.com/repos/apache/thrift/statuses/a2d9114a88e967767096f87f3c8f02488cb4e60e"}}}}