{"action":"created","comment":{"url":"https://api.github.com/repos/h2o/h2o/pulls/comments/33432231","id":33432231,"diff_hunk":"@@ -19,11 +19,58 @@\n  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n  * IN THE SOFTWARE.\n  */\n+\n+#include <stdlib.h>\n+#ifdef _WIN32\n+\n+struct iovec {\n+   char *buf;\n+   unsigned long len;\n+};\n+\n+static ssize_t\n+writev(SOCKET fd, const struct iovec *iov, int iovcnt) {\n+    DWORD sent = 0;\n+    h2o_iovec_t* psend = (h2o_iovec_t*) iov;\n+    LPWSABUF pbuf = alloca(sizeof(WSABUF) * iovcnt);\n+    int i;\n+    for (i = 0; i < iovcnt; ++i) {\n+        pbuf[i].len = psend[i].len;\n+        pbuf[i].buf = psend[i].base;\n+        sent += pbuf[i].len;\n+    }\n+    if (WSASend(fd, pbuf, iovcnt, NULL, 0, NULL, NULL) == 0)\n+        return (ssize_t) sent;\n+    return -1;\n+}\n+\n+# undef  socket_error\n+# undef  read_socket\n+# undef  close_socket\n+# undef  EINTR\n+# define EINTR        WSAEINTR\n+# undef  EWOULDBLOCK\n+# define EWOULDBLOCK  WSAEWOULDBLOCK\n+# undef  EAGAIN\n+# define EAGAIN       WSAEWOULDBLOCK\n+# undef  EINPROGRESS\n+# define EINPROGRESS  WSAEINPROGRESS\n+\n+# define socket_error WSAGetLastError()\n+# define read_socket(f, d, s) recv(f, d, s, 0)\n+# define close_socket(f) closesocket(f)","path":"lib/common/socket/evloop.c.h","position":43,"original_position":43,"commit_id":"52dbba63365a65b89f4f08569120ff8c68802b33","original_commit_id":"52dbba63365a65b89f4f08569120ff8c68802b33","user":{"login":"kazuho","id":41567,"avatar_url":"https://avatars.githubusercontent.com/u/41567?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuho","html_url":"https://github.com/kazuho","followers_url":"https://api.github.com/users/kazuho/followers","following_url":"https://api.github.com/users/kazuho/following{/other_user}","gists_url":"https://api.github.com/users/kazuho/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuho/subscriptions","organizations_url":"https://api.github.com/users/kazuho/orgs","repos_url":"https://api.github.com/users/kazuho/repos","events_url":"https://api.github.com/users/kazuho/events{/privacy}","received_events_url":"https://api.github.com/users/kazuho/received_events","type":"User","site_admin":false},"body":"Understood.\r\n\r\nIf that is the case, please rename `writev` to `writev_socket`, and add `#define writev_socket(fd, iov, iovcnt) writev((fd), (void *)(iov), iovcnt)` on the Unix-side.","created_at":"2015-06-29T03:27:57Z","updated_at":"2015-06-29T03:27:57Z","html_url":"https://github.com/h2o/h2o/pull/380#discussion_r33432231","pull_request_url":"https://api.github.com/repos/h2o/h2o/pulls/380","_links":{"self":{"href":"https://api.github.com/repos/h2o/h2o/pulls/comments/33432231"},"html":{"href":"https://github.com/h2o/h2o/pull/380#discussion_r33432231"},"pull_request":{"href":"https://api.github.com/repos/h2o/h2o/pulls/380"}}},"pull_request":{"url":"https://api.github.com/repos/h2o/h2o/pulls/380","id":38604920,"html_url":"https://github.com/h2o/h2o/pull/380","diff_url":"https://github.com/h2o/h2o/pull/380.diff","patch_url":"https://github.com/h2o/h2o/pull/380.patch","issue_url":"https://api.github.com/repos/h2o/h2o/issues/380","number":380,"state":"open","locked":false,"title":"windows (mingw-w64) support for h2o","user":{"login":"martell","id":1595499,"avatar_url":"https://avatars.githubusercontent.com/u/1595499?v=3","gravatar_id":"","url":"https://api.github.com/users/martell","html_url":"https://github.com/martell","followers_url":"https://api.github.com/users/martell/followers","following_url":"https://api.github.com/users/martell/following{/other_user}","gists_url":"https://api.github.com/users/martell/gists{/gist_id}","starred_url":"https://api.github.com/users/martell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martell/subscriptions","organizations_url":"https://api.github.com/users/martell/orgs","repos_url":"https://api.github.com/users/martell/repos","events_url":"https://api.github.com/users/martell/events{/privacy}","received_events_url":"https://api.github.com/users/martell/received_events","type":"User","site_admin":false},"body":"Hey guys,\r\n\r\nI'm not putting this up for merging.\r\nEverything compiles with mingw-w64 but it still doesn't quite run.\r\nI'm leaving this here for everyone to use, debug, test :)","created_at":"2015-06-25T23:37:01Z","updated_at":"2015-06-29T03:27:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85eb2d14adf7b7cff7bd95bf4af1f2656843b7a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/h2o/h2o/pulls/380/commits","review_comments_url":"https://api.github.com/repos/h2o/h2o/pulls/380/comments","review_comment_url":"https://api.github.com/repos/h2o/h2o/pulls/comments{/number}","comments_url":"https://api.github.com/repos/h2o/h2o/issues/380/comments","statuses_url":"https://api.github.com/repos/h2o/h2o/statuses/52dbba63365a65b89f4f08569120ff8c68802b33","head":{"label":"martell:mingw","ref":"mingw","sha":"52dbba63365a65b89f4f08569120ff8c68802b33","user":{"login":"martell","id":1595499,"avatar_url":"https://avatars.githubusercontent.com/u/1595499?v=3","gravatar_id":"","url":"https://api.github.com/users/martell","html_url":"https://github.com/martell","followers_url":"https://api.github.com/users/martell/followers","following_url":"https://api.github.com/users/martell/following{/other_user}","gists_url":"https://api.github.com/users/martell/gists{/gist_id}","starred_url":"https://api.github.com/users/martell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martell/subscriptions","organizations_url":"https://api.github.com/users/martell/orgs","repos_url":"https://api.github.com/users/martell/repos","events_url":"https://api.github.com/users/martell/events{/privacy}","received_events_url":"https://api.github.com/users/martell/received_events","type":"User","site_admin":false},"repo":{"id":27849471,"name":"h2o","full_name":"martell/h2o","owner":{"login":"martell","id":1595499,"avatar_url":"https://avatars.githubusercontent.com/u/1595499?v=3","gravatar_id":"","url":"https://api.github.com/users/martell","html_url":"https://github.com/martell","followers_url":"https://api.github.com/users/martell/followers","following_url":"https://api.github.com/users/martell/following{/other_user}","gists_url":"https://api.github.com/users/martell/gists{/gist_id}","starred_url":"https://api.github.com/users/martell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martell/subscriptions","organizations_url":"https://api.github.com/users/martell/orgs","repos_url":"https://api.github.com/users/martell/repos","events_url":"https://api.github.com/users/martell/events{/privacy}","received_events_url":"https://api.github.com/users/martell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martell/h2o","description":"HTTP server / library implementation with support for HTTP/1, HTTP/2, websocket","fork":true,"url":"https://api.github.com/repos/martell/h2o","forks_url":"https://api.github.com/repos/martell/h2o/forks","keys_url":"https://api.github.com/repos/martell/h2o/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martell/h2o/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martell/h2o/teams","hooks_url":"https://api.github.com/repos/martell/h2o/hooks","issue_events_url":"https://api.github.com/repos/martell/h2o/issues/events{/number}","events_url":"https://api.github.com/repos/martell/h2o/events","assignees_url":"https://api.github.com/repos/martell/h2o/assignees{/user}","branches_url":"https://api.github.com/repos/martell/h2o/branches{/branch}","tags_url":"https://api.github.com/repos/martell/h2o/tags","blobs_url":"https://api.github.com/repos/martell/h2o/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martell/h2o/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martell/h2o/git/refs{/sha}","trees_url":"https://api.github.com/repos/martell/h2o/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martell/h2o/statuses/{sha}","languages_url":"https://api.github.com/repos/martell/h2o/languages","stargazers_url":"https://api.github.com/repos/martell/h2o/stargazers","contributors_url":"https://api.github.com/repos/martell/h2o/contributors","subscribers_url":"https://api.github.com/repos/martell/h2o/subscribers","subscription_url":"https://api.github.com/repos/martell/h2o/subscription","commits_url":"https://api.github.com/repos/martell/h2o/commits{/sha}","git_commits_url":"https://api.github.com/repos/martell/h2o/git/commits{/sha}","comments_url":"https://api.github.com/repos/martell/h2o/comments{/number}","issue_comment_url":"https://api.github.com/repos/martell/h2o/issues/comments{/number}","contents_url":"https://api.github.com/repos/martell/h2o/contents/{+path}","compare_url":"https://api.github.com/repos/martell/h2o/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martell/h2o/merges","archive_url":"https://api.github.com/repos/martell/h2o/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martell/h2o/downloads","issues_url":"https://api.github.com/repos/martell/h2o/issues{/number}","pulls_url":"https://api.github.com/repos/martell/h2o/pulls{/number}","milestones_url":"https://api.github.com/repos/martell/h2o/milestones{/number}","notifications_url":"https://api.github.com/repos/martell/h2o/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martell/h2o/labels{/name}","releases_url":"https://api.github.com/repos/martell/h2o/releases{/id}","created_at":"2014-12-11T02:01:39Z","updated_at":"2014-12-11T02:01:40Z","pushed_at":"2015-06-27T18:18:24Z","git_url":"git://github.com/martell/h2o.git","ssh_url":"git@github.com:martell/h2o.git","clone_url":"https://github.com/martell/h2o.git","svn_url":"https://github.com/martell/h2o","homepage":"http://blog.kazuhooku.com/search/label/H2O","size":1674,"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":"h2o:master","ref":"master","sha":"e8e0eb68d8319120d1b1fa52ae1c217b1415b80a","user":{"login":"h2o","id":9275116,"avatar_url":"https://avatars.githubusercontent.com/u/9275116?v=3","gravatar_id":"","url":"https://api.github.com/users/h2o","html_url":"https://github.com/h2o","followers_url":"https://api.github.com/users/h2o/followers","following_url":"https://api.github.com/users/h2o/following{/other_user}","gists_url":"https://api.github.com/users/h2o/gists{/gist_id}","starred_url":"https://api.github.com/users/h2o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2o/subscriptions","organizations_url":"https://api.github.com/users/h2o/orgs","repos_url":"https://api.github.com/users/h2o/repos","events_url":"https://api.github.com/users/h2o/events{/privacy}","received_events_url":"https://api.github.com/users/h2o/received_events","type":"Organization","site_admin":false},"repo":{"id":23029617,"name":"h2o","full_name":"h2o/h2o","owner":{"login":"h2o","id":9275116,"avatar_url":"https://avatars.githubusercontent.com/u/9275116?v=3","gravatar_id":"","url":"https://api.github.com/users/h2o","html_url":"https://github.com/h2o","followers_url":"https://api.github.com/users/h2o/followers","following_url":"https://api.github.com/users/h2o/following{/other_user}","gists_url":"https://api.github.com/users/h2o/gists{/gist_id}","starred_url":"https://api.github.com/users/h2o/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h2o/subscriptions","organizations_url":"https://api.github.com/users/h2o/orgs","repos_url":"https://api.github.com/users/h2o/repos","events_url":"https://api.github.com/users/h2o/events{/privacy}","received_events_url":"https://api.github.com/users/h2o/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/h2o/h2o","description":"H2O - the optimized HTTP/1, HTTP/2 server","fork":false,"url":"https://api.github.com/repos/h2o/h2o","forks_url":"https://api.github.com/repos/h2o/h2o/forks","keys_url":"https://api.github.com/repos/h2o/h2o/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h2o/h2o/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h2o/h2o/teams","hooks_url":"https://api.github.com/repos/h2o/h2o/hooks","issue_events_url":"https://api.github.com/repos/h2o/h2o/issues/events{/number}","events_url":"https://api.github.com/repos/h2o/h2o/events","assignees_url":"https://api.github.com/repos/h2o/h2o/assignees{/user}","branches_url":"https://api.github.com/repos/h2o/h2o/branches{/branch}","tags_url":"https://api.github.com/repos/h2o/h2o/tags","blobs_url":"https://api.github.com/repos/h2o/h2o/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h2o/h2o/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h2o/h2o/git/refs{/sha}","trees_url":"https://api.github.com/repos/h2o/h2o/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h2o/h2o/statuses/{sha}","languages_url":"https://api.github.com/repos/h2o/h2o/languages","stargazers_url":"https://api.github.com/repos/h2o/h2o/stargazers","contributors_url":"https://api.github.com/repos/h2o/h2o/contributors","subscribers_url":"https://api.github.com/repos/h2o/h2o/subscribers","subscription_url":"https://api.github.com/repos/h2o/h2o/subscription","commits_url":"https://api.github.com/repos/h2o/h2o/commits{/sha}","git_commits_url":"https://api.github.com/repos/h2o/h2o/git/commits{/sha}","comments_url":"https://api.github.com/repos/h2o/h2o/comments{/number}","issue_comment_url":"https://api.github.com/repos/h2o/h2o/issues/comments{/number}","contents_url":"https://api.github.com/repos/h2o/h2o/contents/{+path}","compare_url":"https://api.github.com/repos/h2o/h2o/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h2o/h2o/merges","archive_url":"https://api.github.com/repos/h2o/h2o/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h2o/h2o/downloads","issues_url":"https://api.github.com/repos/h2o/h2o/issues{/number}","pulls_url":"https://api.github.com/repos/h2o/h2o/pulls{/number}","milestones_url":"https://api.github.com/repos/h2o/h2o/milestones{/number}","notifications_url":"https://api.github.com/repos/h2o/h2o/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h2o/h2o/labels{/name}","releases_url":"https://api.github.com/repos/h2o/h2o/releases{/id}","created_at":"2014-08-16T23:59:03Z","updated_at":"2015-06-28T12:48:33Z","pushed_at":"2015-06-29T02:35:30Z","git_url":"git://github.com/h2o/h2o.git","ssh_url":"git@github.com:h2o/h2o.git","clone_url":"https://github.com/h2o/h2o.git","svn_url":"https://github.com/h2o/h2o","homepage":"https://h2o.examp1e.net","size":18485,"stargazers_count":4437,"watchers_count":4437,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":298,"mirror_url":null,"open_issues_count":108,"forks":298,"open_issues":108,"watchers":4437,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/h2o/h2o/pulls/380"},"html":{"href":"https://github.com/h2o/h2o/pull/380"},"issue":{"href":"https://api.github.com/repos/h2o/h2o/issues/380"},"comments":{"href":"https://api.github.com/repos/h2o/h2o/issues/380/comments"},"review_comments":{"href":"https://api.github.com/repos/h2o/h2o/pulls/380/comments"},"review_comment":{"href":"https://api.github.com/repos/h2o/h2o/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/h2o/h2o/pulls/380/commits"},"statuses":{"href":"https://api.github.com/repos/h2o/h2o/statuses/52dbba63365a65b89f4f08569120ff8c68802b33"}}}}