grpc 0.14.1 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (277) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1398 -817
  3. data/include/grpc/compression.h +2 -1
  4. data/include/grpc/grpc.h +10 -1
  5. data/include/grpc/grpc_cronet.h +51 -0
  6. data/include/grpc/grpc_posix.h +70 -0
  7. data/include/grpc/impl/codegen/atm.h +2 -2
  8. data/include/grpc/impl/codegen/{atm_win32.h → atm_windows.h} +3 -3
  9. data/include/grpc/impl/codegen/compression_types.h +39 -5
  10. data/include/grpc/impl/codegen/connectivity_state.h +1 -1
  11. data/include/grpc/impl/codegen/grpc_types.h +10 -0
  12. data/include/grpc/impl/codegen/log.h +2 -1
  13. data/include/grpc/impl/codegen/port_platform.h +30 -12
  14. data/include/grpc/impl/codegen/slice_buffer.h +2 -3
  15. data/include/grpc/impl/codegen/sync.h +2 -2
  16. data/include/grpc/impl/codegen/{sync_win32.h → sync_windows.h} +3 -3
  17. data/include/grpc/support/{sync_win32.h → atm_windows.h} +4 -4
  18. data/include/grpc/support/avl.h +5 -0
  19. data/include/grpc/support/{log_win32.h → log_windows.h} +3 -3
  20. data/include/grpc/support/string_util.h +2 -1
  21. data/include/grpc/support/{atm_win32.h → sync_windows.h} +4 -4
  22. data/src/core/ext/census/gen/census.pb.c +179 -0
  23. data/src/core/ext/census/gen/census.pb.h +294 -0
  24. data/src/core/ext/census/grpc_filter.c +11 -7
  25. data/src/core/ext/client_config/channel_connectivity.c +28 -14
  26. data/src/core/ext/client_config/client_channel.c +77 -53
  27. data/src/core/ext/client_config/connector.h +1 -1
  28. data/src/core/ext/client_config/lb_policy.c +9 -6
  29. data/src/core/ext/client_config/lb_policy.h +9 -5
  30. data/src/core/ext/client_config/subchannel.c +58 -39
  31. data/src/core/ext/client_config/subchannel.h +3 -2
  32. data/src/core/ext/client_config/subchannel_call_holder.c +34 -19
  33. data/src/core/ext/client_config/subchannel_call_holder.h +2 -1
  34. data/src/core/ext/client_config/subchannel_index.c +20 -9
  35. data/src/core/ext/lb_policy/grpclb/load_balancer_api.c +7 -7
  36. data/src/core/ext/lb_policy/grpclb/load_balancer_api.h +5 -5
  37. data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/{v0 → v1}/load_balancer.pb.c +29 -30
  38. data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +178 -0
  39. data/src/core/ext/lb_policy/pick_first/pick_first.c +65 -45
  40. data/src/core/ext/lb_policy/round_robin/round_robin.c +84 -43
  41. data/src/core/ext/load_reporting/load_reporting.c +133 -0
  42. data/src/core/ext/load_reporting/load_reporting.h +75 -0
  43. data/src/core/ext/load_reporting/load_reporting_filter.c +151 -0
  44. data/src/core/ext/load_reporting/load_reporting_filter.h +41 -0
  45. data/src/core/ext/resolver/dns/native/dns_resolver.c +22 -8
  46. data/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +2 -2
  47. data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +4 -4
  48. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c +95 -0
  49. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +14 -18
  50. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +49 -24
  51. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +82 -0
  52. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +104 -60
  53. data/src/core/ext/transport/chttp2/transport/bin_decoder.c +232 -0
  54. data/src/{ruby/ext/grpc/rb_signal.c → core/ext/transport/chttp2/transport/bin_decoder.h} +27 -31
  55. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +481 -260
  56. data/src/core/ext/transport/chttp2/transport/frame.h +1 -7
  57. data/src/core/ext/transport/chttp2/transport/frame_data.c +44 -27
  58. data/src/core/ext/transport/chttp2/transport/frame_data.h +6 -5
  59. data/src/core/ext/transport/chttp2/transport/frame_goaway.c +23 -17
  60. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +2 -2
  61. data/src/core/ext/transport/chttp2/transport/frame_ping.c +12 -7
  62. data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
  63. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +25 -12
  64. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +2 -2
  65. data/src/core/ext/transport/chttp2/transport/frame_settings.c +23 -21
  66. data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -2
  67. data/src/core/ext/transport/chttp2/transport/frame_window_update.c +17 -9
  68. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +2 -2
  69. data/src/core/ext/transport/chttp2/transport/hpack_parser.c +365 -287
  70. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -6
  71. data/src/core/ext/transport/chttp2/transport/hpack_table.c +24 -20
  72. data/src/core/ext/transport/chttp2/transport/hpack_table.h +5 -4
  73. data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +1 -0
  74. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +1 -0
  75. data/src/core/ext/transport/chttp2/transport/internal.h +34 -32
  76. data/src/core/ext/transport/chttp2/transport/parsing.c +296 -212
  77. data/src/core/ext/transport/chttp2/transport/writing.c +12 -9
  78. data/src/core/lib/channel/channel_args.c +26 -12
  79. data/src/core/lib/channel/channel_args.h +1 -1
  80. data/src/core/lib/channel/channel_stack.c +12 -8
  81. data/src/core/lib/channel/channel_stack.h +27 -11
  82. data/src/core/lib/channel/channel_stack_builder.c +2 -2
  83. data/src/core/lib/channel/compress_filter.c +26 -31
  84. data/src/core/lib/channel/compress_filter.h +4 -4
  85. data/src/core/lib/channel/connected_channel.c +7 -5
  86. data/src/core/lib/channel/http_client_filter.c +34 -8
  87. data/src/core/lib/channel/http_client_filter.h +1 -1
  88. data/src/core/lib/channel/http_server_filter.c +21 -12
  89. data/src/core/lib/compression/{compression_algorithm.c → compression.c} +22 -21
  90. data/src/core/lib/http/httpcli.c +81 -59
  91. data/src/core/lib/http/httpcli.h +11 -15
  92. data/src/core/lib/http/httpcli_security_connector.c +5 -3
  93. data/src/core/lib/http/parser.c +127 -118
  94. data/src/core/lib/http/parser.h +11 -6
  95. data/src/core/lib/iomgr/closure.c +20 -16
  96. data/src/core/lib/iomgr/closure.h +19 -15
  97. data/src/core/lib/iomgr/endpoint.h +1 -1
  98. data/src/core/lib/iomgr/endpoint_pair_posix.c +2 -2
  99. data/src/core/lib/iomgr/error.c +535 -0
  100. data/src/core/lib/iomgr/error.h +192 -0
  101. data/src/core/lib/iomgr/ev_poll_and_epoll_posix.c +190 -83
  102. data/src/core/lib/iomgr/ev_poll_posix.c +1267 -0
  103. data/src/{ruby/ext/grpc/rb_signal.h → core/lib/iomgr/ev_poll_posix.h} +7 -5
  104. data/src/core/lib/iomgr/ev_posix.c +104 -14
  105. data/src/core/lib/iomgr/ev_posix.h +17 -7
  106. data/src/core/lib/iomgr/exec_ctx.c +25 -7
  107. data/src/core/lib/iomgr/exec_ctx.h +27 -8
  108. data/src/core/lib/iomgr/executor.c +2 -2
  109. data/src/core/lib/iomgr/executor.h +1 -1
  110. data/src/core/lib/iomgr/iocp_windows.c +2 -41
  111. data/src/core/lib/iomgr/iocp_windows.h +0 -8
  112. data/src/core/lib/iomgr/iomgr.c +5 -4
  113. data/src/core/lib/iomgr/iomgr_posix.c +5 -1
  114. data/src/core/lib/iomgr/iomgr_windows.c +1 -1
  115. data/src/core/lib/{support → iomgr}/load_file.c +15 -17
  116. data/src/core/lib/{support → iomgr}/load_file.h +8 -7
  117. data/src/core/lib/iomgr/polling_entity.c +104 -0
  118. data/src/core/lib/iomgr/polling_entity.h +81 -0
  119. data/src/core/lib/iomgr/pollset.h +6 -5
  120. data/src/core/lib/iomgr/pollset_set_windows.c +4 -1
  121. data/src/core/lib/iomgr/pollset_windows.c +10 -6
  122. data/src/core/lib/iomgr/resolve_address.h +5 -9
  123. data/src/core/lib/iomgr/resolve_address_posix.c +55 -38
  124. data/src/core/lib/iomgr/resolve_address_windows.c +51 -37
  125. data/src/core/lib/iomgr/sockaddr.h +2 -2
  126. data/src/core/lib/iomgr/{sockaddr_win32.h → sockaddr_windows.h} +3 -3
  127. data/src/core/lib/iomgr/socket_utils_common_posix.c +92 -45
  128. data/src/core/lib/iomgr/socket_utils_posix.h +19 -12
  129. data/src/core/lib/iomgr/socket_windows.c +61 -2
  130. data/src/core/lib/iomgr/socket_windows.h +13 -0
  131. data/src/core/lib/iomgr/tcp_client_posix.c +54 -39
  132. data/src/core/lib/iomgr/tcp_client_windows.c +34 -34
  133. data/src/core/lib/iomgr/tcp_posix.c +43 -39
  134. data/src/core/lib/iomgr/tcp_server.h +5 -3
  135. data/src/core/lib/iomgr/tcp_server_posix.c +103 -64
  136. data/src/core/lib/iomgr/tcp_server_windows.c +114 -101
  137. data/src/core/lib/iomgr/tcp_windows.c +45 -50
  138. data/src/core/lib/iomgr/tcp_windows.h +1 -1
  139. data/src/core/lib/iomgr/timer.c +26 -13
  140. data/src/core/lib/iomgr/udp_server.c +28 -4
  141. data/src/core/lib/iomgr/udp_server.h +5 -1
  142. data/src/core/lib/iomgr/unix_sockets_posix.c +8 -7
  143. data/src/core/lib/iomgr/unix_sockets_posix.h +2 -1
  144. data/src/core/lib/iomgr/unix_sockets_posix_noop.c +4 -2
  145. data/src/core/lib/iomgr/wakeup_fd_eventfd.c +15 -5
  146. data/src/core/lib/iomgr/wakeup_fd_pipe.c +13 -9
  147. data/src/core/lib/iomgr/wakeup_fd_posix.c +6 -6
  148. data/src/core/lib/iomgr/wakeup_fd_posix.h +9 -6
  149. data/src/core/lib/iomgr/workqueue.h +5 -4
  150. data/src/core/lib/iomgr/workqueue_posix.c +40 -26
  151. data/src/core/lib/iomgr/workqueue_windows.c +2 -2
  152. data/src/core/lib/profiling/basic_timers.c +2 -2
  153. data/src/core/lib/security/{security_context.c → context/security_context.c} +1 -1
  154. data/src/core/lib/security/{security_context.h → context/security_context.h} +4 -4
  155. data/src/core/lib/security/credentials/composite/composite_credentials.c +263 -0
  156. data/src/core/lib/security/credentials/composite/composite_credentials.h +72 -0
  157. data/src/core/lib/security/credentials/credentials.c +233 -0
  158. data/src/core/lib/security/{credentials.h → credentials/credentials.h} +19 -157
  159. data/src/core/lib/security/{credentials_metadata.c → credentials/credentials_metadata.c} +1 -1
  160. data/src/core/lib/security/credentials/fake/fake_credentials.c +139 -0
  161. data/src/core/lib/security/credentials/fake/fake_credentials.h +56 -0
  162. data/src/core/lib/security/{credentials_posix.c → credentials/google_default/credentials_posix.c} +1 -1
  163. data/src/core/lib/security/{credentials_win32.c → credentials/google_default/credentials_windows.c} +3 -3
  164. data/src/core/lib/security/{google_default_credentials.c → credentials/google_default/google_default_credentials.c} +93 -35
  165. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +46 -0
  166. data/src/core/lib/security/credentials/iam/iam_credentials.c +85 -0
  167. data/src/core/lib/security/credentials/iam/iam_credentials.h +44 -0
  168. data/src/core/lib/security/{json_token.c → credentials/jwt/json_token.c} +10 -101
  169. data/src/core/lib/security/{json_token.h → credentials/jwt/json_token.h} +3 -33
  170. data/src/core/lib/security/credentials/jwt/jwt_credentials.c +160 -0
  171. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +62 -0
  172. data/src/core/lib/security/{jwt_verifier.c → credentials/jwt/jwt_verifier.c} +35 -15
  173. data/src/core/lib/security/{jwt_verifier.h → credentials/jwt/jwt_verifier.h} +3 -3
  174. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +433 -0
  175. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +109 -0
  176. data/src/core/lib/security/credentials/plugin/plugin_credentials.c +129 -0
  177. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +45 -0
  178. data/src/core/lib/security/credentials/ssl/ssl_credentials.c +240 -0
  179. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +48 -0
  180. data/src/core/lib/security/{auth_filters.h → transport/auth_filters.h} +3 -3
  181. data/src/core/lib/security/{client_auth_filter.c → transport/client_auth_filter.c} +27 -20
  182. data/src/core/lib/security/{handshake.c → transport/handshake.c} +77 -45
  183. data/src/core/lib/security/{handshake.h → transport/handshake.h} +9 -11
  184. data/src/core/lib/security/{secure_endpoint.c → transport/secure_endpoint.c} +19 -12
  185. data/src/core/lib/security/{secure_endpoint.h → transport/secure_endpoint.h} +3 -3
  186. data/src/core/lib/security/{security_connector.c → transport/security_connector.c} +26 -17
  187. data/src/core/lib/security/{security_connector.h → transport/security_connector.h} +8 -8
  188. data/src/core/lib/security/{server_auth_filter.c → transport/server_auth_filter.c} +24 -16
  189. data/src/core/lib/security/transport/tsi_error.c +40 -0
  190. data/src/core/lib/security/transport/tsi_error.h +42 -0
  191. data/src/core/lib/security/{b64.c → util/b64.c} +1 -1
  192. data/src/core/lib/security/{b64.h → util/b64.h} +3 -3
  193. data/src/core/lib/security/util/json_util.c +61 -0
  194. data/src/core/lib/security/util/json_util.h +55 -0
  195. data/src/core/lib/support/avl.c +11 -0
  196. data/src/core/lib/support/cpu_windows.c +2 -2
  197. data/src/core/lib/support/{env_win32.c → env_windows.c} +3 -3
  198. data/src/core/lib/support/log.c +3 -1
  199. data/src/core/lib/support/log_linux.c +2 -2
  200. data/src/core/lib/support/{log_win32.c → log_windows.c} +4 -4
  201. data/src/core/lib/support/murmur_hash.c +3 -5
  202. data/src/core/lib/support/string.c +10 -0
  203. data/src/core/lib/support/string.h +4 -0
  204. data/src/core/lib/support/{string_util_win32.c → string_util_windows.c} +3 -3
  205. data/src/core/lib/support/{string_win32.c → string_windows.c} +2 -2
  206. data/src/core/lib/support/{string_win32.h → string_windows.h} +5 -5
  207. data/src/core/lib/support/subprocess_windows.c +1 -1
  208. data/src/core/lib/support/{sync_win32.c → sync_windows.c} +2 -2
  209. data/src/core/lib/support/{thd_win32.c → thd_windows.c} +2 -2
  210. data/src/core/lib/support/{time_win32.c → time_windows.c} +2 -2
  211. data/src/core/lib/support/tmpfile_msys.c +1 -1
  212. data/src/core/lib/support/{tmpfile_win32.c → tmpfile_windows.c} +3 -3
  213. data/src/core/lib/surface/alarm.c +2 -2
  214. data/src/core/lib/surface/byte_buffer_reader.c +13 -6
  215. data/src/core/lib/surface/call.c +323 -123
  216. data/src/core/lib/surface/call.h +2 -0
  217. data/src/core/lib/surface/call_log_batch.c +1 -1
  218. data/src/core/lib/surface/channel.c +64 -15
  219. data/src/core/lib/surface/channel.h +9 -0
  220. data/src/core/lib/surface/channel_ping.c +3 -3
  221. data/src/core/lib/surface/completion_queue.c +75 -19
  222. data/src/core/lib/surface/completion_queue.h +7 -2
  223. data/src/core/lib/surface/init.c +2 -1
  224. data/src/core/lib/surface/init_secure.c +4 -4
  225. data/src/core/lib/surface/lame_client.c +12 -8
  226. data/src/core/lib/surface/server.c +213 -120
  227. data/src/core/lib/surface/server.h +1 -0
  228. data/src/core/lib/surface/version.c +1 -1
  229. data/src/core/lib/transport/connectivity_state.c +40 -18
  230. data/src/core/lib/transport/connectivity_state.h +4 -1
  231. data/src/core/lib/transport/metadata.c +23 -23
  232. data/src/core/lib/transport/metadata.h +4 -0
  233. data/src/core/lib/transport/metadata_batch.c +9 -0
  234. data/src/core/lib/transport/metadata_batch.h +3 -0
  235. data/src/core/lib/transport/static_metadata.c +6 -5
  236. data/src/core/lib/transport/static_metadata.h +64 -60
  237. data/src/core/lib/transport/transport.c +24 -12
  238. data/src/core/lib/transport/transport.h +6 -5
  239. data/src/core/lib/transport/transport_impl.h +4 -0
  240. data/src/core/lib/transport/transport_op_string.c +2 -2
  241. data/src/core/plugin_registry/grpc_plugin_registry.c +4 -0
  242. data/src/ruby/bin/math_services.rb +41 -2
  243. data/src/ruby/ext/grpc/rb_call.c +42 -40
  244. data/src/ruby/ext/grpc/rb_channel.c +1 -1
  245. data/src/ruby/ext/grpc/rb_completion_queue.c +59 -6
  246. data/src/ruby/ext/grpc/rb_completion_queue.h +1 -1
  247. data/src/ruby/ext/grpc/rb_grpc.c +1 -3
  248. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -2
  249. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +21 -5
  250. data/src/ruby/ext/grpc/rb_loader.c +1 -1
  251. data/src/ruby/ext/grpc/rb_server.c +5 -3
  252. data/src/ruby/lib/grpc.rb +0 -3
  253. data/src/ruby/lib/grpc/errors.rb +3 -2
  254. data/src/ruby/lib/grpc/generic/active_call.rb +32 -42
  255. data/src/ruby/lib/grpc/generic/bidi_call.rb +20 -0
  256. data/src/ruby/lib/grpc/generic/client_stub.rb +31 -54
  257. data/src/ruby/lib/grpc/generic/rpc_desc.rb +4 -4
  258. data/src/ruby/lib/grpc/generic/rpc_server.rb +12 -23
  259. data/src/ruby/lib/grpc/generic/service.rb +8 -8
  260. data/src/ruby/lib/grpc/version.rb +1 -1
  261. data/src/ruby/pb/grpc/health/v1/health_services.rb +30 -2
  262. data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb +34 -4
  263. data/src/ruby/pb/grpc/testing/metrics_services.rb +39 -2
  264. data/src/ruby/pb/src/proto/grpc/testing/empty.rb +15 -0
  265. data/src/ruby/pb/src/proto/grpc/testing/messages.rb +84 -0
  266. data/src/ruby/pb/src/proto/grpc/testing/test.rb +14 -0
  267. data/src/ruby/pb/src/proto/grpc/testing/test_services.rb +110 -0
  268. data/src/ruby/pb/test/client.rb +5 -2
  269. data/src/ruby/spec/generic/active_call_spec.rb +3 -2
  270. data/src/ruby/spec/generic/client_stub_spec.rb +27 -24
  271. data/src/ruby/spec/generic/rpc_desc_spec.rb +11 -11
  272. data/src/ruby/spec/generic/rpc_server_spec.rb +42 -61
  273. data/src/ruby/spec/pb/health/checker_spec.rb +3 -5
  274. metadata +86 -48
  275. data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h +0 -182
  276. data/src/core/lib/security/credentials.c +0 -1296
  277. data/src/ruby/lib/grpc/signals.rb +0 -69
@@ -45,7 +45,7 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
45
45
 
46
46
  int grpc_chttp2_unlocking_check_writes(
47
47
  grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global,
48
- grpc_chttp2_transport_writing *transport_writing, int is_parsing) {
48
+ grpc_chttp2_transport_writing *transport_writing) {
49
49
  grpc_chttp2_stream_global *stream_global;
50
50
  grpc_chttp2_stream_writing *stream_writing;
51
51
 
@@ -61,7 +61,7 @@ int grpc_chttp2_unlocking_check_writes(
61
61
  [GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE]);
62
62
 
63
63
  if (transport_global->dirtied_local_settings &&
64
- !transport_global->sent_local_settings && !is_parsing) {
64
+ !transport_global->sent_local_settings) {
65
65
  gpr_slice_buffer_add(
66
66
  &transport_writing->outbuf,
67
67
  grpc_chttp2_settings_create(
@@ -187,7 +187,8 @@ void grpc_chttp2_perform_writes(
187
187
  grpc_endpoint_write(exec_ctx, endpoint, &transport_writing->outbuf,
188
188
  &transport_writing->done_cb);
189
189
  } else {
190
- grpc_exec_ctx_enqueue(exec_ctx, &transport_writing->done_cb, true, NULL);
190
+ grpc_exec_ctx_sched(exec_ctx, &transport_writing->done_cb, GRPC_ERROR_NONE,
191
+ NULL);
191
192
  }
192
193
  }
193
194
 
@@ -334,25 +335,27 @@ void grpc_chttp2_cleanup_writing(
334
335
  transport_global, transport_writing, &stream_global, &stream_writing)) {
335
336
  if (stream_writing->sent_initial_metadata) {
336
337
  grpc_chttp2_complete_closure_step(
337
- exec_ctx, stream_global,
338
- &stream_global->send_initial_metadata_finished, 1);
338
+ exec_ctx, transport_global, stream_global,
339
+ &stream_global->send_initial_metadata_finished, GRPC_ERROR_NONE);
339
340
  }
340
341
  grpc_transport_move_one_way_stats(&stream_writing->stats,
341
342
  &stream_global->stats.outgoing);
342
343
  if (stream_writing->sent_message) {
343
344
  GPR_ASSERT(stream_writing->send_message == NULL);
344
345
  grpc_chttp2_complete_closure_step(
345
- exec_ctx, stream_global, &stream_global->send_message_finished, 1);
346
+ exec_ctx, transport_global, stream_global,
347
+ &stream_global->send_message_finished, GRPC_ERROR_NONE);
346
348
  stream_writing->sent_message = 0;
347
349
  }
348
350
  if (stream_writing->sent_trailing_metadata) {
349
351
  grpc_chttp2_complete_closure_step(
350
- exec_ctx, stream_global,
351
- &stream_global->send_trailing_metadata_finished, 1);
352
+ exec_ctx, transport_global, stream_global,
353
+ &stream_global->send_trailing_metadata_finished, GRPC_ERROR_NONE);
352
354
  }
353
355
  if (stream_writing->sent_trailing_metadata) {
354
356
  grpc_chttp2_mark_stream_closed(exec_ctx, transport_global, stream_global,
355
- !transport_global->is_client, 1);
357
+ !transport_global->is_client, 1,
358
+ GRPC_ERROR_NONE);
356
359
  }
357
360
  GRPC_CHTTP2_STREAM_UNREF(exec_ctx, stream_global, "chttp2_writing");
358
361
  }
@@ -35,6 +35,7 @@
35
35
  #include <grpc/grpc.h>
36
36
  #include "src/core/lib/support/string.h"
37
37
 
38
+ #include <grpc/compression.h>
38
39
  #include <grpc/support/alloc.h>
39
40
  #include <grpc/support/log.h>
40
41
  #include <grpc/support/string_util.h>
@@ -132,7 +133,8 @@ grpc_channel_args *grpc_channel_args_normalize(const grpc_channel_args *a) {
132
133
  for (size_t i = 0; i < a->num_args; i++) {
133
134
  args[i] = &a->args[i];
134
135
  }
135
- qsort(args, a->num_args, sizeof(grpc_arg *), cmp_key_stable);
136
+ if (a->num_args > 1)
137
+ qsort(args, a->num_args, sizeof(grpc_arg *), cmp_key_stable);
136
138
 
137
139
  grpc_channel_args *b = gpr_malloc(sizeof(grpc_channel_args));
138
140
  b->num_args = a->num_args;
@@ -147,6 +149,7 @@ grpc_channel_args *grpc_channel_args_normalize(const grpc_channel_args *a) {
147
149
 
148
150
  void grpc_channel_args_destroy(grpc_channel_args *a) {
149
151
  size_t i;
152
+ if (!a) return;
150
153
  for (i = 0; i < a->num_args; i++) {
151
154
  switch (a->args[i].type) {
152
155
  case GRPC_ARG_STRING:
@@ -170,7 +173,7 @@ grpc_compression_algorithm grpc_channel_args_get_compression_algorithm(
170
173
  if (a == NULL) return 0;
171
174
  for (i = 0; i < a->num_args; ++i) {
172
175
  if (a->args[i].type == GRPC_ARG_INTEGER &&
173
- !strcmp(GRPC_COMPRESSION_ALGORITHM_ARG, a->args[i].key)) {
176
+ !strcmp(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM, a->args[i].key)) {
174
177
  return (grpc_compression_algorithm)a->args[i].value.integer;
175
178
  break;
176
179
  }
@@ -180,9 +183,10 @@ grpc_compression_algorithm grpc_channel_args_get_compression_algorithm(
180
183
 
181
184
  grpc_channel_args *grpc_channel_args_set_compression_algorithm(
182
185
  grpc_channel_args *a, grpc_compression_algorithm algorithm) {
186
+ GPR_ASSERT(algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT);
183
187
  grpc_arg tmp;
184
188
  tmp.type = GRPC_ARG_INTEGER;
185
- tmp.key = GRPC_COMPRESSION_ALGORITHM_ARG;
189
+ tmp.key = GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM;
186
190
  tmp.value.integer = algorithm;
187
191
  return grpc_channel_args_copy_and_add(a, &tmp, 1);
188
192
  }
@@ -196,9 +200,11 @@ static int find_compression_algorithm_states_bitset(const grpc_channel_args *a,
196
200
  size_t i;
197
201
  for (i = 0; i < a->num_args; ++i) {
198
202
  if (a->args[i].type == GRPC_ARG_INTEGER &&
199
- !strcmp(GRPC_COMPRESSION_ALGORITHM_STATE_ARG, a->args[i].key)) {
203
+ !strcmp(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET,
204
+ a->args[i].key)) {
200
205
  *states_arg = &a->args[i].value.integer;
201
- return 1; /* GPR_TRUE */
206
+ **states_arg |= 0x1; /* forcefully enable support for no compression */
207
+ return 1;
202
208
  }
203
209
  }
204
210
  }
@@ -207,27 +213,35 @@ static int find_compression_algorithm_states_bitset(const grpc_channel_args *a,
207
213
 
208
214
  grpc_channel_args *grpc_channel_args_compression_algorithm_set_state(
209
215
  grpc_channel_args **a, grpc_compression_algorithm algorithm, int state) {
210
- int *states_arg;
216
+ int *states_arg = NULL;
211
217
  grpc_channel_args *result = *a;
212
218
  const int states_arg_found =
213
219
  find_compression_algorithm_states_bitset(*a, &states_arg);
214
220
 
215
- if (states_arg_found) {
221
+ if (grpc_channel_args_get_compression_algorithm(*a) == algorithm &&
222
+ state == 0) {
223
+ char *algo_name = NULL;
224
+ GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algo_name) != 0);
225
+ gpr_log(GPR_ERROR,
226
+ "Tried to disable default compression algorithm '%s'. The "
227
+ "operation has been ignored.",
228
+ algo_name);
229
+ } else if (states_arg_found) {
216
230
  if (state != 0) {
217
231
  GPR_BITSET((unsigned *)states_arg, algorithm);
218
- } else {
232
+ } else if (algorithm != GRPC_COMPRESS_NONE) {
219
233
  GPR_BITCLEAR((unsigned *)states_arg, algorithm);
220
234
  }
221
235
  } else {
222
236
  /* create a new arg */
223
237
  grpc_arg tmp;
224
238
  tmp.type = GRPC_ARG_INTEGER;
225
- tmp.key = GRPC_COMPRESSION_ALGORITHM_STATE_ARG;
239
+ tmp.key = GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET;
226
240
  /* all enabled by default */
227
241
  tmp.value.integer = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
228
242
  if (state != 0) {
229
243
  GPR_BITSET((unsigned *)&tmp.value.integer, algorithm);
230
- } else {
244
+ } else if (algorithm != GRPC_COMPRESS_NONE) {
231
245
  GPR_BITCLEAR((unsigned *)&tmp.value.integer, algorithm);
232
246
  }
233
247
  result = grpc_channel_args_copy_and_add(*a, &tmp, 1);
@@ -237,11 +251,11 @@ grpc_channel_args *grpc_channel_args_compression_algorithm_set_state(
237
251
  return result;
238
252
  }
239
253
 
240
- int grpc_channel_args_compression_algorithm_get_states(
254
+ uint32_t grpc_channel_args_compression_algorithm_get_states(
241
255
  const grpc_channel_args *a) {
242
256
  int *states_arg;
243
257
  if (find_compression_algorithm_states_bitset(a, &states_arg)) {
244
- return *states_arg;
258
+ return (uint32_t)*states_arg;
245
259
  } else {
246
260
  return (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1; /* All algs. enabled */
247
261
  }
@@ -81,7 +81,7 @@ grpc_channel_args *grpc_channel_args_compression_algorithm_set_state(
81
81
  *
82
82
  * The i-th bit of the returned bitset corresponds to the i-th entry in the
83
83
  * grpc_compression_algorithm enum. */
84
- int grpc_channel_args_compression_algorithm_get_states(
84
+ uint32_t grpc_channel_args_compression_algorithm_get_states(
85
85
  const grpc_channel_args *a);
86
86
 
87
87
  int grpc_channel_args_compare(const grpc_channel_args *a,
@@ -106,6 +106,7 @@ void grpc_channel_stack_init(grpc_exec_ctx *exec_ctx, int initial_refs,
106
106
  const grpc_channel_filter **filters,
107
107
  size_t filter_count,
108
108
  const grpc_channel_args *channel_args,
109
+ grpc_transport *optional_transport,
109
110
  const char *name, grpc_channel_stack *stack) {
110
111
  size_t call_size =
111
112
  ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call_stack)) +
@@ -127,6 +128,7 @@ void grpc_channel_stack_init(grpc_exec_ctx *exec_ctx, int initial_refs,
127
128
  for (i = 0; i < filter_count; i++) {
128
129
  args.channel_stack = stack;
129
130
  args.channel_args = channel_args;
131
+ args.optional_transport = optional_transport;
130
132
  args.is_first = i == 0;
131
133
  args.is_last = i == (filter_count - 1);
132
134
  elems[i].filter = filters[i];
@@ -189,9 +191,9 @@ void grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
189
191
  }
190
192
  }
191
193
 
192
- void grpc_call_stack_set_pollset(grpc_exec_ctx *exec_ctx,
193
- grpc_call_stack *call_stack,
194
- grpc_pollset *pollset) {
194
+ void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
195
+ grpc_call_stack *call_stack,
196
+ grpc_polling_entity *pollent) {
195
197
  size_t count = call_stack->count;
196
198
  grpc_call_element *call_elems;
197
199
  char *user_data;
@@ -203,17 +205,19 @@ void grpc_call_stack_set_pollset(grpc_exec_ctx *exec_ctx,
203
205
 
204
206
  /* init per-filter data */
205
207
  for (i = 0; i < count; i++) {
206
- call_elems[i].filter->set_pollset(exec_ctx, &call_elems[i], pollset);
208
+ call_elems[i].filter->set_pollset_or_pollset_set(exec_ctx, &call_elems[i],
209
+ pollent);
207
210
  user_data +=
208
211
  ROUND_UP_TO_ALIGNMENT_SIZE(call_elems[i].filter->sizeof_call_data);
209
212
  }
210
213
  }
211
214
 
212
- void grpc_call_stack_ignore_set_pollset(grpc_exec_ctx *exec_ctx,
213
- grpc_call_element *elem,
214
- grpc_pollset *pollset) {}
215
+ void grpc_call_stack_ignore_set_pollset_or_pollset_set(
216
+ grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
217
+ grpc_polling_entity *pollent) {}
215
218
 
216
219
  void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack,
220
+ const grpc_call_stats *call_stats,
217
221
  void *and_free_memory) {
218
222
  grpc_call_element *elems = CALL_ELEMS_FROM_STACK(stack);
219
223
  size_t count = stack->count;
@@ -221,7 +225,7 @@ void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack,
221
225
 
222
226
  /* destroy per-filter data */
223
227
  for (i = 0; i < count; i++) {
224
- elems[i].filter->destroy_call_elem(exec_ctx, &elems[i],
228
+ elems[i].filter->destroy_call_elem(exec_ctx, &elems[i], call_stats,
225
229
  i == count - 1 ? and_free_memory : NULL);
226
230
  }
227
231
  }
@@ -45,7 +45,10 @@
45
45
 
46
46
  #include <grpc/grpc.h>
47
47
  #include <grpc/support/log.h>
48
+ #include <grpc/support/time.h>
49
+
48
50
  #include "src/core/lib/debug/trace.h"
51
+ #include "src/core/lib/iomgr/polling_entity.h"
49
52
  #include "src/core/lib/transport/transport.h"
50
53
 
51
54
  typedef struct grpc_channel_element grpc_channel_element;
@@ -57,6 +60,8 @@ typedef struct grpc_call_stack grpc_call_stack;
57
60
  typedef struct {
58
61
  grpc_channel_stack *channel_stack;
59
62
  const grpc_channel_args *channel_args;
63
+ /** Transport, iff it is known */
64
+ grpc_transport *optional_transport;
60
65
  int is_first;
61
66
  int is_last;
62
67
  } grpc_channel_element_args;
@@ -67,6 +72,12 @@ typedef struct {
67
72
  grpc_call_context_element *context;
68
73
  } grpc_call_element_args;
69
74
 
75
+ typedef struct {
76
+ grpc_transport_stream_stats transport_stream_stats;
77
+ gpr_timespec latency; /* From call creating to enqueing of received status */
78
+ grpc_status_code final_status;
79
+ } grpc_call_stats;
80
+
70
81
  /* Channel filters specify:
71
82
  1. the amount of memory needed in the channel & call (via the sizeof_XXX
72
83
  members)
@@ -101,14 +112,16 @@ typedef struct {
101
112
  argument. */
102
113
  void (*init_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
103
114
  grpc_call_element_args *args);
104
- void (*set_pollset)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
105
- grpc_pollset *pollset);
115
+ void (*set_pollset_or_pollset_set)(grpc_exec_ctx *exec_ctx,
116
+ grpc_call_element *elem,
117
+ grpc_polling_entity *pollent);
106
118
  /* Destroy per call data.
107
119
  The filter does not need to do any chaining.
108
120
  The bottom filter of a stack will be passed a non-NULL pointer to
109
121
  \a and_free_memory that should be passed to gpr_free when destruction
110
122
  is complete. */
111
123
  void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
124
+ const grpc_call_stats *stats,
112
125
  void *and_free_memory);
113
126
 
114
127
  /* sizeof(per channel data) */
@@ -187,6 +200,7 @@ void grpc_channel_stack_init(grpc_exec_ctx *exec_ctx, int initial_refs,
187
200
  grpc_iomgr_cb_func destroy, void *destroy_arg,
188
201
  const grpc_channel_filter **filters,
189
202
  size_t filter_count, const grpc_channel_args *args,
203
+ grpc_transport *optional_transport,
190
204
  const char *name, grpc_channel_stack *stack);
191
205
  /* Destroy a channel stack */
192
206
  void grpc_channel_stack_destroy(grpc_exec_ctx *exec_ctx,
@@ -201,10 +215,11 @@ void grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
201
215
  grpc_call_context_element *context,
202
216
  const void *transport_server_data,
203
217
  grpc_call_stack *call_stack);
204
- /* Set a pollset for a call stack: must occur before the first op is started */
205
- void grpc_call_stack_set_pollset(grpc_exec_ctx *exec_ctx,
206
- grpc_call_stack *call_stack,
207
- grpc_pollset *pollset);
218
+ /* Set a pollset or a pollset_set for a call stack: must occur before the first
219
+ * op is started */
220
+ void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
221
+ grpc_call_stack *call_stack,
222
+ grpc_polling_entity *pollent);
208
223
 
209
224
  #ifdef GRPC_STREAM_REFCOUNT_DEBUG
210
225
  #define GRPC_CALL_STACK_REF(call_stack, reason) \
@@ -228,13 +243,14 @@ void grpc_call_stack_set_pollset(grpc_exec_ctx *exec_ctx,
228
243
 
229
244
  /* Destroy a call stack */
230
245
  void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack,
246
+ const grpc_call_stats *call_stats,
231
247
  void *and_free_memory);
232
248
 
233
- /* Ignore set pollset - used by filters to implement the set_pollset method
234
- if they don't care about pollsets at all. Does nothing. */
235
- void grpc_call_stack_ignore_set_pollset(grpc_exec_ctx *exec_ctx,
236
- grpc_call_element *elem,
237
- grpc_pollset *pollset);
249
+ /* Ignore set pollset{_set} - used by filters if they don't care about pollsets
250
+ * at all. Does nothing. */
251
+ void grpc_call_stack_ignore_set_pollset_or_pollset_set(
252
+ grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
253
+ grpc_polling_entity *pollent);
238
254
  /* Call the next operation in a call stack */
239
255
  void grpc_call_next_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
240
256
  grpc_transport_stream_op *op);
@@ -257,8 +257,8 @@ void *grpc_channel_stack_builder_finish(grpc_exec_ctx *exec_ctx,
257
257
  // and initialize it
258
258
  grpc_channel_stack_init(exec_ctx, initial_refs, destroy,
259
259
  destroy_arg == NULL ? result : destroy_arg, filters,
260
- num_filters, builder->args, builder->name,
261
- channel_stack);
260
+ num_filters, builder->args, builder->transport,
261
+ builder->name, channel_stack);
262
262
 
263
263
  // run post-initialization functions
264
264
  i = 0;
@@ -47,7 +47,7 @@
47
47
  #include "src/core/lib/support/string.h"
48
48
  #include "src/core/lib/transport/static_metadata.h"
49
49
 
50
- int grpc_compress_filter_trace = 0;
50
+ int grpc_compression_trace = 0;
51
51
 
52
52
  typedef struct call_data {
53
53
  gpr_slice_buffer slices; /**< Buffers up input slices to be compressed */
@@ -73,8 +73,8 @@ typedef struct call_data {
73
73
  typedef struct channel_data {
74
74
  /** The default, channel-level, compression algorithm */
75
75
  grpc_compression_algorithm default_compression_algorithm;
76
- /** Compression options for the channel */
77
- grpc_compression_options compression_options;
76
+ /** Bitset of enabled algorithms */
77
+ uint32_t enabled_algorithms_bitset;
78
78
  /** Supported compression algorithms */
79
79
  uint32_t supported_compression_algorithms;
80
80
  } channel_data;
@@ -96,9 +96,8 @@ static grpc_mdelem *compression_md_filter(void *user_data, grpc_mdelem *md) {
96
96
  md_c_str);
97
97
  calld->compression_algorithm = GRPC_COMPRESS_NONE;
98
98
  }
99
- if (grpc_compression_options_is_algorithm_enabled(
100
- &channeld->compression_options, calld->compression_algorithm) ==
101
- 0) {
99
+ if (!GPR_BITGET(channeld->enabled_algorithms_bitset,
100
+ calld->compression_algorithm)) {
102
101
  gpr_log(GPR_ERROR,
103
102
  "Invalid compression algorithm: '%s' (previously disabled). "
104
103
  "Ignoring.",
@@ -155,11 +154,11 @@ static void process_send_initial_metadata(
155
154
  static void continue_send_message(grpc_exec_ctx *exec_ctx,
156
155
  grpc_call_element *elem);
157
156
 
158
- static void send_done(grpc_exec_ctx *exec_ctx, void *elemp, bool success) {
157
+ static void send_done(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) {
159
158
  grpc_call_element *elem = elemp;
160
159
  call_data *calld = elem->call_data;
161
160
  gpr_slice_buffer_reset_and_unref(&calld->slices);
162
- calld->post_send->cb(exec_ctx, calld->post_send->cb_arg, success);
161
+ calld->post_send->cb(exec_ctx, calld->post_send->cb_arg, error);
163
162
  }
164
163
 
165
164
  static void finish_send_message(grpc_exec_ctx *exec_ctx,
@@ -171,26 +170,28 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx,
171
170
  did_compress =
172
171
  grpc_msg_compress(calld->compression_algorithm, &calld->slices, &tmp);
173
172
  if (did_compress) {
174
- if (grpc_compress_filter_trace) {
173
+ if (grpc_compression_trace) {
175
174
  char *algo_name;
176
175
  const size_t before_size = calld->slices.length;
177
176
  const size_t after_size = tmp.length;
178
177
  const float savings_ratio = 1.0f - (float)after_size / (float)before_size;
179
178
  GPR_ASSERT(grpc_compression_algorithm_name(calld->compression_algorithm,
180
179
  &algo_name));
181
- gpr_log(GPR_DEBUG,
182
- "Compressed[%s] %d bytes vs. %d bytes (%.2f%% savings)",
180
+ gpr_log(GPR_DEBUG, "Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR
181
+ " bytes (%.2f%% savings)",
183
182
  algo_name, before_size, after_size, 100 * savings_ratio);
184
183
  }
185
184
  gpr_slice_buffer_swap(&calld->slices, &tmp);
186
185
  calld->send_flags |= GRPC_WRITE_INTERNAL_COMPRESS;
187
186
  } else {
188
- if (grpc_compress_filter_trace) {
187
+ if (grpc_compression_trace) {
189
188
  char *algo_name;
190
189
  GPR_ASSERT(grpc_compression_algorithm_name(calld->compression_algorithm,
191
190
  &algo_name));
192
- gpr_log(GPR_DEBUG, "Algorithm '%s' enabled but decided not to compress.",
193
- algo_name);
191
+ gpr_log(GPR_DEBUG,
192
+ "Algorithm '%s' enabled but decided not to compress. Input size: "
193
+ "%" PRIuPTR,
194
+ algo_name, calld->slices.length);
194
195
  }
195
196
  }
196
197
 
@@ -205,7 +206,7 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx,
205
206
  grpc_call_next_op(exec_ctx, elem, &calld->send_op);
206
207
  }
207
208
 
208
- static void got_slice(grpc_exec_ctx *exec_ctx, void *elemp, bool success) {
209
+ static void got_slice(grpc_exec_ctx *exec_ctx, void *elemp, grpc_error *error) {
209
210
  grpc_call_element *elem = elemp;
210
211
  call_data *calld = elem->call_data;
211
212
  gpr_slice_buffer_add(&calld->slices, calld->incoming_slice);
@@ -269,7 +270,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
269
270
 
270
271
  /* Destructor for call_data */
271
272
  static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
272
- void *ignored) {
273
+ const grpc_call_stats *stats, void *ignored) {
273
274
  /* grab pointers to our data from the call element */
274
275
  call_data *calld = elem->call_data;
275
276
  gpr_slice_buffer_destroy(&calld->slices);
@@ -280,32 +281,26 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx,
280
281
  grpc_channel_element *elem,
281
282
  grpc_channel_element_args *args) {
282
283
  channel_data *channeld = elem->channel_data;
283
- grpc_compression_algorithm algo_idx;
284
284
 
285
- grpc_compression_options_init(&channeld->compression_options);
286
- channeld->compression_options.enabled_algorithms_bitset =
287
- (uint32_t)grpc_channel_args_compression_algorithm_get_states(
288
- args->channel_args);
285
+ channeld->enabled_algorithms_bitset =
286
+ grpc_channel_args_compression_algorithm_get_states(args->channel_args);
289
287
 
290
288
  channeld->default_compression_algorithm =
291
289
  grpc_channel_args_get_compression_algorithm(args->channel_args);
292
290
  /* Make sure the default isn't disabled. */
293
- if (!grpc_compression_options_is_algorithm_enabled(
294
- &channeld->compression_options,
295
- channeld->default_compression_algorithm)) {
291
+ if (!GPR_BITGET(channeld->enabled_algorithms_bitset,
292
+ channeld->default_compression_algorithm)) {
296
293
  gpr_log(GPR_DEBUG,
297
294
  "compression algorithm %d not enabled: switching to none",
298
295
  channeld->default_compression_algorithm);
299
296
  channeld->default_compression_algorithm = GRPC_COMPRESS_NONE;
300
297
  }
301
- channeld->compression_options.default_compression_algorithm =
302
- channeld->default_compression_algorithm;
303
298
 
304
- channeld->supported_compression_algorithms = 0;
305
- for (algo_idx = 0; algo_idx < GRPC_COMPRESS_ALGORITHMS_COUNT; ++algo_idx) {
299
+ channeld->supported_compression_algorithms = 1; /* always support identity */
300
+ for (grpc_compression_algorithm algo_idx = 1;
301
+ algo_idx < GRPC_COMPRESS_ALGORITHMS_COUNT; ++algo_idx) {
306
302
  /* skip disabled algorithms */
307
- if (grpc_compression_options_is_algorithm_enabled(
308
- &channeld->compression_options, algo_idx) == 0) {
303
+ if (!GPR_BITGET(channeld->enabled_algorithms_bitset, algo_idx)) {
309
304
  continue;
310
305
  }
311
306
  channeld->supported_compression_algorithms |= 1u << algo_idx;
@@ -323,7 +318,7 @@ const grpc_channel_filter grpc_compress_filter = {
323
318
  grpc_channel_next_op,
324
319
  sizeof(call_data),
325
320
  init_call_elem,
326
- grpc_call_stack_ignore_set_pollset,
321
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
327
322
  destroy_call_elem,
328
323
  sizeof(channel_data),
329
324
  init_channel_elem,