{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc/pulls/comments/72368178","id":72368178,"diff_hunk":"@@ -0,0 +1,160 @@\n+/*\n+ *\n+ * Copyright 2015, Google Inc.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are\n+ * met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above\n+ * copyright notice, this list of conditions and the following disclaimer\n+ * in the documentation and/or other materials provided with the\n+ * distribution.\n+ *     * Neither the name of Google Inc. nor the names of its\n+ * contributors may be used to endorse or promote products derived from\n+ * this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ */\n+\n+\n+#include <grpc_c/grpc_c.h>\n+#include <grpc/support/log.h>\n+#include \"bidi_streaming_blocking_call.h\"\n+#include <grpc_c/completion_queue.h>\n+#include \"alloc.h\"\n+#include \"tag.h\"\n+#include \"completion_queue.h\"\n+\n+GRPC_client_reader_writer *GRPC_bidi_streaming_blocking_call(GRPC_channel *channel,\n+                                                        const GRPC_method rpc_method,\n+                                                        GRPC_client_context *const context) {\n+  grpc_completion_queue *cq = GRPC_completion_queue_create();\n+  grpc_call *call = grpc_channel_create_call(channel,\n+                                             NULL,\n+                                             GRPC_PROPAGATE_DEFAULTS,\n+                                             cq,\n+                                             rpc_method.name,\n+                                             \"\",\n+                                             context->deadline,\n+                                             NULL);\n+  context->call = call;\n+  context->rpc_method = rpc_method;\n+\n+  grpc_call_op_set set = {\n+    {\n+      grpc_op_send_metadata\n+    },\n+    .context = context,\n+    .user_tag = &set\n+  };\n+\n+  grpc_client_reader_writer *reader_writer = GRPC_ALLOC_STRUCT(grpc_client_reader_writer, {","path":"src/c/bidi_streaming_blocking_call.c","position":65,"original_position":66,"commit_id":"cf92c9f0af33073b339b99dd672b963586cae6f9","original_commit_id":"bbd815c9d9ab12f6acff6aa6039d499430af81ef","user":{"login":"tengyifei","id":2877531,"avatar_url":"https://avatars.githubusercontent.com/u/2877531?v=3","gravatar_id":"","url":"https://api.github.com/users/tengyifei","html_url":"https://github.com/tengyifei","followers_url":"https://api.github.com/users/tengyifei/followers","following_url":"https://api.github.com/users/tengyifei/following{/other_user}","gists_url":"https://api.github.com/users/tengyifei/gists{/gist_id}","starred_url":"https://api.github.com/users/tengyifei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tengyifei/subscriptions","organizations_url":"https://api.github.com/users/tengyifei/orgs","repos_url":"https://api.github.com/users/tengyifei/repos","events_url":"https://api.github.com/users/tengyifei/events{/privacy}","received_events_url":"https://api.github.com/users/tengyifei/received_events","type":"User","site_admin":false},"body":"Passed the portability suite.","created_at":"2016-07-27T01:35:00Z","updated_at":"2016-07-27T01:35:00Z","html_url":"https://github.com/grpc/grpc/pull/7386#discussion_r72368178","pull_request_url":"https://api.github.com/repos/grpc/grpc/pulls/7386","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments/72368178"},"html":{"href":"https://github.com/grpc/grpc/pull/7386#discussion_r72368178"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc/pulls/7386"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/7386","id":77383305,"html_url":"https://github.com/grpc/grpc/pull/7386","diff_url":"https://github.com/grpc/grpc/pull/7386.diff","patch_url":"https://github.com/grpc/grpc/pull/7386.patch","issue_url":"https://api.github.com/repos/grpc/grpc/issues/7386","number":7386,"state":"closed","locked":false,"title":"[C-API] runtime","user":{"login":"tengyifei","id":2877531,"avatar_url":"https://avatars.githubusercontent.com/u/2877531?v=3","gravatar_id":"","url":"https://api.github.com/users/tengyifei","html_url":"https://github.com/tengyifei","followers_url":"https://api.github.com/users/tengyifei/followers","following_url":"https://api.github.com/users/tengyifei/following{/other_user}","gists_url":"https://api.github.com/users/tengyifei/gists{/gist_id}","starred_url":"https://api.github.com/users/tengyifei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tengyifei/subscriptions","organizations_url":"https://api.github.com/users/tengyifei/orgs","repos_url":"https://api.github.com/users/tengyifei/repos","events_url":"https://api.github.com/users/tengyifei/events{/privacy}","received_events_url":"https://api.github.com/users/tengyifei/received_events","type":"User","site_admin":false},"body":"This PR implements all blocking APIs and a async unary call.\r\n\r\nTo reviewers:\r\n+ `include/grpc_c` contains the public headers that the final user could see\r\n+ `src/c` contains the implementations of those methods defined in `include`\r\n+ `test/c/end2end` contains end-to-end tests for the APIs.\r\n\r\nThe tests are written in C++, since it depends on a server implementation which the C runtime does not provide yet. As a result they are subsumed under C++ tests and can be run by specifying `-l c++` in the test script.\r\n\r\nSince this is a huge PR, I hope to split it into different functional components and have multiple reviewers each going over a section:\r\n\r\n+ Unary blocking call: `src/c/unary_blocking_call.c`\r\n+ Client streaming block call: `src/c/client_streaming_blocking_call.c`\r\n+ Server streaming block call: `src/c/server_streaming_blocking_call.c`\r\n+ Bidi streaming block call: `src/c/bidi_streaming_blocking_call.c`\r\n+ Unary async call: `src/c/unary_async_call.c`\r\n\r\nSome useful files:\r\n+ `src/c/completion_queue.c` handles unwrapping of tags. A `call_op_set` is always used as tag during async operations. The user tag is stored in the set and is what `completion_queue_next` returns.\r\n+ `src/c/call_ops.c` handles filling a `grpc_op` array using operations specified in `call_op_set`. The library can declaratively indicate the actions to be performed in a `call_start_batch`, much like C++.","created_at":"2016-07-14T00:26:08Z","updated_at":"2016-07-27T01:35:00Z","closed_at":"2016-07-26T19:11:47Z","merged_at":null,"merge_commit_sha":"88c486433d2e9e644c6f182100f164a164c1633f","assignee":{"login":"sreecha","id":2754995,"avatar_url":"https://avatars.githubusercontent.com/u/2754995?v=3","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},"assignees":[{"login":"sreecha","id":2754995,"avatar_url":"https://avatars.githubusercontent.com/u/2754995?v=3","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},{"login":"vjpai","id":8864912,"avatar_url":"https://avatars.githubusercontent.com/u/8864912?v=3","gravatar_id":"","url":"https://api.github.com/users/vjpai","html_url":"https://github.com/vjpai","followers_url":"https://api.github.com/users/vjpai/followers","following_url":"https://api.github.com/users/vjpai/following{/other_user}","gists_url":"https://api.github.com/users/vjpai/gists{/gist_id}","starred_url":"https://api.github.com/users/vjpai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjpai/subscriptions","organizations_url":"https://api.github.com/users/vjpai/orgs","repos_url":"https://api.github.com/users/vjpai/repos","events_url":"https://api.github.com/users/vjpai/events{/privacy}","received_events_url":"https://api.github.com/users/vjpai/received_events","type":"User","site_admin":false},{"login":"ctiller","id":10120821,"avatar_url":"https://avatars.githubusercontent.com/u/10120821?v=3","gravatar_id":"","url":"https://api.github.com/users/ctiller","html_url":"https://github.com/ctiller","followers_url":"https://api.github.com/users/ctiller/followers","following_url":"https://api.github.com/users/ctiller/following{/other_user}","gists_url":"https://api.github.com/users/ctiller/gists{/gist_id}","starred_url":"https://api.github.com/users/ctiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctiller/subscriptions","organizations_url":"https://api.github.com/users/ctiller/orgs","repos_url":"https://api.github.com/users/ctiller/repos","events_url":"https://api.github.com/users/ctiller/events{/privacy}","received_events_url":"https://api.github.com/users/ctiller/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc/pulls/7386/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc/pulls/7386/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/7386/comments","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/cf92c9f0af33073b339b99dd672b963586cae6f9","head":{"label":"tengyifei:c-api-runtime","ref":"c-api-runtime","sha":"cf92c9f0af33073b339b99dd672b963586cae6f9","user":{"login":"tengyifei","id":2877531,"avatar_url":"https://avatars.githubusercontent.com/u/2877531?v=3","gravatar_id":"","url":"https://api.github.com/users/tengyifei","html_url":"https://github.com/tengyifei","followers_url":"https://api.github.com/users/tengyifei/followers","following_url":"https://api.github.com/users/tengyifei/following{/other_user}","gists_url":"https://api.github.com/users/tengyifei/gists{/gist_id}","starred_url":"https://api.github.com/users/tengyifei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tengyifei/subscriptions","organizations_url":"https://api.github.com/users/tengyifei/orgs","repos_url":"https://api.github.com/users/tengyifei/repos","events_url":"https://api.github.com/users/tengyifei/events{/privacy}","received_events_url":"https://api.github.com/users/tengyifei/received_events","type":"User","site_admin":false},"repo":{"id":60220137,"name":"grpc","full_name":"tengyifei/grpc","owner":{"login":"tengyifei","id":2877531,"avatar_url":"https://avatars.githubusercontent.com/u/2877531?v=3","gravatar_id":"","url":"https://api.github.com/users/tengyifei","html_url":"https://github.com/tengyifei","followers_url":"https://api.github.com/users/tengyifei/followers","following_url":"https://api.github.com/users/tengyifei/following{/other_user}","gists_url":"https://api.github.com/users/tengyifei/gists{/gist_id}","starred_url":"https://api.github.com/users/tengyifei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tengyifei/subscriptions","organizations_url":"https://api.github.com/users/tengyifei/orgs","repos_url":"https://api.github.com/users/tengyifei/repos","events_url":"https://api.github.com/users/tengyifei/events{/privacy}","received_events_url":"https://api.github.com/users/tengyifei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tengyifei/grpc","description":"The C based gRPC (C, C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":true,"url":"https://api.github.com/repos/tengyifei/grpc","forks_url":"https://api.github.com/repos/tengyifei/grpc/forks","keys_url":"https://api.github.com/repos/tengyifei/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tengyifei/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tengyifei/grpc/teams","hooks_url":"https://api.github.com/repos/tengyifei/grpc/hooks","issue_events_url":"https://api.github.com/repos/tengyifei/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/tengyifei/grpc/events","assignees_url":"https://api.github.com/repos/tengyifei/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/tengyifei/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/tengyifei/grpc/tags","blobs_url":"https://api.github.com/repos/tengyifei/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tengyifei/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tengyifei/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/tengyifei/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tengyifei/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/tengyifei/grpc/languages","stargazers_url":"https://api.github.com/repos/tengyifei/grpc/stargazers","contributors_url":"https://api.github.com/repos/tengyifei/grpc/contributors","subscribers_url":"https://api.github.com/repos/tengyifei/grpc/subscribers","subscription_url":"https://api.github.com/repos/tengyifei/grpc/subscription","commits_url":"https://api.github.com/repos/tengyifei/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/tengyifei/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/tengyifei/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/tengyifei/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/tengyifei/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/tengyifei/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tengyifei/grpc/merges","archive_url":"https://api.github.com/repos/tengyifei/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tengyifei/grpc/downloads","issues_url":"https://api.github.com/repos/tengyifei/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/tengyifei/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/tengyifei/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/tengyifei/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tengyifei/grpc/labels{/name}","releases_url":"https://api.github.com/repos/tengyifei/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/tengyifei/grpc/deployments","created_at":"2016-06-02T00:34:38Z","updated_at":"2016-07-23T01:18:56Z","pushed_at":"2016-07-27T01:25:01Z","git_url":"git://github.com/tengyifei/grpc.git","ssh_url":"git@github.com:tengyifei/grpc.git","clone_url":"https://github.com/tengyifei/grpc.git","svn_url":"https://github.com/tengyifei/grpc","homepage":"","size":78212,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":false,"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":"grpc:master","ref":"master","sha":"6914abab5f2d7fca0fc5f90915e539fd8a913a31","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729880,"name":"grpc","full_name":"grpc/grpc","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":false,"url":"https://api.github.com/repos/grpc/grpc","forks_url":"https://api.github.com/repos/grpc/grpc/forks","keys_url":"https://api.github.com/repos/grpc/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc/teams","hooks_url":"https://api.github.com/repos/grpc/grpc/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc/events","assignees_url":"https://api.github.com/repos/grpc/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc/tags","blobs_url":"https://api.github.com/repos/grpc/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc/subscription","commits_url":"https://api.github.com/repos/grpc/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc/merges","archive_url":"https://api.github.com/repos/grpc/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc/downloads","issues_url":"https://api.github.com/repos/grpc/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/grpc/grpc/deployments","created_at":"2014-12-08T18:58:53Z","updated_at":"2016-07-27T01:04:33Z","pushed_at":"2016-07-27T01:25:01Z","git_url":"git://github.com/grpc/grpc.git","ssh_url":"git@github.com:grpc/grpc.git","clone_url":"https://github.com/grpc/grpc.git","svn_url":"https://github.com/grpc/grpc","homepage":"","size":197548,"stargazers_count":5614,"watchers_count":5614,"language":"C","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":1038,"mirror_url":null,"open_issues_count":666,"forks":1038,"open_issues":666,"watchers":5614,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/7386"},"html":{"href":"https://github.com/grpc/grpc/pull/7386"},"issue":{"href":"https://api.github.com/repos/grpc/grpc/issues/7386"},"comments":{"href":"https://api.github.com/repos/grpc/grpc/issues/7386/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc/pulls/7386/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc/pulls/7386/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc/statuses/cf92c9f0af33073b339b99dd672b963586cae6f9"}}}}
{"actor":{"display_login":"tengyifei"}}