{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc/pulls/comments/31869730","id":31869730,"diff_hunk":"@@ -34,10 +34,17 @@\n #ifndef GRPC_BYTE_BUFFER_H\n #define GRPC_BYTE_BUFFER_H\n \n-#include <grpc/grpc.h>\n #include <grpc/support/slice_buffer.h>\n \n-typedef enum { GRPC_BB_SLICE_BUFFER } grpc_byte_buffer_type;\n+typedef enum {\n+  GRPC_BB_SLICE_BUFFER,\n+\n+  /* Keep the GRPC_BB_COMPRESSED_* entries in the same order as the\n+   * grpc_compression_algorithm enum entries. */\n+  GRPC_BB_COMPRESSED_NONE, /* for overriding otherwise compressed channels */\n+  GRPC_BB_COMPRESSED_DEFLATE,","path":"include/grpc/byte_buffer.h","position":14,"original_position":14,"commit_id":"25d02d56370bfa0ead2a79203c522ce02cbe9394","original_commit_id":"25d02d56370bfa0ead2a79203c522ce02cbe9394","user":{"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},"body":"I wonder about splitting these out into an orthogonal property. Something like:\r\n\r\n```c\r\ntypedef enum {\r\n  GRPC_BB_RAW,\r\n  /* in the future I expect GRPC_BB_PROTOBUF or similar */\r\n} grpc_byte_buffer_type;\r\n\r\nstruct grpc_byte_buffer {\r\n  grpc_byte_buffer_type type;\r\n  union {\r\n    struct {\r\n      grpc_compression_algorithm compression;\r\n      grpc_slice_buffer slice_buffer;\r\n    } raw;\r\n  };\r\n};\r\n```\r\n\r\nPros:\r\n- it's a little easier to interpret 'type'\r\n- it keeps some competing concerns separated\r\n  - it's easier to extend compression_type and byte_buffer_type independently\r\n- it'll be easier to add a GRPC_BB_PROTOBUF when we need to\r\n\r\nCons:\r\n- it's a larger change\r\n- the structure of byte_buffer is slightly more complex\r\n","created_at":"2015-06-06T17:12:05Z","updated_at":"2015-06-06T17:12:05Z","html_url":"https://github.com/grpc/grpc/pull/1963#discussion_r31869730","pull_request_url":"https://api.github.com/repos/grpc/grpc/pulls/1963","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments/31869730"},"html":{"href":"https://github.com/grpc/grpc/pull/1963#discussion_r31869730"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc/pulls/1963"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/1963","id":37078966,"html_url":"https://github.com/grpc/grpc/pull/1963","diff_url":"https://github.com/grpc/grpc/pull/1963.diff","patch_url":"https://github.com/grpc/grpc/pull/1963.patch","issue_url":"https://api.github.com/repos/grpc/grpc/issues/1963","number":1963,"state":"open","locked":false,"title":"Made grpc_byte_buffer_reader able to decompress msgs.","user":{"login":"dgquintas","id":120217,"avatar_url":"https://avatars.githubusercontent.com/u/120217?v=3","gravatar_id":"","url":"https://api.github.com/users/dgquintas","html_url":"https://github.com/dgquintas","followers_url":"https://api.github.com/users/dgquintas/followers","following_url":"https://api.github.com/users/dgquintas/following{/other_user}","gists_url":"https://api.github.com/users/dgquintas/gists{/gist_id}","starred_url":"https://api.github.com/users/dgquintas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgquintas/subscriptions","organizations_url":"https://api.github.com/users/dgquintas/orgs","repos_url":"https://api.github.com/users/dgquintas/repos","events_url":"https://api.github.com/users/dgquintas/events{/privacy}","received_events_url":"https://api.github.com/users/dgquintas/received_events","type":"User","site_admin":false},"body":"Part of #1795.","created_at":"2015-06-05T23:33:39Z","updated_at":"2015-06-06T17:12:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51d11a94704e5b86af1aedc7dbae2c35e38cc679","assignee":{"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":{"url":"https://api.github.com/repos/grpc/grpc/milestones/25","html_url":"https://github.com/grpc/grpc/milestones/Beta","labels_url":"https://api.github.com/repos/grpc/grpc/milestones/25/labels","id":1134869,"number":25,"title":"Beta","description":"","creator":{"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},"open_issues":110,"closed_issues":19,"state":"open","created_at":"2015-05-26T22:29:20Z","updated_at":"2015-06-06T14:23:32Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/grpc/grpc/pulls/1963/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc/pulls/1963/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/1963/comments","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/25d02d56370bfa0ead2a79203c522ce02cbe9394","head":{"label":"dgquintas:compression","ref":"compression","sha":"25d02d56370bfa0ead2a79203c522ce02cbe9394","user":{"login":"dgquintas","id":120217,"avatar_url":"https://avatars.githubusercontent.com/u/120217?v=3","gravatar_id":"","url":"https://api.github.com/users/dgquintas","html_url":"https://github.com/dgquintas","followers_url":"https://api.github.com/users/dgquintas/followers","following_url":"https://api.github.com/users/dgquintas/following{/other_user}","gists_url":"https://api.github.com/users/dgquintas/gists{/gist_id}","starred_url":"https://api.github.com/users/dgquintas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgquintas/subscriptions","organizations_url":"https://api.github.com/users/dgquintas/orgs","repos_url":"https://api.github.com/users/dgquintas/repos","events_url":"https://api.github.com/users/dgquintas/events{/privacy}","received_events_url":"https://api.github.com/users/dgquintas/received_events","type":"User","site_admin":false},"repo":{"id":34546298,"name":"grpc","full_name":"dgquintas/grpc","owner":{"login":"dgquintas","id":120217,"avatar_url":"https://avatars.githubusercontent.com/u/120217?v=3","gravatar_id":"","url":"https://api.github.com/users/dgquintas","html_url":"https://github.com/dgquintas","followers_url":"https://api.github.com/users/dgquintas/followers","following_url":"https://api.github.com/users/dgquintas/following{/other_user}","gists_url":"https://api.github.com/users/dgquintas/gists{/gist_id}","starred_url":"https://api.github.com/users/dgquintas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgquintas/subscriptions","organizations_url":"https://api.github.com/users/dgquintas/orgs","repos_url":"https://api.github.com/users/dgquintas/repos","events_url":"https://api.github.com/users/dgquintas/events{/privacy}","received_events_url":"https://api.github.com/users/dgquintas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgquintas/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":true,"url":"https://api.github.com/repos/dgquintas/grpc","forks_url":"https://api.github.com/repos/dgquintas/grpc/forks","keys_url":"https://api.github.com/repos/dgquintas/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgquintas/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgquintas/grpc/teams","hooks_url":"https://api.github.com/repos/dgquintas/grpc/hooks","issue_events_url":"https://api.github.com/repos/dgquintas/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/dgquintas/grpc/events","assignees_url":"https://api.github.com/repos/dgquintas/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/dgquintas/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/dgquintas/grpc/tags","blobs_url":"https://api.github.com/repos/dgquintas/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgquintas/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgquintas/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgquintas/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgquintas/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/dgquintas/grpc/languages","stargazers_url":"https://api.github.com/repos/dgquintas/grpc/stargazers","contributors_url":"https://api.github.com/repos/dgquintas/grpc/contributors","subscribers_url":"https://api.github.com/repos/dgquintas/grpc/subscribers","subscription_url":"https://api.github.com/repos/dgquintas/grpc/subscription","commits_url":"https://api.github.com/repos/dgquintas/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgquintas/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgquintas/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgquintas/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgquintas/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/dgquintas/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgquintas/grpc/merges","archive_url":"https://api.github.com/repos/dgquintas/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgquintas/grpc/downloads","issues_url":"https://api.github.com/repos/dgquintas/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/dgquintas/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/dgquintas/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/dgquintas/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgquintas/grpc/labels{/name}","releases_url":"https://api.github.com/repos/dgquintas/grpc/releases{/id}","created_at":"2015-04-24T23:07:11Z","updated_at":"2015-04-24T23:10:08Z","pushed_at":"2015-06-05T23:57:07Z","git_url":"git://github.com/dgquintas/grpc.git","ssh_url":"git@github.com:dgquintas/grpc.git","clone_url":"https://github.com/dgquintas/grpc.git","svn_url":"https://github.com/dgquintas/grpc","homepage":"","size":31411,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"6f61e9542da0cb5a878814ddcae1b2b58b34c8ac","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}","created_at":"2014-12-08T18:58:53Z","updated_at":"2015-06-06T16:03:41Z","pushed_at":"2015-06-06T01:37:31Z","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":53488,"stargazers_count":2685,"watchers_count":2685,"language":"C","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":363,"mirror_url":null,"open_issues_count":271,"forks":363,"open_issues":271,"watchers":2685,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/1963"},"html":{"href":"https://github.com/grpc/grpc/pull/1963"},"issue":{"href":"https://api.github.com/repos/grpc/grpc/issues/1963"},"comments":{"href":"https://api.github.com/repos/grpc/grpc/issues/1963/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc/pulls/1963/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc/pulls/1963/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc/statuses/25d02d56370bfa0ead2a79203c522ce02cbe9394"}}}}