GitHub PullRequestReviewCommentEvent at 2014-11-18 08:06:43
Repository: libuv
Actor: saghul
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/joyent/libuv/pulls/comments/20490559","id":20490559,"diff_hunk":"@@ -0,0 +1,365 @@\n+/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to\n+ * deal in the Software without restriction, including without limitation the\n+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n+ * sell copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n+ * IN THE SOFTWARE.\n+ */\n+\n+#include <assert.h>\n+#include <stdlib.h>\n+#include <fcntl.h>\n+\n+#include \"uv.h\"\n+#include \"internal.h\"\n+#include \"handle-inl.h\"\n+#include \"stream-inl.h\"\n+#include \"req-inl.h\"\n+\n+/* A zero-size buffer for use by uv_device_read */\n+static char uv_zero_[] = \"\";\n+\n+int uv_device_init(uv_loop_t* loop, uv_device_t* handle) {\n+  uv_stream_init(loop, (uv_stream_t*) handle, UV_DEVICE);\n+  handle->handle = INVALID_HANDLE_VALUE;\n+  handle->buf.base = NULL;\n+  handle->buf.len = 0;\n+\n+  return 0;\n+};\n+\n+int uv_device_open(uv_loop_t* loop,\n+                   uv_device_t* handle,\n+                   const char* path,\n+                   int flags) {\n+  DWORD dwCreationDisposition;\n+  int uvflags;\n+\n+  assert(handle && handle->handle == INVALID_HANDLE_VALUE);\n+  uv_connection_init((uv_stream_t*) handle);\n+\n+  dwCreationDisposition = 0;\n+  uvflags = 0; \n+  if (flags & O_RDONLY) {\n+    dwCreationDisposition |= GENERIC_READ;\n+    uvflags |= UV_HANDLE_READABLE;\n+  }\n+  if (flags & O_WRONLY) {\n+    dwCreationDisposition |= GENERIC_WRITE;\n+    uvflags |= UV_HANDLE_WRITABLE;\n+  }\n+  if (flags & O_RDWR) {\n+    dwCreationDisposition |= (GENERIC_READ | GENERIC_WRITE);\n+    uvflags |= UV_HANDLE_READABLE | UV_HANDLE_WRITABLE;\n+  }\n+\n+  handle->handle = CreateFile(path,\n+                              dwCreationDisposition,\n+                              0,\n+                              NULL,\n+                              OPEN_EXISTING,\n+                              FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,\n+                              0);\n+  if (handle->handle == INVALID_HANDLE_VALUE)\n+    return GetLastError();\n+\n+  /* Try to associate with IOCP. */\n+  if (!CreateIoCompletionPort(handle->handle, loop->iocp, (ULONG_PTR)handle, 0)) {\n+    DWORD err = GetLastError();\n+    if (ERROR_INVALID_PARAMETER == err) {\n+       /* Already associated. */\n+    } else {\n+      return uv_translate_sys_error(err);\n+    }\n+  }\n+\n+  handle->flags |= uvflags;\n+  return 0;\n+}\n+\n+int uv_device_ioctl(uv_device_t* device, int cmd, void* arg) {\n+  uv_ioargs_t *args;\n+  BOOL r;\n+\n+  args = (uv_ioargs_t*) arg;\n+  assert(device && device->handle != INVALID_HANDLE_VALUE);\n+  assert(args && args->input_len && args->output_len);\n+\n+  r = DeviceIoControl(device->handle, \n+                      (DWORD) cmd,\n+                      args->input,\n+                      args->input_len,\n+                      args->output,\n+                      args->output_len,\n+                      &args->size,\n+                      NULL);\n+\n+  if (r) \n+    return 0;\n+\n+  return uv_translate_sys_error(GetLastError());\n+}\n+\n+void uv_device_endgame(uv_loop_t* loop, uv_device_t* handle) {\n+  if (handle->buf.base) {\n+    free(handle->buf.base);\n+    handle->buf.base = NULL;\n+    handle->buf.len = 0;\n+  }\n+\n+  uv__handle_close(handle);\n+}\n+\n+static void uv_device_queue_read(uv_loop_t* loop, uv_device_t* handle) {\n+  uv_read_t* req;\n+  BOOL r;\n+  DWORD err;\n+\n+  assert(handle->flags & UV_HANDLE_READING);\n+  assert(!(handle->flags & UV_HANDLE_READ_PENDING));\n+  assert(handle->handle && handle->handle != INVALID_HANDLE_VALUE);\n+\n+  req = &handle->read_req;\n+  memset(&req->overlapped, 0, sizeof(req->overlapped));\n+  handle->alloc_cb((uv_handle_t*) handle, 65536, &handle->buf);\n+  if (handle->buf.len == 0) {\n+    handle->read_cb((uv_stream_t*) handle, UV_ENOBUFS, &handle->buf);\n+    return;\n+  }\n+\n+  r = ReadFile(handle->handle,\n+               handle->buf.base,\n+               handle->buf.len,\n+               NULL,\n+               &req->overlapped);\n+\n+  if (r) {\n+    handle->flags |= UV_HANDLE_READ_PENDING;\n+    handle->reqs_pending++;\n+    uv_insert_pending_req(loop, (uv_req_t*) req);\n+  } else {\n+    err = GetLastError();\n+    if (r == 0 && err == ERROR_IO_PENDING) {\n+      /* The req will be processed with IOCP. */\n+      handle->flags |= UV_HANDLE_READ_PENDING;\n+      handle->reqs_pending++;\n+    } else {\n+      /* Make this req pending reporting an error. */\n+      SET_REQ_ERROR(req, err);\n+      uv_insert_pending_req(loop, (uv_req_t*) req);\n+      handle->reqs_pending++;\n+    }\n+  } \n+};\n+\n+int uv_device_read_start(uv_device_t* handle,\n+                         uv_alloc_cb alloc_cb,\n+                         uv_read_cb read_cb) {\n+  uv_loop_t* loop = handle->loop;\n+\n+  if (!(handle->flags & UV_HANDLE_READABLE))\n+    return ERROR_INVALID_PARAMETER;\n+\n+  handle->flags |= UV_HANDLE_READING;\n+  INCREASE_ACTIVE_COUNT(loop, handle);\n+  handle->read_cb = read_cb;\n+  handle->alloc_cb = alloc_cb;\n+\n+  /* If reading was stopped and then started again, there could still be a */\n+  /* read request pending. */\n+  if (handle->flags & UV_HANDLE_READ_PENDING)\n+    return 0;\n+\n+  uv_device_queue_read(loop, handle);\n+  return 0; \n+}\n+\n+\n+int uv_device_write(uv_loop_t* loop,\n+                    uv_write_t* req,\n+                    uv_device_t* handle,\n+                    const uv_buf_t bufs[],\n+                    unsigned int nbufs,\n+                    uv_write_cb cb) {\n+  int result;\n+  DWORD err = 0;\n+  \n+  if (nbufs != 1 && (nbufs != 0 || !handle)) {\n+    return ERROR_NOT_SUPPORTED;\n+  }\n+  /* Only TCP handles are supported for sharing. */\n+  if (handle && ((handle->type != UV_DEVICE) ||","path":"src/win/device.c","position":204,"original_position":204,"commit_id":"93901d89a44881346748d85a14e838ac509f69eb","original_commit_id":"93901d89a44881346748d85a14e838ac509f69eb","user":{"login":"saghul","id":317464,"avatar_url":"https://avatars.githubusercontent.com/u/317464?v=3","gravatar_id":"","url":"https://api.github.com/users/saghul","html_url":"https://github.com/saghul","followers_url":"https://api.github.com/users/saghul/followers","following_url":"https://api.github.com/users/saghul/following{/other_user}","gists_url":"https://api.github.com/users/saghul/gists{/gist_id}","starred_url":"https://api.github.com/users/saghul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saghul/subscriptions","organizations_url":"https://api.github.com/users/saghul/orgs","repos_url":"https://api.github.com/users/saghul/repos","events_url":"https://api.github.com/users/saghul/events{/privacy}","received_events_url":"https://api.github.com/users/saghul/received_events","type":"User","site_admin":false},"body":"This check doesn't really apply. Just check if handle is not NULL.","created_at":"2014-11-18T08:06:43Z","updated_at":"2014-11-18T08:06:43Z","html_url":"https://github.com/joyent/libuv/pull/1580#discussion_r20490559","pull_request_url":"https://api.github.com/repos/joyent/libuv/pulls/1580","_links":{"self":{"href":"https://api.github.com/repos/joyent/libuv/pulls/comments/20490559"},"html":{"href":"https://github.com/joyent/libuv/pull/1580#discussion_r20490559"},"pull_request":{"href":"https://api.github.com/repos/joyent/libuv/pulls/1580"}}},"pull_request":{"url":"https://api.github.com/repos/joyent/libuv/pulls/1580","id":24361957,"html_url":"https://github.com/joyent/libuv/pull/1580","diff_url":"https://github.com/joyent/libuv/pull/1580.diff","patch_url":"https://github.com/joyent/libuv/pull/1580.patch","issue_url":"https://api.github.com/repos/joyent/libuv/issues/1580","number":1580,"state":"open","locked":false,"title":"Add uv_device_t as stream on windows and linux, handle device I/O asyncly.","user":{"login":"zhaozg","id":542599,"avatar_url":"https://avatars.githubusercontent.com/u/542599?v=3","gravatar_id":"","url":"https://api.github.com/users/zhaozg","html_url":"https://github.com/zhaozg","followers_url":"https://api.github.com/users/zhaozg/followers","following_url":"https://api.github.com/users/zhaozg/following{/other_user}","gists_url":"https://api.github.com/users/zhaozg/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaozg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaozg/subscriptions","organizations_url":"https://api.github.com/users/zhaozg/orgs","repos_url":"https://api.github.com/users/zhaozg/repos","events_url":"https://api.github.com/users/zhaozg/events{/privacy}","received_events_url":"https://api.github.com/users/zhaozg/received_events","type":"User","site_admin":false},"body":"I'm a multi-language programmer, but not family with english, so maybe trouble with options. libuv is a good i/o framework, and easy to extent, I hope persist on it to do my work.\r\n\r\nWhen I want to do r/w device on windows, I try filesystem api, it works for device handle, but not fit my needs. I need a real stream, I try wrap handle as pipe, and fail to work. When I study TTY and TCP, I realize that it not hard to implication a device type stream, because just file operation with overlapped,  even simpler than other stream types.\r\nWhen I finish my job on windows, i realize libUV is born for linux, simple to add a device type, so i did it.\r\n\r\nThere are only three type related api.\r\n\r\n```c\r\nUV_EXTERN int uv_device_init(uv_loop_t* handle, uv_device_t* device);\r\nUV_EXTERN int uv_device_open(uv_loop_t* handle, uv_device_t* device, const char* path, int flags);\r\nUV_EXTERN int uv_device_ioctl(uv_device_t* device, int cmd, void* arg);\r\n```\r\nuv_device_open create a uv_deive_t, path should be '/dev/??' on linux or \"\\\\.\\Global\\???\" on windows.\r\nflags should be  O_RDONLY,O_WRONLY  or O_RDWR.\r\n\r\nuv_device_ioctl will set or get device paramater,  arg is relative with OS platform. on windows please use are uv_ioargs_t, detail please see header file.\r\n\r\nbecause not test widely, so maybe have bugs, please attention.\r\n\r\nHappy for do something for libUV.","created_at":"2014-11-13T11:31:34Z","updated_at":"2014-11-18T08:06:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ee91bbf41d76924fb83f613b620a94fff2a5c09","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/joyent/libuv/pulls/1580/commits","review_comments_url":"https://api.github.com/repos/joyent/libuv/pulls/1580/comments","review_comment_url":"https://api.github.com/repos/joyent/libuv/pulls/comments/{number}","comments_url":"https://api.github.com/repos/joyent/libuv/issues/1580/comments","statuses_url":"https://api.github.com/repos/joyent/libuv/statuses/93901d89a44881346748d85a14e838ac509f69eb","head":{"label":"zhaozg:master","ref":"master","sha":"93901d89a44881346748d85a14e838ac509f69eb","user":{"login":"zhaozg","id":542599,"avatar_url":"https://avatars.githubusercontent.com/u/542599?v=3","gravatar_id":"","url":"https://api.github.com/users/zhaozg","html_url":"https://github.com/zhaozg","followers_url":"https://api.github.com/users/zhaozg/followers","following_url":"https://api.github.com/users/zhaozg/following{/other_user}","gists_url":"https://api.github.com/users/zhaozg/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaozg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaozg/subscriptions","organizations_url":"https://api.github.com/users/zhaozg/orgs","repos_url":"https://api.github.com/users/zhaozg/repos","events_url":"https://api.github.com/users/zhaozg/events{/privacy}","received_events_url":"https://api.github.com/users/zhaozg/received_events","type":"User","site_admin":false},"repo":{"id":26118155,"name":"libuv","full_name":"zhaozg/libuv","owner":{"login":"zhaozg","id":542599,"avatar_url":"https://avatars.githubusercontent.com/u/542599?v=3","gravatar_id":"","url":"https://api.github.com/users/zhaozg","html_url":"https://github.com/zhaozg","followers_url":"https://api.github.com/users/zhaozg/followers","following_url":"https://api.github.com/users/zhaozg/following{/other_user}","gists_url":"https://api.github.com/users/zhaozg/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaozg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaozg/subscriptions","organizations_url":"https://api.github.com/users/zhaozg/orgs","repos_url":"https://api.github.com/users/zhaozg/repos","events_url":"https://api.github.com/users/zhaozg/events{/privacy}","received_events_url":"https://api.github.com/users/zhaozg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhaozg/libuv","description":"Cross-platform asynchronous I/O","fork":true,"url":"https://api.github.com/repos/zhaozg/libuv","forks_url":"https://api.github.com/repos/zhaozg/libuv/forks","keys_url":"https://api.github.com/repos/zhaozg/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhaozg/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhaozg/libuv/teams","hooks_url":"https://api.github.com/repos/zhaozg/libuv/hooks","issue_events_url":"https://api.github.com/repos/zhaozg/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/zhaozg/libuv/events","assignees_url":"https://api.github.com/repos/zhaozg/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/zhaozg/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/zhaozg/libuv/tags","blobs_url":"https://api.github.com/repos/zhaozg/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhaozg/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhaozg/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhaozg/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhaozg/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/zhaozg/libuv/languages","stargazers_url":"https://api.github.com/repos/zhaozg/libuv/stargazers","contributors_url":"https://api.github.com/repos/zhaozg/libuv/contributors","subscribers_url":"https://api.github.com/repos/zhaozg/libuv/subscribers","subscription_url":"https://api.github.com/repos/zhaozg/libuv/subscription","commits_url":"https://api.github.com/repos/zhaozg/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhaozg/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhaozg/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhaozg/libuv/issues/comments/{number}","contents_url":"https://api.github.com/repos/zhaozg/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/zhaozg/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhaozg/libuv/merges","archive_url":"https://api.github.com/repos/zhaozg/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhaozg/libuv/downloads","issues_url":"https://api.github.com/repos/zhaozg/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/zhaozg/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/zhaozg/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/zhaozg/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhaozg/libuv/labels{/name}","releases_url":"https://api.github.com/repos/zhaozg/libuv/releases{/id}","created_at":"2014-11-03T12:43:19Z","updated_at":"2014-11-03T13:48:47Z","pushed_at":"2014-11-17T15:50:12Z","git_url":"git://github.com/zhaozg/libuv.git","ssh_url":"git@github.com:zhaozg/libuv.git","clone_url":"https://github.com/zhaozg/libuv.git","svn_url":"https://github.com/zhaozg/libuv","homepage":"http://libuv.org/","size":12826,"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":"joyent:master","ref":"master","sha":"89bc09808f91e170e2486ee63f5a7b1cf0ac28bc","user":{"login":"joyent","id":10161,"avatar_url":"https://avatars.githubusercontent.com/u/10161?v=3","gravatar_id":"","url":"https://api.github.com/users/joyent","html_url":"https://github.com/joyent","followers_url":"https://api.github.com/users/joyent/followers","following_url":"https://api.github.com/users/joyent/following{/other_user}","gists_url":"https://api.github.com/users/joyent/gists{/gist_id}","starred_url":"https://api.github.com/users/joyent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joyent/subscriptions","organizations_url":"https://api.github.com/users/joyent/orgs","repos_url":"https://api.github.com/users/joyent/repos","events_url":"https://api.github.com/users/joyent/events{/privacy}","received_events_url":"https://api.github.com/users/joyent/received_events","type":"Organization","site_admin":false},"repo":{"id":1543431,"name":"libuv","full_name":"joyent/libuv","owner":{"login":"joyent","id":10161,"avatar_url":"https://avatars.githubusercontent.com/u/10161?v=3","gravatar_id":"","url":"https://api.github.com/users/joyent","html_url":"https://github.com/joyent","followers_url":"https://api.github.com/users/joyent/followers","following_url":"https://api.github.com/users/joyent/following{/other_user}","gists_url":"https://api.github.com/users/joyent/gists{/gist_id}","starred_url":"https://api.github.com/users/joyent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joyent/subscriptions","organizations_url":"https://api.github.com/users/joyent/orgs","repos_url":"https://api.github.com/users/joyent/repos","events_url":"https://api.github.com/users/joyent/events{/privacy}","received_events_url":"https://api.github.com/users/joyent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joyent/libuv","description":"Cross-platform asynchronous I/O","fork":false,"url":"https://api.github.com/repos/joyent/libuv","forks_url":"https://api.github.com/repos/joyent/libuv/forks","keys_url":"https://api.github.com/repos/joyent/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joyent/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joyent/libuv/teams","hooks_url":"https://api.github.com/repos/joyent/libuv/hooks","issue_events_url":"https://api.github.com/repos/joyent/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/joyent/libuv/events","assignees_url":"https://api.github.com/repos/joyent/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/joyent/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/joyent/libuv/tags","blobs_url":"https://api.github.com/repos/joyent/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joyent/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joyent/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/joyent/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joyent/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/joyent/libuv/languages","stargazers_url":"https://api.github.com/repos/joyent/libuv/stargazers","contributors_url":"https://api.github.com/repos/joyent/libuv/contributors","subscribers_url":"https://api.github.com/repos/joyent/libuv/subscribers","subscription_url":"https://api.github.com/repos/joyent/libuv/subscription","commits_url":"https://api.github.com/repos/joyent/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/joyent/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/joyent/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/joyent/libuv/issues/comments/{number}","contents_url":"https://api.github.com/repos/joyent/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/joyent/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joyent/libuv/merges","archive_url":"https://api.github.com/repos/joyent/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joyent/libuv/downloads","issues_url":"https://api.github.com/repos/joyent/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/joyent/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/joyent/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/joyent/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joyent/libuv/labels{/name}","releases_url":"https://api.github.com/repos/joyent/libuv/releases{/id}","created_at":"2011-03-29T21:10:45Z","updated_at":"2014-11-18T02:48:42Z","pushed_at":"2014-11-18T07:27:21Z","git_url":"git://github.com/joyent/libuv.git","ssh_url":"git@github.com:joyent/libuv.git","clone_url":"https://github.com/joyent/libuv.git","svn_url":"https://github.com/joyent/libuv","homepage":"http://libuv.org/","size":30914,"stargazers_count":3476,"watchers_count":3476,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":773,"mirror_url":null,"open_issues_count":144,"forks":773,"open_issues":144,"watchers":3476,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/joyent/libuv/pulls/1580"},"html":{"href":"https://github.com/joyent/libuv/pull/1580"},"issue":{"href":"https://api.github.com/repos/joyent/libuv/issues/1580"},"comments":{"href":"https://api.github.com/repos/joyent/libuv/issues/1580/comments"},"review_comments":{"href":"https://api.github.com/repos/joyent/libuv/pulls/1580/comments"},"review_comment":{"href":"https://api.github.com/repos/joyent/libuv/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/joyent/libuv/pulls/1580/commits"},"statuses":{"href":"https://api.github.com/repos/joyent/libuv/statuses/93901d89a44881346748d85a14e838ac509f69eb"}}}}