grpc 1.7.3 → 1.8.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 (616) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +2106 -2116
  3. data/include/grpc/census.h +1 -432
  4. data/include/grpc/compression.h +9 -9
  5. data/include/grpc/grpc.h +115 -98
  6. data/include/grpc/grpc_cronet.h +3 -3
  7. data/include/grpc/grpc_posix.h +4 -4
  8. data/include/grpc/grpc_security.h +160 -88
  9. data/include/grpc/grpc_security_constants.h +7 -0
  10. data/include/grpc/impl/codegen/atm.h +9 -1
  11. data/include/grpc/impl/codegen/atm_gcc_atomic.h +13 -4
  12. data/include/grpc/impl/codegen/atm_gcc_sync.h +6 -5
  13. data/include/grpc/impl/codegen/atm_windows.h +23 -22
  14. data/include/grpc/impl/codegen/byte_buffer.h +14 -14
  15. data/include/grpc/impl/codegen/byte_buffer_reader.h +2 -2
  16. data/include/grpc/impl/codegen/connectivity_state.h +0 -2
  17. data/include/grpc/impl/codegen/grpc_types.h +32 -28
  18. data/include/grpc/impl/codegen/port_platform.h +48 -0
  19. data/include/grpc/impl/codegen/slice.h +10 -10
  20. data/include/grpc/impl/codegen/sync_generic.h +9 -3
  21. data/include/grpc/slice.h +16 -17
  22. data/include/grpc/slice_buffer.h +22 -22
  23. data/include/grpc/support/alloc.h +11 -11
  24. data/include/grpc/support/avl.h +28 -20
  25. data/include/grpc/support/cmdline.h +13 -13
  26. data/include/grpc/support/histogram.h +17 -17
  27. data/include/grpc/support/host_port.h +2 -2
  28. data/include/grpc/support/log.h +9 -9
  29. data/include/grpc/support/log_windows.h +1 -1
  30. data/include/grpc/support/string_util.h +2 -2
  31. data/include/grpc/support/subprocess.h +5 -5
  32. data/include/grpc/support/sync.h +43 -27
  33. data/include/grpc/support/thd.h +6 -6
  34. data/include/grpc/support/tls_gcc.h +1 -1
  35. data/include/grpc/support/tls_pthread.h +1 -1
  36. data/src/core/ext/census/{grpc_context.c → grpc_context.cc} +5 -8
  37. data/src/core/ext/filters/client_channel/backup_poller.cc +165 -0
  38. data/src/core/ext/{census/grpc_filter.h → filters/client_channel/backup_poller.h} +12 -7
  39. data/src/core/ext/filters/client_channel/{channel_connectivity.c → channel_connectivity.cc} +45 -42
  40. data/src/core/ext/filters/client_channel/{client_channel.c → client_channel.cc} +452 -417
  41. data/src/core/ext/filters/client_channel/client_channel.h +16 -8
  42. data/src/core/ext/filters/client_channel/{client_channel_factory.c → client_channel_factory.cc} +0 -0
  43. data/src/core/ext/filters/client_channel/client_channel_factory.h +29 -21
  44. data/src/core/ext/filters/client_channel/{client_channel_plugin.c → client_channel_plugin.cc} +15 -19
  45. data/src/core/ext/filters/client_channel/{connector.c → connector.cc} +0 -0
  46. data/src/core/ext/filters/client_channel/connector.h +29 -21
  47. data/src/core/ext/filters/client_channel/{http_connect_handshaker.c → http_connect_handshaker.cc} +10 -10
  48. data/src/core/ext/filters/client_channel/http_connect_handshaker.h +8 -0
  49. data/src/core/ext/filters/client_channel/{http_proxy.c → http_proxy.cc} +14 -14
  50. data/src/core/ext/filters/client_channel/http_proxy.h +8 -0
  51. data/src/core/ext/filters/client_channel/{lb_policy.c → lb_policy.cc} +47 -48
  52. data/src/core/ext/filters/client_channel/lb_policy.h +76 -70
  53. data/src/core/ext/filters/client_channel/lb_policy/grpclb/{client_load_reporting_filter.c → client_load_reporting_filter.cc} +28 -29
  54. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +9 -1
  55. data/src/core/ext/filters/client_channel/lb_policy/grpclb/{grpclb.c → grpclb.cc} +554 -563
  56. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +9 -1
  57. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +17 -9
  58. data/src/core/ext/filters/client_channel/lb_policy/grpclb/{grpclb_channel_secure.c → grpclb_channel_secure.cc} +17 -17
  59. data/src/core/ext/filters/client_channel/lb_policy/grpclb/{grpclb_client_stats.c → grpclb_client_stats.cc} +3 -3
  60. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +9 -1
  61. data/src/core/ext/filters/client_channel/lb_policy/grpclb/{load_balancer_api.c → load_balancer_api.cc} +64 -67
  62. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +20 -21
  63. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +599 -0
  64. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +695 -0
  65. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +270 -0
  66. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +153 -0
  67. data/src/core/ext/filters/client_channel/{lb_policy_factory.c → lb_policy_factory.cc} +10 -10
  68. data/src/core/ext/filters/client_channel/lb_policy_factory.h +48 -40
  69. data/src/core/ext/filters/client_channel/{lb_policy_registry.c → lb_policy_registry.cc} +9 -9
  70. data/src/core/ext/filters/client_channel/lb_policy_registry.h +11 -3
  71. data/src/core/ext/filters/client_channel/{parse_address.c → parse_address.cc} +24 -24
  72. data/src/core/ext/filters/client_channel/parse_address.h +14 -6
  73. data/src/core/ext/filters/client_channel/{proxy_mapper.c → proxy_mapper.cc} +0 -0
  74. data/src/core/ext/filters/client_channel/proxy_mapper.h +8 -0
  75. data/src/core/ext/filters/client_channel/{proxy_mapper_registry.c → proxy_mapper_registry.cc} +0 -0
  76. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +8 -0
  77. data/src/core/ext/filters/client_channel/{resolver.c → resolver.cc} +21 -23
  78. data/src/core/ext/filters/client_channel/resolver.h +33 -27
  79. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/{dns_resolver_ares.c → dns_resolver_ares.cc} +133 -133
  80. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +18 -9
  81. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/{grpc_ares_ev_driver_posix.c → grpc_ares_ev_driver_posix.cc} +58 -56
  82. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/{grpc_ares_wrapper.c → grpc_ares_wrapper.cc} +118 -115
  83. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +23 -15
  84. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +60 -0
  85. data/src/core/ext/filters/client_channel/resolver/dns/native/{dns_resolver.c → dns_resolver.cc} +100 -94
  86. data/src/core/ext/filters/client_channel/resolver/fake/{fake_resolver.c → fake_resolver.cc} +14 -14
  87. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +9 -1
  88. data/src/core/ext/filters/client_channel/resolver/sockaddr/{sockaddr_resolver.c → sockaddr_resolver.cc} +60 -60
  89. data/src/core/ext/filters/client_channel/{resolver_factory.c → resolver_factory.cc} +2 -2
  90. data/src/core/ext/filters/client_channel/resolver_factory.h +27 -19
  91. data/src/core/ext/filters/client_channel/{resolver_registry.c → resolver_registry.cc} +35 -35
  92. data/src/core/ext/filters/client_channel/resolver_registry.h +18 -10
  93. data/src/core/ext/filters/client_channel/{retry_throttle.c → retry_throttle.cc} +10 -10
  94. data/src/core/ext/filters/client_channel/retry_throttle.h +8 -0
  95. data/src/core/ext/filters/client_channel/{subchannel.c → subchannel.cc} +210 -213
  96. data/src/core/ext/filters/client_channel/subchannel.h +68 -60
  97. data/src/core/ext/filters/client_channel/{subchannel_index.c → subchannel_index.cc} +52 -52
  98. data/src/core/ext/filters/client_channel/subchannel_index.h +22 -14
  99. data/src/core/ext/filters/client_channel/{uri_parser.c → uri_parser.cc} +29 -27
  100. data/src/core/ext/filters/client_channel/uri_parser.h +18 -10
  101. data/src/core/ext/filters/deadline/{deadline_filter.c → deadline_filter.cc} +12 -15
  102. data/src/core/ext/filters/deadline/deadline_filter.h +11 -2
  103. data/src/core/ext/filters/http/client/{http_client_filter.c → http_client_filter.cc} +83 -83
  104. data/src/core/ext/filters/http/client/http_client_filter.h +8 -0
  105. data/src/core/ext/filters/http/{http_filters_plugin.c → http_filters_plugin.cc} +20 -21
  106. data/src/core/ext/filters/http/message_compress/{message_compress_filter.c → message_compress_filter.cc} +84 -83
  107. data/src/core/ext/filters/http/message_compress/message_compress_filter.h +9 -1
  108. data/src/core/ext/filters/http/server/{http_server_filter.c → http_server_filter.cc} +80 -78
  109. data/src/core/ext/filters/http/server/http_server_filter.h +8 -0
  110. data/src/core/ext/filters/load_reporting/{server_load_reporting_filter.c → server_load_reporting_filter.cc} +29 -29
  111. data/src/core/ext/filters/load_reporting/server_load_reporting_filter.h +9 -1
  112. data/src/core/ext/filters/load_reporting/{server_load_reporting_plugin.c → server_load_reporting_plugin.cc} +11 -11
  113. data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h +13 -5
  114. data/src/core/ext/filters/max_age/{max_age_filter.c → max_age_filter.cc} +46 -56
  115. data/src/core/ext/filters/max_age/max_age_filter.h +8 -0
  116. data/src/core/ext/filters/message_size/{message_size_filter.c → message_size_filter.cc} +62 -40
  117. data/src/core/ext/filters/message_size/message_size_filter.h +8 -0
  118. data/src/core/ext/filters/workarounds/{workaround_cronet_compression_filter.c → workaround_cronet_compression_filter.cc} +11 -11
  119. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +8 -0
  120. data/src/core/ext/filters/workarounds/{workaround_utils.c → workaround_utils.cc} +7 -7
  121. data/src/core/ext/filters/workarounds/workaround_utils.h +9 -1
  122. data/src/core/ext/transport/chttp2/alpn/{alpn.c → alpn.cc} +3 -3
  123. data/src/core/ext/transport/chttp2/alpn/alpn.h +10 -2
  124. data/src/core/ext/transport/chttp2/client/{chttp2_connector.c → chttp2_connector.cc} +49 -45
  125. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +8 -0
  126. data/src/core/ext/transport/chttp2/client/insecure/{channel_create.c → channel_create.cc} +28 -27
  127. data/src/core/ext/transport/chttp2/client/insecure/{channel_create_posix.c → channel_create_posix.cc} +14 -13
  128. data/src/core/ext/transport/chttp2/client/secure/{secure_channel_create.c → secure_channel_create.cc} +68 -66
  129. data/src/core/ext/transport/chttp2/server/{chttp2_server.c → chttp2_server.cc} +76 -77
  130. data/src/core/ext/transport/chttp2/server/chttp2_server.h +11 -3
  131. data/src/core/ext/transport/chttp2/server/insecure/{server_chttp2.c → server_chttp2.cc} +3 -3
  132. data/src/core/ext/transport/chttp2/server/insecure/{server_chttp2_posix.c → server_chttp2_posix.cc} +13 -12
  133. data/src/core/ext/transport/chttp2/server/secure/{server_secure_chttp2.c → server_secure_chttp2.cc} +12 -10
  134. data/src/core/ext/transport/chttp2/transport/{bin_decoder.c → bin_decoder.cc} +7 -7
  135. data/src/core/ext/transport/chttp2/transport/bin_decoder.h +15 -7
  136. data/src/core/ext/transport/chttp2/transport/{bin_encoder.c → bin_encoder.cc} +11 -11
  137. data/src/core/ext/transport/chttp2/transport/bin_encoder.h +8 -0
  138. data/src/core/ext/transport/chttp2/transport/{chttp2_plugin.c → chttp2_plugin.cc} +2 -9
  139. data/src/core/ext/transport/chttp2/transport/{chttp2_transport.c → chttp2_transport.cc} +778 -778
  140. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +14 -10
  141. data/src/core/ext/transport/chttp2/transport/flow_control.cc +385 -0
  142. data/src/core/ext/transport/chttp2/transport/flow_control.h +337 -0
  143. data/src/core/ext/transport/chttp2/transport/frame.h +8 -0
  144. data/src/core/ext/transport/chttp2/transport/{frame_data.c → frame_data.cc} +34 -34
  145. data/src/core/ext/transport/chttp2/transport/frame_data.h +25 -17
  146. data/src/core/ext/transport/chttp2/transport/{frame_goaway.c → frame_goaway.cc} +18 -18
  147. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +18 -10
  148. data/src/core/ext/transport/chttp2/transport/{frame_ping.c → frame_ping.cc} +18 -19
  149. data/src/core/ext/transport/chttp2/transport/frame_ping.h +12 -4
  150. data/src/core/ext/transport/chttp2/transport/{frame_rst_stream.c → frame_rst_stream.cc} +16 -16
  151. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +16 -8
  152. data/src/core/ext/transport/chttp2/transport/{frame_settings.c → frame_settings.cc} +23 -24
  153. data/src/core/ext/transport/chttp2/transport/frame_settings.h +17 -9
  154. data/src/core/ext/transport/chttp2/transport/{frame_window_update.c → frame_window_update.cc} +22 -24
  155. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +14 -6
  156. data/src/core/ext/transport/chttp2/transport/{hpack_encoder.c → hpack_encoder.cc} +206 -161
  157. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +23 -13
  158. data/src/core/ext/transport/chttp2/transport/{hpack_parser.c → hpack_parser.cc} +340 -334
  159. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +30 -22
  160. data/src/core/ext/transport/chttp2/transport/{hpack_table.c → hpack_table.cc} +25 -25
  161. data/src/core/ext/transport/chttp2/transport/hpack_table.h +19 -11
  162. data/src/core/ext/transport/chttp2/transport/{http2_settings.c → http2_settings.cc} +1 -1
  163. data/src/core/ext/transport/chttp2/transport/http2_settings.h +10 -2
  164. data/src/core/ext/transport/chttp2/transport/{huffsyms.c → huffsyms.cc} +0 -0
  165. data/src/core/ext/transport/chttp2/transport/huffsyms.h +8 -0
  166. data/src/core/ext/transport/chttp2/transport/{incoming_metadata.c → incoming_metadata.cc} +14 -13
  167. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +18 -10
  168. data/src/core/ext/transport/chttp2/transport/internal.h +214 -340
  169. data/src/core/ext/transport/chttp2/transport/{parsing.c → parsing.cc} +152 -141
  170. data/src/core/ext/transport/chttp2/transport/{stream_lists.c → stream_lists.cc} +53 -53
  171. data/src/core/ext/transport/chttp2/transport/{stream_map.c → stream_map.cc} +35 -34
  172. data/src/core/ext/transport/chttp2/transport/stream_map.h +22 -14
  173. data/src/core/ext/transport/chttp2/transport/{varint.c → varint.cc} +0 -0
  174. data/src/core/ext/transport/chttp2/transport/varint.h +8 -0
  175. data/src/core/ext/transport/chttp2/transport/writing.cc +636 -0
  176. data/src/core/ext/transport/inproc/{inproc_plugin.c → inproc_plugin.cc} +5 -6
  177. data/src/core/ext/transport/inproc/{inproc_transport.c → inproc_transport.cc} +479 -544
  178. data/src/core/ext/transport/inproc/inproc_transport.h +4 -4
  179. data/src/core/lib/backoff/backoff.cc +80 -0
  180. data/src/core/lib/backoff/backoff.h +83 -0
  181. data/src/core/lib/channel/{channel_args.c → channel_args.cc} +92 -92
  182. data/src/core/lib/channel/channel_args.h +45 -37
  183. data/src/core/lib/channel/{channel_stack.c → channel_stack.cc} +67 -68
  184. data/src/core/lib/channel/channel_stack.h +76 -75
  185. data/src/core/lib/channel/{channel_stack_builder.c → channel_stack_builder.cc} +91 -91
  186. data/src/core/lib/channel/channel_stack_builder.h +45 -45
  187. data/src/core/lib/channel/{connected_channel.c → connected_channel.cc} +70 -70
  188. data/src/core/lib/channel/connected_channel.h +12 -4
  189. data/src/core/lib/channel/context.h +2 -2
  190. data/src/core/lib/channel/{handshaker.c → handshaker.cc} +7 -9
  191. data/src/core/lib/channel/handshaker.h +9 -1
  192. data/src/core/lib/channel/{handshaker_factory.c → handshaker_factory.cc} +7 -7
  193. data/src/core/lib/channel/handshaker_factory.h +18 -10
  194. data/src/core/lib/channel/{handshaker_registry.c → handshaker_registry.cc} +0 -0
  195. data/src/core/lib/channel/handshaker_registry.h +8 -0
  196. data/src/core/lib/compression/algorithm_metadata.h +8 -0
  197. data/src/core/lib/compression/{compression.c → compression.cc} +9 -9
  198. data/src/core/lib/compression/{message_compress.c → message_compress.cc} +0 -0
  199. data/src/core/lib/compression/message_compress.h +8 -0
  200. data/src/core/lib/compression/{stream_compression.c → stream_compression.cc} +12 -12
  201. data/src/core/lib/compression/stream_compression.h +27 -19
  202. data/src/core/lib/compression/{stream_compression_gzip.c → stream_compression_gzip.cc} +35 -36
  203. data/src/core/lib/compression/stream_compression_gzip.h +8 -0
  204. data/src/core/lib/compression/{stream_compression_identity.c → stream_compression_identity.cc} +19 -20
  205. data/src/core/lib/compression/stream_compression_identity.h +8 -0
  206. data/src/core/lib/debug/{stats.c → stats.cc} +19 -19
  207. data/src/core/lib/debug/stats.h +17 -9
  208. data/src/core/lib/debug/{stats_data.c → stats_data.cc} +45 -22
  209. data/src/core/lib/debug/stats_data.h +58 -19
  210. data/src/core/lib/debug/trace.cc +142 -0
  211. data/src/core/lib/debug/trace.h +74 -14
  212. data/src/core/lib/http/{format_request.c → format_request.cc} +10 -10
  213. data/src/core/lib/http/format_request.h +12 -4
  214. data/src/core/lib/http/{httpcli.c → httpcli.cc} +80 -80
  215. data/src/core/lib/http/httpcli.h +41 -33
  216. data/src/core/lib/http/{httpcli_security_connector.c → httpcli_security_connector.cc} +69 -55
  217. data/src/core/lib/http/{parser.c → parser.cc} +42 -42
  218. data/src/core/lib/http/parser.h +28 -20
  219. data/src/core/lib/{support → iomgr}/block_annotate.h +17 -8
  220. data/src/core/lib/iomgr/{call_combiner.c → call_combiner.cc} +29 -17
  221. data/src/core/lib/iomgr/call_combiner.h +9 -1
  222. data/src/core/lib/iomgr/closure.h +220 -62
  223. data/src/core/lib/iomgr/{combiner.c → combiner.cc} +63 -62
  224. data/src/core/lib/iomgr/combiner.h +16 -8
  225. data/src/core/lib/iomgr/{endpoint.c → endpoint.cc} +6 -0
  226. data/src/core/lib/iomgr/endpoint.h +47 -32
  227. data/src/core/lib/iomgr/endpoint_pair.h +12 -4
  228. data/src/core/lib/iomgr/{endpoint_pair_posix.c → endpoint_pair_posix.cc} +3 -3
  229. data/src/core/lib/iomgr/{endpoint_pair_uv.c → endpoint_pair_uv.cc} +2 -2
  230. data/src/core/lib/iomgr/{endpoint_pair_windows.c → endpoint_pair_windows.cc} +6 -6
  231. data/src/core/lib/iomgr/{error.c → error.cc} +125 -124
  232. data/src/core/lib/iomgr/error.h +32 -27
  233. data/src/core/lib/iomgr/error_internal.h +11 -2
  234. data/src/core/lib/iomgr/{ev_epoll1_linux.c → ev_epoll1_linux.cc} +214 -215
  235. data/src/core/lib/iomgr/ev_epoll1_linux.h +9 -1
  236. data/src/core/lib/iomgr/ev_epollex_linux.cc +1488 -0
  237. data/src/core/lib/iomgr/ev_epollex_linux.h +9 -1
  238. data/src/core/lib/iomgr/{ev_epollsig_linux.c → ev_epollsig_linux.cc} +304 -305
  239. data/src/core/lib/iomgr/ev_epollsig_linux.h +12 -4
  240. data/src/core/lib/iomgr/{ev_poll_posix.c → ev_poll_posix.cc} +272 -283
  241. data/src/core/lib/iomgr/ev_poll_posix.h +10 -2
  242. data/src/core/lib/iomgr/ev_posix.cc +288 -0
  243. data/src/core/lib/iomgr/ev_posix.h +75 -67
  244. data/src/core/lib/iomgr/{ev_windows.c → ev_windows.cc} +2 -2
  245. data/src/core/lib/iomgr/exec_ctx.cc +177 -0
  246. data/src/core/lib/iomgr/exec_ctx.h +35 -13
  247. data/src/core/lib/iomgr/{executor.c → executor.cc} +34 -35
  248. data/src/core/lib/iomgr/executor.h +12 -4
  249. data/src/core/lib/iomgr/{fork_posix.c → fork_posix.cc} +0 -0
  250. data/src/core/lib/iomgr/{fork_windows.c → fork_windows.cc} +0 -0
  251. data/src/core/lib/iomgr/gethostname.h +9 -1
  252. data/src/core/lib/iomgr/{gethostname_fallback.c → gethostname_fallback.cc} +2 -1
  253. data/src/core/lib/iomgr/{gethostname_host_name_max.c → gethostname_host_name_max.cc} +4 -3
  254. data/src/core/lib/iomgr/{gethostname_sysconf.c → gethostname_sysconf.cc} +3 -2
  255. data/src/core/lib/iomgr/{iocp_windows.c → iocp_windows.cc} +23 -25
  256. data/src/core/lib/iomgr/iocp_windows.h +17 -3
  257. data/src/core/lib/iomgr/{iomgr.c → iomgr.cc} +25 -19
  258. data/src/core/lib/iomgr/iomgr.h +11 -3
  259. data/src/core/lib/iomgr/iomgr_internal.h +13 -5
  260. data/src/core/lib/iomgr/{iomgr_posix.c → iomgr_posix.cc} +0 -1
  261. data/src/core/lib/iomgr/{iomgr_uv.c → iomgr_uv.cc} +1 -1
  262. data/src/core/lib/iomgr/iomgr_uv.h +8 -0
  263. data/src/core/lib/iomgr/{iomgr_windows.c → iomgr_windows.cc} +0 -0
  264. data/src/core/lib/iomgr/{is_epollexclusive_available.c → is_epollexclusive_available.cc} +1 -1
  265. data/src/core/lib/iomgr/is_epollexclusive_available.h +8 -0
  266. data/src/core/lib/iomgr/{load_file.c → load_file.cc} +12 -12
  267. data/src/core/lib/iomgr/load_file.h +2 -2
  268. data/src/core/lib/iomgr/{lockfree_event.c → lockfree_event.cc} +76 -68
  269. data/src/core/lib/iomgr/lockfree_event.h +30 -11
  270. data/src/core/lib/iomgr/{network_status_tracker.c → network_status_tracker.cc} +3 -2
  271. data/src/core/lib/iomgr/network_status_tracker.h +2 -2
  272. data/src/core/lib/iomgr/{polling_entity.c → polling_entity.cc} +18 -18
  273. data/src/core/lib/iomgr/polling_entity.h +21 -13
  274. data/src/core/lib/iomgr/pollset.h +17 -11
  275. data/src/core/lib/iomgr/pollset_set.h +23 -15
  276. data/src/core/lib/iomgr/{pollset_set_uv.c → pollset_set_uv.cc} +0 -0
  277. data/src/core/lib/iomgr/{pollset_set_windows.c → pollset_set_windows.cc} +0 -0
  278. data/src/core/lib/iomgr/{pollset_uv.c → pollset_uv.cc} +31 -29
  279. data/src/core/lib/iomgr/pollset_uv.h +8 -0
  280. data/src/core/lib/iomgr/{pollset_windows.c → pollset_windows.cc} +24 -24
  281. data/src/core/lib/iomgr/pollset_windows.h +17 -4
  282. data/src/core/lib/iomgr/port.h +10 -0
  283. data/src/core/lib/iomgr/resolve_address.h +18 -10
  284. data/src/core/lib/iomgr/{resolve_address_posix.c → resolve_address_posix.cc} +40 -40
  285. data/src/core/lib/iomgr/{resolve_address_uv.c → resolve_address_uv.cc} +61 -56
  286. data/src/core/lib/iomgr/{resolve_address_windows.c → resolve_address_windows.cc} +36 -34
  287. data/src/core/lib/iomgr/{resource_quota.c → resource_quota.cc} +209 -180
  288. data/src/core/lib/iomgr/resource_quota.h +45 -37
  289. data/src/core/lib/iomgr/{sockaddr_utils.c → sockaddr_utils.cc} +61 -61
  290. data/src/core/lib/iomgr/sockaddr_utils.h +23 -15
  291. data/src/core/lib/iomgr/sockaddr_windows.h +6 -0
  292. data/src/core/lib/iomgr/{socket_factory_posix.c → socket_factory_posix.cc} +20 -20
  293. data/src/core/lib/iomgr/socket_factory_posix.h +15 -15
  294. data/src/core/lib/iomgr/{socket_mutator.c → socket_mutator.cc} +18 -18
  295. data/src/core/lib/iomgr/socket_mutator.h +11 -11
  296. data/src/core/lib/iomgr/socket_utils.h +9 -1
  297. data/src/core/lib/iomgr/{socket_utils_common_posix.c → socket_utils_common_posix.cc} +28 -28
  298. data/src/core/lib/iomgr/{socket_utils_linux.c → socket_utils_linux.cc} +3 -3
  299. data/src/core/lib/iomgr/{socket_utils_posix.c → socket_utils_posix.cc} +3 -3
  300. data/src/core/lib/iomgr/socket_utils_posix.h +26 -18
  301. data/src/core/lib/iomgr/{socket_utils_uv.c → socket_utils_uv.cc} +1 -1
  302. data/src/core/lib/iomgr/{socket_utils_windows.c → socket_utils_windows.cc} +2 -2
  303. data/src/core/lib/iomgr/{socket_windows.c → socket_windows.cc} +18 -18
  304. data/src/core/lib/iomgr/socket_windows.h +26 -13
  305. data/src/core/lib/iomgr/tcp_client.h +14 -6
  306. data/src/core/lib/iomgr/{tcp_client_posix.c → tcp_client_posix.cc} +69 -70
  307. data/src/core/lib/iomgr/tcp_client_posix.h +11 -3
  308. data/src/core/lib/iomgr/{tcp_client_uv.c → tcp_client_uv.cc} +47 -48
  309. data/src/core/lib/iomgr/{tcp_client_windows.c → tcp_client_windows.cc} +46 -44
  310. data/src/core/lib/iomgr/{tcp_posix.c → tcp_posix.cc} +198 -175
  311. data/src/core/lib/iomgr/tcp_posix.h +15 -7
  312. data/src/core/lib/iomgr/tcp_server.h +31 -23
  313. data/src/core/lib/iomgr/{tcp_server_posix.c → tcp_server_posix.cc} +78 -77
  314. data/src/core/lib/iomgr/tcp_server_utils_posix.h +27 -19
  315. data/src/core/lib/iomgr/{tcp_server_utils_posix_common.c → tcp_server_utils_posix_common.cc} +27 -27
  316. data/src/core/lib/iomgr/{tcp_server_utils_posix_ifaddrs.c → tcp_server_utils_posix_ifaddrs.cc} +25 -25
  317. data/src/core/lib/iomgr/{tcp_server_utils_posix_noifaddrs.c → tcp_server_utils_posix_noifaddrs.cc} +2 -2
  318. data/src/core/lib/iomgr/{tcp_server_uv.c → tcp_server_uv.cc} +133 -105
  319. data/src/core/lib/iomgr/{tcp_server_windows.c → tcp_server_windows.cc} +81 -77
  320. data/src/core/lib/iomgr/tcp_uv.cc +420 -0
  321. data/src/core/lib/iomgr/tcp_uv.h +18 -4
  322. data/src/core/lib/iomgr/{tcp_windows.c → tcp_windows.cc} +90 -79
  323. data/src/core/lib/iomgr/tcp_windows.h +17 -4
  324. data/src/core/lib/iomgr/{time_averaged_stats.c → time_averaged_stats.cc} +0 -0
  325. data/src/core/lib/iomgr/time_averaged_stats.h +8 -0
  326. data/src/core/lib/iomgr/timer.h +16 -9
  327. data/src/core/lib/iomgr/{timer_generic.c → timer_generic.cc} +130 -171
  328. data/src/core/lib/iomgr/timer_generic.h +4 -4
  329. data/src/core/lib/iomgr/{timer_heap.c → timer_heap.cc} +20 -21
  330. data/src/core/lib/iomgr/timer_heap.h +16 -8
  331. data/src/core/lib/iomgr/{timer_manager.c → timer_manager.cc} +54 -52
  332. data/src/core/lib/iomgr/timer_manager.h +8 -0
  333. data/src/core/lib/iomgr/{timer_uv.c → timer_uv.cc} +22 -24
  334. data/src/core/lib/iomgr/timer_uv.h +2 -2
  335. data/src/core/lib/iomgr/{udp_server.c → udp_server.cc} +75 -75
  336. data/src/core/lib/iomgr/udp_server.h +25 -17
  337. data/src/core/lib/iomgr/{unix_sockets_posix.c → unix_sockets_posix.cc} +22 -21
  338. data/src/core/lib/iomgr/unix_sockets_posix.h +14 -6
  339. data/src/core/lib/iomgr/{unix_sockets_posix_noop.c → unix_sockets_posix_noop.cc} +5 -5
  340. data/src/core/lib/iomgr/{wakeup_fd_cv.c → wakeup_fd_cv.cc} +2 -2
  341. data/src/core/lib/iomgr/wakeup_fd_cv.h +10 -0
  342. data/src/core/lib/iomgr/{wakeup_fd_eventfd.c → wakeup_fd_eventfd.cc} +0 -0
  343. data/src/core/lib/iomgr/{wakeup_fd_nospecial.c → wakeup_fd_nospecial.cc} +0 -0
  344. data/src/core/lib/iomgr/{wakeup_fd_pipe.c → wakeup_fd_pipe.cc} +1 -0
  345. data/src/core/lib/iomgr/wakeup_fd_pipe.h +9 -1
  346. data/src/core/lib/iomgr/{wakeup_fd_posix.c → wakeup_fd_posix.cc} +6 -7
  347. data/src/core/lib/iomgr/wakeup_fd_posix.h +8 -0
  348. data/src/core/lib/json/{json.c → json.cc} +0 -0
  349. data/src/core/lib/json/json.h +8 -0
  350. data/src/core/lib/json/{json_reader.c → json_reader.cc} +18 -18
  351. data/src/core/lib/json/json_reader.h +26 -18
  352. data/src/core/lib/json/{json_string.c → json_string.cc} +57 -57
  353. data/src/core/lib/json/{json_writer.c → json_writer.cc} +20 -20
  354. data/src/core/lib/json/json_writer.h +23 -15
  355. data/src/core/lib/profiling/{basic_timers.c → basic_timers.cc} +34 -34
  356. data/src/core/lib/profiling/{stap_timers.c → stap_timers.cc} +5 -5
  357. data/src/core/lib/profiling/timers.h +6 -6
  358. data/src/core/lib/security/context/{security_context.c → security_context.cc} +98 -95
  359. data/src/core/lib/security/context/security_context.h +27 -29
  360. data/src/core/lib/security/credentials/composite/{composite_credentials.c → composite_credentials.cc} +79 -73
  361. data/src/core/lib/security/credentials/composite/composite_credentials.h +17 -9
  362. data/src/core/lib/security/credentials/{credentials.c → credentials.cc} +97 -92
  363. data/src/core/lib/security/credentials/credentials.h +83 -75
  364. data/src/core/lib/security/credentials/{credentials_metadata.c → credentials_metadata.cc} +7 -6
  365. data/src/core/lib/security/credentials/fake/{fake_credentials.c → fake_credentials.cc} +39 -36
  366. data/src/core/lib/security/credentials/fake/fake_credentials.h +13 -5
  367. data/src/core/lib/security/credentials/google_default/{credentials_generic.c → credentials_generic.cc} +5 -5
  368. data/src/core/lib/security/credentials/google_default/{google_default_credentials.c → google_default_credentials.cc} +55 -55
  369. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +9 -1
  370. data/src/core/lib/security/credentials/iam/{iam_credentials.c → iam_credentials.cc} +19 -18
  371. data/src/core/lib/security/credentials/jwt/{json_token.c → json_token.cc} +80 -75
  372. data/src/core/lib/security/credentials/jwt/json_token.h +23 -15
  373. data/src/core/lib/security/credentials/jwt/{jwt_credentials.c → jwt_credentials.cc} +45 -41
  374. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +11 -3
  375. data/src/core/lib/security/credentials/jwt/{jwt_verifier.c → jwt_verifier.cc} +262 -252
  376. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +38 -30
  377. data/src/core/lib/security/credentials/oauth2/{oauth2_credentials.c → oauth2_credentials.cc} +138 -141
  378. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +30 -22
  379. data/src/core/lib/security/credentials/plugin/{plugin_credentials.c → plugin_credentials.cc} +52 -53
  380. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +7 -7
  381. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +344 -0
  382. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +27 -0
  383. data/src/core/lib/security/transport/auth_filters.h +16 -0
  384. data/src/core/lib/security/transport/{client_auth_filter.c → client_auth_filter.cc} +127 -115
  385. data/src/core/lib/security/transport/{lb_targets_info.c → lb_targets_info.cc} +16 -13
  386. data/src/core/lib/security/transport/lb_targets_info.h +11 -3
  387. data/src/core/lib/security/transport/{secure_endpoint.c → secure_endpoint.cc} +84 -76
  388. data/src/core/lib/security/transport/secure_endpoint.h +13 -5
  389. data/src/core/lib/security/transport/security_connector.cc +1121 -0
  390. data/src/core/lib/security/transport/security_connector.h +97 -79
  391. data/src/core/lib/security/transport/{security_handshaker.c → security_handshaker.cc} +139 -132
  392. data/src/core/lib/security/transport/security_handshaker.h +11 -3
  393. data/src/core/lib/security/transport/{server_auth_filter.c → server_auth_filter.cc} +68 -68
  394. data/src/core/lib/security/transport/{tsi_error.c → tsi_error.cc} +1 -1
  395. data/src/core/lib/security/transport/tsi_error.h +9 -1
  396. data/src/core/lib/security/util/{json_util.c → json_util.cc} +11 -11
  397. data/src/core/lib/security/util/json_util.h +12 -4
  398. data/src/core/lib/slice/{b64.c → b64.cc} +15 -15
  399. data/src/core/lib/slice/b64.h +12 -4
  400. data/src/core/lib/slice/{percent_encoding.c → percent_encoding.cc} +15 -15
  401. data/src/core/lib/slice/percent_encoding.h +11 -3
  402. data/src/core/lib/slice/{slice.c → slice.cc} +64 -64
  403. data/src/core/lib/slice/{slice_buffer.c → slice_buffer.cc} +38 -38
  404. data/src/core/lib/slice/{slice_hash_table.c → slice_hash_table.cc} +7 -7
  405. data/src/core/lib/slice/slice_hash_table.h +19 -11
  406. data/src/core/lib/slice/{slice_intern.c → slice_intern.cc} +35 -34
  407. data/src/core/lib/slice/slice_internal.h +17 -6
  408. data/src/core/lib/slice/{slice_string_helpers.c → slice_string_helpers.cc} +9 -9
  409. data/src/core/lib/slice/slice_string_helpers.h +3 -3
  410. data/src/core/lib/support/abstract.h +29 -0
  411. data/src/core/lib/support/{alloc.c → alloc.cc} +22 -22
  412. data/src/core/lib/support/{arena.c → arena.cc} +12 -12
  413. data/src/core/lib/support/arena.h +11 -3
  414. data/src/core/lib/support/{atm.c → atm.cc} +1 -1
  415. data/src/core/lib/support/{avl.c → avl.cc} +71 -70
  416. data/src/core/lib/support/{cmdline.c → cmdline.cc} +62 -62
  417. data/src/core/lib/support/{cpu_iphone.c → cpu_iphone.cc} +2 -0
  418. data/src/core/lib/support/{cpu_linux.c → cpu_linux.cc} +10 -0
  419. data/src/core/lib/support/{cpu_posix.c → cpu_posix.cc} +27 -4
  420. data/src/core/lib/support/{cpu_windows.c → cpu_windows.cc} +1 -0
  421. data/src/core/lib/support/env.h +3 -3
  422. data/src/core/lib/support/{env_linux.c → env_linux.cc} +11 -11
  423. data/src/core/lib/support/{env_posix.c → env_posix.cc} +4 -4
  424. data/src/core/lib/support/{env_windows.c → env_windows.cc} +5 -5
  425. data/src/core/lib/support/{fork.c → fork.cc} +2 -2
  426. data/src/core/lib/support/{histogram.c → histogram.cc} +25 -26
  427. data/src/core/lib/support/{host_port.c → host_port.cc} +16 -16
  428. data/src/core/lib/support/{log.c → log.cc} +8 -8
  429. data/src/core/lib/support/{log_android.c → log_android.cc} +7 -7
  430. data/src/core/lib/support/{log_linux.c → log_linux.cc} +8 -8
  431. data/src/core/lib/support/{log_posix.c → log_posix.cc} +9 -10
  432. data/src/core/lib/support/{log_windows.c → log_windows.cc} +7 -7
  433. data/src/core/lib/support/manual_constructor.h +211 -0
  434. data/src/core/lib/support/memory.h +41 -0
  435. data/src/core/lib/support/mpscq.cc +114 -0
  436. data/src/core/lib/support/mpscq.h +45 -7
  437. data/src/core/lib/support/{murmur_hash.c → murmur_hash.cc} +9 -12
  438. data/src/core/lib/support/murmur_hash.h +9 -1
  439. data/src/core/lib/support/spinlock.h +8 -1
  440. data/src/core/lib/support/{string.c → string.cc} +56 -55
  441. data/src/core/lib/support/string.h +21 -21
  442. data/src/core/lib/support/{string_posix.c → string_posix.cc} +5 -4
  443. data/src/core/lib/support/{string_util_windows.c → string_util_windows.cc} +9 -6
  444. data/src/core/lib/support/{string_windows.c → string_windows.cc} +3 -2
  445. data/src/core/lib/support/string_windows.h +8 -0
  446. data/src/core/lib/support/{subprocess_posix.c → subprocess_posix.cc} +13 -13
  447. data/src/core/lib/support/{subprocess_windows.c → subprocess_windows.cc} +9 -9
  448. data/src/core/lib/support/{sync.c → sync.cc} +22 -22
  449. data/src/core/lib/support/{sync_posix.c → sync_posix.cc} +6 -2
  450. data/src/core/lib/support/{sync_windows.c → sync_windows.cc} +14 -14
  451. data/src/core/lib/support/{thd.c → thd.cc} +0 -0
  452. data/src/core/lib/support/{thd_posix.c → thd_posix.cc} +10 -10
  453. data/src/core/lib/support/{thd_windows.c → thd_windows.cc} +10 -10
  454. data/src/core/lib/support/{time.c → time.cc} +0 -0
  455. data/src/core/lib/support/{time_posix.c → time_posix.cc} +5 -6
  456. data/src/core/lib/support/{time_precise.c → time_precise.cc} +6 -4
  457. data/src/core/lib/support/time_precise.h +9 -1
  458. data/src/core/lib/support/{time_windows.c → time_windows.cc} +2 -3
  459. data/src/core/lib/support/{tls_pthread.c → tls_pthread.cc} +2 -2
  460. data/src/core/lib/support/tmpfile.h +1 -1
  461. data/src/core/lib/support/{tmpfile_msys.c → tmpfile_msys.cc} +2 -2
  462. data/src/core/lib/support/{tmpfile_posix.c → tmpfile_posix.cc} +7 -7
  463. data/src/core/lib/support/{tmpfile_windows.c → tmpfile_windows.cc} +2 -2
  464. data/src/core/lib/support/{wrap_memcpy.c → wrap_memcpy.cc} +4 -2
  465. data/src/core/lib/surface/{alarm.c → alarm.cc} +32 -31
  466. data/src/core/lib/surface/alarm_internal.h +10 -2
  467. data/src/core/lib/surface/{api_trace.c → api_trace.cc} +1 -1
  468. data/src/core/lib/surface/api_trace.h +2 -2
  469. data/src/core/lib/surface/{byte_buffer.c → byte_buffer.cc} +13 -13
  470. data/src/core/lib/surface/{byte_buffer_reader.c → byte_buffer_reader.cc} +9 -9
  471. data/src/core/lib/surface/{call.c → call.cc} +379 -372
  472. data/src/core/lib/surface/call.h +37 -38
  473. data/src/core/lib/surface/{call_details.c → call_details.cc} +0 -0
  474. data/src/core/lib/surface/{call_log_batch.c → call_log_batch.cc} +13 -11
  475. data/src/core/lib/surface/call_test_only.h +5 -5
  476. data/src/core/lib/surface/{channel.c → channel.cc} +94 -95
  477. data/src/core/lib/surface/channel.h +29 -21
  478. data/src/core/lib/surface/{channel_init.c → channel_init.cc} +13 -13
  479. data/src/core/lib/surface/channel_init.h +6 -6
  480. data/src/core/lib/surface/{channel_ping.c → channel_ping.cc} +12 -12
  481. data/src/core/lib/surface/{channel_stack_type.c → channel_stack_type.cc} +1 -1
  482. data/src/core/lib/surface/channel_stack_type.h +9 -1
  483. data/src/core/lib/surface/{completion_queue.c → completion_queue.cc} +416 -379
  484. data/src/core/lib/surface/completion_queue.h +29 -29
  485. data/src/core/lib/surface/{completion_queue_factory.c → completion_queue_factory.cc} +1 -1
  486. data/src/core/lib/surface/completion_queue_factory.h +8 -0
  487. data/src/core/lib/surface/{event_string.c → event_string.cc} +9 -9
  488. data/src/core/lib/surface/event_string.h +9 -1
  489. data/src/core/lib/surface/{init.c → init.cc} +16 -39
  490. data/src/core/lib/surface/init.h +8 -0
  491. data/src/core/lib/surface/{init_secure.c → init_secure.cc} +12 -25
  492. data/src/core/lib/surface/lame_client.cc +38 -40
  493. data/src/core/lib/surface/lame_client.h +8 -0
  494. data/src/core/lib/surface/{metadata_array.c → metadata_array.cc} +0 -0
  495. data/src/core/lib/surface/{server.c → server.cc} +340 -404
  496. data/src/core/lib/surface/server.h +22 -14
  497. data/src/core/lib/surface/{validate_metadata.c → validate_metadata.cc} +10 -9
  498. data/src/core/lib/surface/validate_metadata.h +10 -2
  499. data/src/core/lib/surface/{version.c → version.cc} +2 -2
  500. data/src/core/lib/transport/bdp_estimator.cc +84 -0
  501. data/src/core/lib/transport/bdp_estimator.h +67 -42
  502. data/src/core/lib/transport/{byte_stream.c → byte_stream.cc} +51 -51
  503. data/src/core/lib/transport/byte_stream.h +41 -33
  504. data/src/core/lib/transport/{connectivity_state.c → connectivity_state.cc} +36 -40
  505. data/src/core/lib/transport/connectivity_state.h +29 -21
  506. data/src/core/lib/transport/{error_utils.c → error_utils.cc} +26 -22
  507. data/src/core/lib/transport/error_utils.h +18 -6
  508. data/src/core/lib/transport/{metadata.c → metadata.cc} +92 -88
  509. data/src/core/lib/transport/metadata.h +22 -20
  510. data/src/core/lib/transport/{metadata_batch.c → metadata_batch.cc} +78 -79
  511. data/src/core/lib/transport/metadata_batch.h +46 -45
  512. data/src/core/lib/transport/pid_controller.cc +48 -0
  513. data/src/core/lib/transport/pid_controller.h +84 -32
  514. data/src/core/lib/transport/{service_config.c → service_config.cc} +66 -48
  515. data/src/core/lib/transport/service_config.h +11 -2
  516. data/src/core/lib/transport/{static_metadata.c → static_metadata.cc} +2 -2
  517. data/src/core/lib/transport/static_metadata.h +30 -23
  518. data/src/core/lib/transport/{status_conversion.c → status_conversion.cc} +4 -3
  519. data/src/core/lib/transport/status_conversion.h +12 -2
  520. data/src/core/lib/transport/{timeout_encoding.c → timeout_encoding.cc} +28 -61
  521. data/src/core/lib/transport/timeout_encoding.h +11 -2
  522. data/src/core/lib/transport/{transport.c → transport.cc} +79 -79
  523. data/src/core/lib/transport/transport.h +78 -80
  524. data/src/core/lib/transport/transport_impl.h +27 -19
  525. data/src/core/lib/transport/{transport_op_string.c → transport_op_string.cc} +32 -30
  526. data/src/core/plugin_registry/{grpc_plugin_registry.c → grpc_plugin_registry.cc} +34 -38
  527. data/src/core/tsi/{fake_transport_security.c → fake_transport_security.cc} +141 -132
  528. data/src/core/tsi/fake_transport_security.h +5 -5
  529. data/src/core/tsi/{gts_transport_security.c → gts_transport_security.cc} +4 -4
  530. data/src/core/tsi/gts_transport_security.h +11 -3
  531. data/src/core/tsi/{ssl_transport_security.c → ssl_transport_security.cc} +309 -300
  532. data/src/core/tsi/ssl_transport_security.h +25 -25
  533. data/src/core/tsi/ssl_types.h +8 -0
  534. data/src/core/tsi/{transport_security.c → transport_security.cc} +94 -87
  535. data/src/core/tsi/transport_security.h +55 -55
  536. data/src/core/tsi/{transport_security_adapter.c → transport_security_adapter.cc} +58 -55
  537. data/src/core/tsi/transport_security_adapter.h +2 -2
  538. data/src/core/tsi/{transport_security_grpc.c → transport_security_grpc.cc} +21 -21
  539. data/src/core/tsi/transport_security_grpc.h +19 -19
  540. data/src/core/tsi/transport_security_interface.h +41 -41
  541. data/src/ruby/ext/grpc/extconf.rb +4 -2
  542. data/src/ruby/ext/grpc/rb_byte_buffer.c +5 -5
  543. data/src/ruby/ext/grpc/rb_byte_buffer.h +2 -2
  544. data/src/ruby/ext/grpc/rb_call.c +41 -42
  545. data/src/ruby/ext/grpc/rb_call.h +6 -6
  546. data/src/ruby/ext/grpc/rb_call_credentials.c +30 -30
  547. data/src/ruby/ext/grpc/rb_channel.c +87 -87
  548. data/src/ruby/ext/grpc/rb_channel_credentials.c +23 -23
  549. data/src/ruby/ext/grpc/rb_completion_queue.c +11 -11
  550. data/src/ruby/ext/grpc/rb_completion_queue.h +3 -3
  551. data/src/ruby/ext/grpc/rb_compression_options.c +20 -20
  552. data/src/ruby/ext/grpc/rb_event_thread.c +14 -14
  553. data/src/ruby/ext/grpc/rb_event_thread.h +1 -1
  554. data/src/ruby/ext/grpc/rb_grpc.c +8 -8
  555. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +16 -58
  556. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +242 -306
  557. data/src/ruby/ext/grpc/rb_server.c +23 -23
  558. data/src/ruby/ext/grpc/rb_server_credentials.c +13 -13
  559. data/src/ruby/lib/grpc/generic/rpc_server.rb +25 -12
  560. data/src/ruby/lib/grpc/version.rb +1 -1
  561. data/src/ruby/pb/grpc/health/checker.rb +14 -0
  562. data/src/ruby/spec/pb/health/checker_spec.rb +29 -0
  563. data/third_party/cares/config_freebsd/ares_config.h +502 -0
  564. data/third_party/cares/config_openbsd/ares_config.h +502 -0
  565. metadata +302 -328
  566. data/src/core/ext/census/aggregation.h +0 -51
  567. data/src/core/ext/census/base_resources.c +0 -56
  568. data/src/core/ext/census/base_resources.h +0 -24
  569. data/src/core/ext/census/census_interface.h +0 -61
  570. data/src/core/ext/census/census_rpc_stats.h +0 -86
  571. data/src/core/ext/census/context.c +0 -496
  572. data/src/core/ext/census/gen/census.pb.c +0 -161
  573. data/src/core/ext/census/gen/census.pb.h +0 -280
  574. data/src/core/ext/census/gen/trace_context.pb.c +0 -39
  575. data/src/core/ext/census/gen/trace_context.pb.h +0 -78
  576. data/src/core/ext/census/grpc_filter.c +0 -196
  577. data/src/core/ext/census/grpc_plugin.c +0 -70
  578. data/src/core/ext/census/initialize.c +0 -51
  579. data/src/core/ext/census/intrusive_hash_map.c +0 -305
  580. data/src/core/ext/census/intrusive_hash_map.h +0 -152
  581. data/src/core/ext/census/intrusive_hash_map_internal.h +0 -48
  582. data/src/core/ext/census/mlog.c +0 -586
  583. data/src/core/ext/census/mlog.h +0 -80
  584. data/src/core/ext/census/operation.c +0 -48
  585. data/src/core/ext/census/placeholders.c +0 -49
  586. data/src/core/ext/census/resource.c +0 -303
  587. data/src/core/ext/census/resource.h +0 -48
  588. data/src/core/ext/census/rpc_metric_id.h +0 -36
  589. data/src/core/ext/census/trace_context.c +0 -71
  590. data/src/core/ext/census/trace_context.h +0 -56
  591. data/src/core/ext/census/trace_label.h +0 -46
  592. data/src/core/ext/census/trace_propagation.h +0 -48
  593. data/src/core/ext/census/trace_status.h +0 -30
  594. data/src/core/ext/census/trace_string.h +0 -35
  595. data/src/core/ext/census/tracing.c +0 -55
  596. data/src/core/ext/census/tracing.h +0 -109
  597. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c +0 -714
  598. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +0 -924
  599. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c +0 -60
  600. data/src/core/ext/transport/chttp2/transport/flow_control.c +0 -502
  601. data/src/core/ext/transport/chttp2/transport/writing.c +0 -534
  602. data/src/core/lib/debug/trace.c +0 -146
  603. data/src/core/lib/iomgr/closure.c +0 -219
  604. data/src/core/lib/iomgr/ev_epollex_linux.c +0 -1461
  605. data/src/core/lib/iomgr/ev_posix.c +0 -266
  606. data/src/core/lib/iomgr/exec_ctx.c +0 -113
  607. data/src/core/lib/iomgr/tcp_uv.c +0 -381
  608. data/src/core/lib/security/credentials/ssl/ssl_credentials.c +0 -194
  609. data/src/core/lib/security/transport/security_connector.c +0 -914
  610. data/src/core/lib/support/backoff.c +0 -72
  611. data/src/core/lib/support/backoff.h +0 -56
  612. data/src/core/lib/support/mpscq.c +0 -79
  613. data/src/core/lib/support/stack_lockfree.c +0 -137
  614. data/src/core/lib/support/stack_lockfree.h +0 -38
  615. data/src/core/lib/transport/bdp_estimator.c +0 -110
  616. data/src/core/lib/transport/pid_controller.c +0 -63
@@ -34,6 +34,12 @@
34
34
  /* maximum table size we'll actually use */
35
35
  #define GRPC_CHTTP2_HPACKC_MAX_TABLE_SIZE (1024 * 1024)
36
36
 
37
+ extern grpc_core::TraceFlag grpc_http_trace;
38
+
39
+ #ifdef __cplusplus
40
+ extern "C" {
41
+ #endif
42
+
37
43
  typedef struct {
38
44
  uint32_t filter_elems_sum;
39
45
  uint32_t max_table_size;
@@ -64,31 +70,35 @@ typedef struct {
64
70
  uint32_t indices_keys[GRPC_CHTTP2_HPACKC_NUM_VALUES];
65
71
  uint32_t indices_elems[GRPC_CHTTP2_HPACKC_NUM_VALUES];
66
72
 
67
- uint16_t *table_elem_size;
73
+ uint16_t* table_elem_size;
68
74
  } grpc_chttp2_hpack_compressor;
69
75
 
70
- void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor *c);
71
- void grpc_chttp2_hpack_compressor_destroy(grpc_exec_ctx *exec_ctx,
72
- grpc_chttp2_hpack_compressor *c);
76
+ void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor* c);
77
+ void grpc_chttp2_hpack_compressor_destroy(grpc_exec_ctx* exec_ctx,
78
+ grpc_chttp2_hpack_compressor* c);
73
79
  void grpc_chttp2_hpack_compressor_set_max_table_size(
74
- grpc_chttp2_hpack_compressor *c, uint32_t max_table_size);
80
+ grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
75
81
  void grpc_chttp2_hpack_compressor_set_max_usable_size(
76
- grpc_chttp2_hpack_compressor *c, uint32_t max_table_size);
82
+ grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
77
83
 
78
84
  typedef struct {
79
85
  uint32_t stream_id;
80
86
  bool is_eof;
81
87
  bool use_true_binary_metadata;
82
88
  size_t max_frame_size;
83
- grpc_transport_one_way_stats *stats;
89
+ grpc_transport_one_way_stats* stats;
84
90
  } grpc_encode_header_options;
85
91
 
86
- void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
87
- grpc_chttp2_hpack_compressor *c,
88
- grpc_mdelem **extra_headers,
92
+ void grpc_chttp2_encode_header(grpc_exec_ctx* exec_ctx,
93
+ grpc_chttp2_hpack_compressor* c,
94
+ grpc_mdelem** extra_headers,
89
95
  size_t extra_headers_size,
90
- grpc_metadata_batch *metadata,
91
- const grpc_encode_header_options *options,
92
- grpc_slice_buffer *outbuf);
96
+ grpc_metadata_batch* metadata,
97
+ const grpc_encode_header_options* options,
98
+ grpc_slice_buffer* outbuf);
99
+
100
+ #ifdef __cplusplus
101
+ }
102
+ #endif
93
103
 
94
104
  #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */
@@ -33,6 +33,7 @@
33
33
  #include "src/core/lib/debug/stats.h"
34
34
  #include "src/core/lib/profiling/timers.h"
35
35
  #include "src/core/lib/slice/slice_internal.h"
36
+ #include "src/core/lib/slice/slice_string_helpers.h"
36
37
  #include "src/core/lib/support/string.h"
37
38
  #include "src/core/lib/transport/http2_errors.h"
38
39
 
@@ -60,97 +61,97 @@ typedef enum {
60
61
  a set of indirect jumps, and so not waste stack space. */
61
62
 
62
63
  /* forward declarations for parsing states */
63
- static grpc_error *parse_begin(grpc_exec_ctx *exec_ctx,
64
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
65
- const uint8_t *end);
66
- static grpc_error *parse_error(grpc_exec_ctx *exec_ctx,
67
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
68
- const uint8_t *end, grpc_error *error);
69
- static grpc_error *still_parse_error(grpc_exec_ctx *exec_ctx,
70
- grpc_chttp2_hpack_parser *p,
71
- const uint8_t *cur, const uint8_t *end);
72
- static grpc_error *parse_illegal_op(grpc_exec_ctx *exec_ctx,
73
- grpc_chttp2_hpack_parser *p,
74
- const uint8_t *cur, const uint8_t *end);
75
-
76
- static grpc_error *parse_string_prefix(grpc_exec_ctx *exec_ctx,
77
- grpc_chttp2_hpack_parser *p,
78
- const uint8_t *cur, const uint8_t *end);
79
- static grpc_error *parse_key_string(grpc_exec_ctx *exec_ctx,
80
- grpc_chttp2_hpack_parser *p,
81
- const uint8_t *cur, const uint8_t *end);
82
- static grpc_error *parse_value_string_with_indexed_key(
83
- grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
84
- const uint8_t *end);
85
- static grpc_error *parse_value_string_with_literal_key(
86
- grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
87
- const uint8_t *end);
88
-
89
- static grpc_error *parse_value0(grpc_exec_ctx *exec_ctx,
90
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
91
- const uint8_t *end);
92
- static grpc_error *parse_value1(grpc_exec_ctx *exec_ctx,
93
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
94
- const uint8_t *end);
95
- static grpc_error *parse_value2(grpc_exec_ctx *exec_ctx,
96
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
97
- const uint8_t *end);
98
- static grpc_error *parse_value3(grpc_exec_ctx *exec_ctx,
99
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
100
- const uint8_t *end);
101
- static grpc_error *parse_value4(grpc_exec_ctx *exec_ctx,
102
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
103
- const uint8_t *end);
104
- static grpc_error *parse_value5up(grpc_exec_ctx *exec_ctx,
105
- grpc_chttp2_hpack_parser *p,
106
- const uint8_t *cur, const uint8_t *end);
107
-
108
- static grpc_error *parse_indexed_field(grpc_exec_ctx *exec_ctx,
109
- grpc_chttp2_hpack_parser *p,
110
- const uint8_t *cur, const uint8_t *end);
111
- static grpc_error *parse_indexed_field_x(grpc_exec_ctx *exec_ctx,
112
- grpc_chttp2_hpack_parser *p,
113
- const uint8_t *cur,
114
- const uint8_t *end);
115
- static grpc_error *parse_lithdr_incidx(grpc_exec_ctx *exec_ctx,
116
- grpc_chttp2_hpack_parser *p,
117
- const uint8_t *cur, const uint8_t *end);
118
- static grpc_error *parse_lithdr_incidx_x(grpc_exec_ctx *exec_ctx,
119
- grpc_chttp2_hpack_parser *p,
120
- const uint8_t *cur,
121
- const uint8_t *end);
122
- static grpc_error *parse_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
123
- grpc_chttp2_hpack_parser *p,
124
- const uint8_t *cur,
125
- const uint8_t *end);
126
- static grpc_error *parse_lithdr_notidx(grpc_exec_ctx *exec_ctx,
127
- grpc_chttp2_hpack_parser *p,
128
- const uint8_t *cur, const uint8_t *end);
129
- static grpc_error *parse_lithdr_notidx_x(grpc_exec_ctx *exec_ctx,
130
- grpc_chttp2_hpack_parser *p,
131
- const uint8_t *cur,
132
- const uint8_t *end);
133
- static grpc_error *parse_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
134
- grpc_chttp2_hpack_parser *p,
135
- const uint8_t *cur,
136
- const uint8_t *end);
137
- static grpc_error *parse_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
138
- grpc_chttp2_hpack_parser *p,
139
- const uint8_t *cur, const uint8_t *end);
140
- static grpc_error *parse_lithdr_nvridx_x(grpc_exec_ctx *exec_ctx,
141
- grpc_chttp2_hpack_parser *p,
142
- const uint8_t *cur,
143
- const uint8_t *end);
144
- static grpc_error *parse_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
145
- grpc_chttp2_hpack_parser *p,
146
- const uint8_t *cur,
147
- const uint8_t *end);
148
- static grpc_error *parse_max_tbl_size(grpc_exec_ctx *exec_ctx,
149
- grpc_chttp2_hpack_parser *p,
150
- const uint8_t *cur, const uint8_t *end);
151
- static grpc_error *parse_max_tbl_size_x(grpc_exec_ctx *exec_ctx,
152
- grpc_chttp2_hpack_parser *p,
153
- const uint8_t *cur, const uint8_t *end);
64
+ static grpc_error* parse_begin(grpc_exec_ctx* exec_ctx,
65
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
66
+ const uint8_t* end);
67
+ static grpc_error* parse_error(grpc_exec_ctx* exec_ctx,
68
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
69
+ const uint8_t* end, grpc_error* error);
70
+ static grpc_error* still_parse_error(grpc_exec_ctx* exec_ctx,
71
+ grpc_chttp2_hpack_parser* p,
72
+ const uint8_t* cur, const uint8_t* end);
73
+ static grpc_error* parse_illegal_op(grpc_exec_ctx* exec_ctx,
74
+ grpc_chttp2_hpack_parser* p,
75
+ const uint8_t* cur, const uint8_t* end);
76
+
77
+ static grpc_error* parse_string_prefix(grpc_exec_ctx* exec_ctx,
78
+ grpc_chttp2_hpack_parser* p,
79
+ const uint8_t* cur, const uint8_t* end);
80
+ static grpc_error* parse_key_string(grpc_exec_ctx* exec_ctx,
81
+ grpc_chttp2_hpack_parser* p,
82
+ const uint8_t* cur, const uint8_t* end);
83
+ static grpc_error* parse_value_string_with_indexed_key(
84
+ grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
85
+ const uint8_t* end);
86
+ static grpc_error* parse_value_string_with_literal_key(
87
+ grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
88
+ const uint8_t* end);
89
+
90
+ static grpc_error* parse_value0(grpc_exec_ctx* exec_ctx,
91
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
92
+ const uint8_t* end);
93
+ static grpc_error* parse_value1(grpc_exec_ctx* exec_ctx,
94
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
95
+ const uint8_t* end);
96
+ static grpc_error* parse_value2(grpc_exec_ctx* exec_ctx,
97
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
98
+ const uint8_t* end);
99
+ static grpc_error* parse_value3(grpc_exec_ctx* exec_ctx,
100
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
101
+ const uint8_t* end);
102
+ static grpc_error* parse_value4(grpc_exec_ctx* exec_ctx,
103
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
104
+ const uint8_t* end);
105
+ static grpc_error* parse_value5up(grpc_exec_ctx* exec_ctx,
106
+ grpc_chttp2_hpack_parser* p,
107
+ const uint8_t* cur, const uint8_t* end);
108
+
109
+ static grpc_error* parse_indexed_field(grpc_exec_ctx* exec_ctx,
110
+ grpc_chttp2_hpack_parser* p,
111
+ const uint8_t* cur, const uint8_t* end);
112
+ static grpc_error* parse_indexed_field_x(grpc_exec_ctx* exec_ctx,
113
+ grpc_chttp2_hpack_parser* p,
114
+ const uint8_t* cur,
115
+ const uint8_t* end);
116
+ static grpc_error* parse_lithdr_incidx(grpc_exec_ctx* exec_ctx,
117
+ grpc_chttp2_hpack_parser* p,
118
+ const uint8_t* cur, const uint8_t* end);
119
+ static grpc_error* parse_lithdr_incidx_x(grpc_exec_ctx* exec_ctx,
120
+ grpc_chttp2_hpack_parser* p,
121
+ const uint8_t* cur,
122
+ const uint8_t* end);
123
+ static grpc_error* parse_lithdr_incidx_v(grpc_exec_ctx* exec_ctx,
124
+ grpc_chttp2_hpack_parser* p,
125
+ const uint8_t* cur,
126
+ const uint8_t* end);
127
+ static grpc_error* parse_lithdr_notidx(grpc_exec_ctx* exec_ctx,
128
+ grpc_chttp2_hpack_parser* p,
129
+ const uint8_t* cur, const uint8_t* end);
130
+ static grpc_error* parse_lithdr_notidx_x(grpc_exec_ctx* exec_ctx,
131
+ grpc_chttp2_hpack_parser* p,
132
+ const uint8_t* cur,
133
+ const uint8_t* end);
134
+ static grpc_error* parse_lithdr_notidx_v(grpc_exec_ctx* exec_ctx,
135
+ grpc_chttp2_hpack_parser* p,
136
+ const uint8_t* cur,
137
+ const uint8_t* end);
138
+ static grpc_error* parse_lithdr_nvridx(grpc_exec_ctx* exec_ctx,
139
+ grpc_chttp2_hpack_parser* p,
140
+ const uint8_t* cur, const uint8_t* end);
141
+ static grpc_error* parse_lithdr_nvridx_x(grpc_exec_ctx* exec_ctx,
142
+ grpc_chttp2_hpack_parser* p,
143
+ const uint8_t* cur,
144
+ const uint8_t* end);
145
+ static grpc_error* parse_lithdr_nvridx_v(grpc_exec_ctx* exec_ctx,
146
+ grpc_chttp2_hpack_parser* p,
147
+ const uint8_t* cur,
148
+ const uint8_t* end);
149
+ static grpc_error* parse_max_tbl_size(grpc_exec_ctx* exec_ctx,
150
+ grpc_chttp2_hpack_parser* p,
151
+ const uint8_t* cur, const uint8_t* end);
152
+ static grpc_error* parse_max_tbl_size_x(grpc_exec_ctx* exec_ctx,
153
+ grpc_chttp2_hpack_parser* p,
154
+ const uint8_t* cur, const uint8_t* end);
154
155
 
155
156
  /* we translate the first byte of a hpack field into one of these decoding
156
157
  cases, then use a lookup table to jump directly to the appropriate parser.
@@ -648,11 +649,16 @@ static const uint8_t inverse_base64[256] = {
648
649
  };
649
650
 
650
651
  /* emission helpers */
651
- static grpc_error *on_hdr(grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p,
652
+ static grpc_error* on_hdr(grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p,
652
653
  grpc_mdelem md, int add_to_table) {
653
- if (GRPC_TRACER_ON(grpc_http_trace) && !GRPC_MDELEM_IS_INTERNED(md)) {
654
- char *k = grpc_slice_to_c_string(GRPC_MDKEY(md));
655
- char *v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
654
+ if (grpc_http_trace.enabled()) {
655
+ char* k = grpc_slice_to_c_string(GRPC_MDKEY(md));
656
+ char* v = nullptr;
657
+ if (grpc_is_binary_header(GRPC_MDKEY(md))) {
658
+ v = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX);
659
+ } else {
660
+ v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
661
+ }
656
662
  gpr_log(
657
663
  GPR_DEBUG,
658
664
  "Decode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
@@ -665,10 +671,10 @@ static grpc_error *on_hdr(grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p,
665
671
  if (add_to_table) {
666
672
  GPR_ASSERT(GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_INTERNED ||
667
673
  GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC);
668
- grpc_error *err = grpc_chttp2_hptbl_add(exec_ctx, &p->table, md);
674
+ grpc_error* err = grpc_chttp2_hptbl_add(exec_ctx, &p->table, md);
669
675
  if (err != GRPC_ERROR_NONE) return err;
670
676
  }
671
- if (p->on_header == NULL) {
677
+ if (p->on_header == nullptr) {
672
678
  GRPC_MDELEM_UNREF(exec_ctx, md);
673
679
  return GRPC_ERROR_CREATE_FROM_STATIC_STRING("on_header callback not set");
674
680
  }
@@ -676,9 +682,9 @@ static grpc_error *on_hdr(grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p,
676
682
  return GRPC_ERROR_NONE;
677
683
  }
678
684
 
679
- static grpc_slice take_string(grpc_exec_ctx *exec_ctx,
680
- grpc_chttp2_hpack_parser *p,
681
- grpc_chttp2_hpack_parser_string *str,
685
+ static grpc_slice take_string(grpc_exec_ctx* exec_ctx,
686
+ grpc_chttp2_hpack_parser* p,
687
+ grpc_chttp2_hpack_parser_string* str,
682
688
  bool intern) {
683
689
  grpc_slice s;
684
690
  if (!str->copied) {
@@ -702,18 +708,18 @@ static grpc_slice take_string(grpc_exec_ctx *exec_ctx,
702
708
  }
703
709
 
704
710
  /* jump to the next state */
705
- static grpc_error *parse_next(grpc_exec_ctx *exec_ctx,
706
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
707
- const uint8_t *end) {
711
+ static grpc_error* parse_next(grpc_exec_ctx* exec_ctx,
712
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
713
+ const uint8_t* end) {
708
714
  p->state = *p->next_state++;
709
715
  return p->state(exec_ctx, p, cur, end);
710
716
  }
711
717
 
712
718
  /* begin parsing a header: all functionality is encoded into lookup tables
713
719
  above */
714
- static grpc_error *parse_begin(grpc_exec_ctx *exec_ctx,
715
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
716
- const uint8_t *end) {
720
+ static grpc_error* parse_begin(grpc_exec_ctx* exec_ctx,
721
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
722
+ const uint8_t* end) {
717
723
  if (cur == end) {
718
724
  p->state = parse_begin;
719
725
  return GRPC_ERROR_NONE;
@@ -723,9 +729,9 @@ static grpc_error *parse_begin(grpc_exec_ctx *exec_ctx,
723
729
  }
724
730
 
725
731
  /* stream dependency and prioritization data: we just skip it */
726
- static grpc_error *parse_stream_weight(grpc_exec_ctx *exec_ctx,
727
- grpc_chttp2_hpack_parser *p,
728
- const uint8_t *cur, const uint8_t *end) {
732
+ static grpc_error* parse_stream_weight(grpc_exec_ctx* exec_ctx,
733
+ grpc_chttp2_hpack_parser* p,
734
+ const uint8_t* cur, const uint8_t* end) {
729
735
  if (cur == end) {
730
736
  p->state = parse_stream_weight;
731
737
  return GRPC_ERROR_NONE;
@@ -734,9 +740,9 @@ static grpc_error *parse_stream_weight(grpc_exec_ctx *exec_ctx,
734
740
  return p->after_prioritization(exec_ctx, p, cur + 1, end);
735
741
  }
736
742
 
737
- static grpc_error *parse_stream_dep3(grpc_exec_ctx *exec_ctx,
738
- grpc_chttp2_hpack_parser *p,
739
- const uint8_t *cur, const uint8_t *end) {
743
+ static grpc_error* parse_stream_dep3(grpc_exec_ctx* exec_ctx,
744
+ grpc_chttp2_hpack_parser* p,
745
+ const uint8_t* cur, const uint8_t* end) {
740
746
  if (cur == end) {
741
747
  p->state = parse_stream_dep3;
742
748
  return GRPC_ERROR_NONE;
@@ -745,9 +751,9 @@ static grpc_error *parse_stream_dep3(grpc_exec_ctx *exec_ctx,
745
751
  return parse_stream_weight(exec_ctx, p, cur + 1, end);
746
752
  }
747
753
 
748
- static grpc_error *parse_stream_dep2(grpc_exec_ctx *exec_ctx,
749
- grpc_chttp2_hpack_parser *p,
750
- const uint8_t *cur, const uint8_t *end) {
754
+ static grpc_error* parse_stream_dep2(grpc_exec_ctx* exec_ctx,
755
+ grpc_chttp2_hpack_parser* p,
756
+ const uint8_t* cur, const uint8_t* end) {
751
757
  if (cur == end) {
752
758
  p->state = parse_stream_dep2;
753
759
  return GRPC_ERROR_NONE;
@@ -756,9 +762,9 @@ static grpc_error *parse_stream_dep2(grpc_exec_ctx *exec_ctx,
756
762
  return parse_stream_dep3(exec_ctx, p, cur + 1, end);
757
763
  }
758
764
 
759
- static grpc_error *parse_stream_dep1(grpc_exec_ctx *exec_ctx,
760
- grpc_chttp2_hpack_parser *p,
761
- const uint8_t *cur, const uint8_t *end) {
765
+ static grpc_error* parse_stream_dep1(grpc_exec_ctx* exec_ctx,
766
+ grpc_chttp2_hpack_parser* p,
767
+ const uint8_t* cur, const uint8_t* end) {
762
768
  if (cur == end) {
763
769
  p->state = parse_stream_dep1;
764
770
  return GRPC_ERROR_NONE;
@@ -767,9 +773,9 @@ static grpc_error *parse_stream_dep1(grpc_exec_ctx *exec_ctx,
767
773
  return parse_stream_dep2(exec_ctx, p, cur + 1, end);
768
774
  }
769
775
 
770
- static grpc_error *parse_stream_dep0(grpc_exec_ctx *exec_ctx,
771
- grpc_chttp2_hpack_parser *p,
772
- const uint8_t *cur, const uint8_t *end) {
776
+ static grpc_error* parse_stream_dep0(grpc_exec_ctx* exec_ctx,
777
+ grpc_chttp2_hpack_parser* p,
778
+ const uint8_t* cur, const uint8_t* end) {
773
779
  if (cur == end) {
774
780
  p->state = parse_stream_dep0;
775
781
  return GRPC_ERROR_NONE;
@@ -779,10 +785,10 @@ static grpc_error *parse_stream_dep0(grpc_exec_ctx *exec_ctx,
779
785
  }
780
786
 
781
787
  /* emit an indexed field; jumps to begin the next field on completion */
782
- static grpc_error *finish_indexed_field(grpc_exec_ctx *exec_ctx,
783
- grpc_chttp2_hpack_parser *p,
784
- const uint8_t *cur,
785
- const uint8_t *end) {
788
+ static grpc_error* finish_indexed_field(grpc_exec_ctx* exec_ctx,
789
+ grpc_chttp2_hpack_parser* p,
790
+ const uint8_t* cur,
791
+ const uint8_t* end) {
786
792
  grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
787
793
  if (GRPC_MDISNULL(md)) {
788
794
  return grpc_error_set_int(
@@ -793,25 +799,25 @@ static grpc_error *finish_indexed_field(grpc_exec_ctx *exec_ctx,
793
799
  }
794
800
  GRPC_MDELEM_REF(md);
795
801
  GRPC_STATS_INC_HPACK_RECV_INDEXED(exec_ctx);
796
- grpc_error *err = on_hdr(exec_ctx, p, md, 0);
802
+ grpc_error* err = on_hdr(exec_ctx, p, md, 0);
797
803
  if (err != GRPC_ERROR_NONE) return err;
798
804
  return parse_begin(exec_ctx, p, cur, end);
799
805
  }
800
806
 
801
807
  /* parse an indexed field with index < 127 */
802
- static grpc_error *parse_indexed_field(grpc_exec_ctx *exec_ctx,
803
- grpc_chttp2_hpack_parser *p,
804
- const uint8_t *cur, const uint8_t *end) {
808
+ static grpc_error* parse_indexed_field(grpc_exec_ctx* exec_ctx,
809
+ grpc_chttp2_hpack_parser* p,
810
+ const uint8_t* cur, const uint8_t* end) {
805
811
  p->dynamic_table_update_allowed = 0;
806
812
  p->index = (*cur) & 0x7f;
807
813
  return finish_indexed_field(exec_ctx, p, cur + 1, end);
808
814
  }
809
815
 
810
816
  /* parse an indexed field with index >= 127 */
811
- static grpc_error *parse_indexed_field_x(grpc_exec_ctx *exec_ctx,
812
- grpc_chttp2_hpack_parser *p,
813
- const uint8_t *cur,
814
- const uint8_t *end) {
817
+ static grpc_error* parse_indexed_field_x(grpc_exec_ctx* exec_ctx,
818
+ grpc_chttp2_hpack_parser* p,
819
+ const uint8_t* cur,
820
+ const uint8_t* end) {
815
821
  static const grpc_chttp2_hpack_parser_state and_then[] = {
816
822
  finish_indexed_field};
817
823
  p->dynamic_table_update_allowed = 0;
@@ -822,14 +828,14 @@ static grpc_error *parse_indexed_field_x(grpc_exec_ctx *exec_ctx,
822
828
  }
823
829
 
824
830
  /* finish a literal header with incremental indexing */
825
- static grpc_error *finish_lithdr_incidx(grpc_exec_ctx *exec_ctx,
826
- grpc_chttp2_hpack_parser *p,
827
- const uint8_t *cur,
828
- const uint8_t *end) {
831
+ static grpc_error* finish_lithdr_incidx(grpc_exec_ctx* exec_ctx,
832
+ grpc_chttp2_hpack_parser* p,
833
+ const uint8_t* cur,
834
+ const uint8_t* end) {
829
835
  grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
830
836
  GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
831
837
  GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX(exec_ctx);
832
- grpc_error *err = on_hdr(
838
+ grpc_error* err = on_hdr(
833
839
  exec_ctx, p,
834
840
  grpc_mdelem_from_slices(exec_ctx, grpc_slice_ref_internal(GRPC_MDKEY(md)),
835
841
  take_string(exec_ctx, p, &p->value, true)),
@@ -839,12 +845,12 @@ static grpc_error *finish_lithdr_incidx(grpc_exec_ctx *exec_ctx,
839
845
  }
840
846
 
841
847
  /* finish a literal header with incremental indexing with no index */
842
- static grpc_error *finish_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
843
- grpc_chttp2_hpack_parser *p,
844
- const uint8_t *cur,
845
- const uint8_t *end) {
848
+ static grpc_error* finish_lithdr_incidx_v(grpc_exec_ctx* exec_ctx,
849
+ grpc_chttp2_hpack_parser* p,
850
+ const uint8_t* cur,
851
+ const uint8_t* end) {
846
852
  GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX_V(exec_ctx);
847
- grpc_error *err = on_hdr(
853
+ grpc_error* err = on_hdr(
848
854
  exec_ctx, p,
849
855
  grpc_mdelem_from_slices(exec_ctx, take_string(exec_ctx, p, &p->key, true),
850
856
  take_string(exec_ctx, p, &p->value, true)),
@@ -854,9 +860,9 @@ static grpc_error *finish_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
854
860
  }
855
861
 
856
862
  /* parse a literal header with incremental indexing; index < 63 */
857
- static grpc_error *parse_lithdr_incidx(grpc_exec_ctx *exec_ctx,
858
- grpc_chttp2_hpack_parser *p,
859
- const uint8_t *cur, const uint8_t *end) {
863
+ static grpc_error* parse_lithdr_incidx(grpc_exec_ctx* exec_ctx,
864
+ grpc_chttp2_hpack_parser* p,
865
+ const uint8_t* cur, const uint8_t* end) {
860
866
  static const grpc_chttp2_hpack_parser_state and_then[] = {
861
867
  parse_value_string_with_indexed_key, finish_lithdr_incidx};
862
868
  p->dynamic_table_update_allowed = 0;
@@ -866,10 +872,10 @@ static grpc_error *parse_lithdr_incidx(grpc_exec_ctx *exec_ctx,
866
872
  }
867
873
 
868
874
  /* parse a literal header with incremental indexing; index >= 63 */
869
- static grpc_error *parse_lithdr_incidx_x(grpc_exec_ctx *exec_ctx,
870
- grpc_chttp2_hpack_parser *p,
871
- const uint8_t *cur,
872
- const uint8_t *end) {
875
+ static grpc_error* parse_lithdr_incidx_x(grpc_exec_ctx* exec_ctx,
876
+ grpc_chttp2_hpack_parser* p,
877
+ const uint8_t* cur,
878
+ const uint8_t* end) {
873
879
  static const grpc_chttp2_hpack_parser_state and_then[] = {
874
880
  parse_string_prefix, parse_value_string_with_indexed_key,
875
881
  finish_lithdr_incidx};
@@ -881,10 +887,10 @@ static grpc_error *parse_lithdr_incidx_x(grpc_exec_ctx *exec_ctx,
881
887
  }
882
888
 
883
889
  /* parse a literal header with incremental indexing; index = 0 */
884
- static grpc_error *parse_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
885
- grpc_chttp2_hpack_parser *p,
886
- const uint8_t *cur,
887
- const uint8_t *end) {
890
+ static grpc_error* parse_lithdr_incidx_v(grpc_exec_ctx* exec_ctx,
891
+ grpc_chttp2_hpack_parser* p,
892
+ const uint8_t* cur,
893
+ const uint8_t* end) {
888
894
  static const grpc_chttp2_hpack_parser_state and_then[] = {
889
895
  parse_key_string, parse_string_prefix,
890
896
  parse_value_string_with_literal_key, finish_lithdr_incidx_v};
@@ -894,14 +900,14 @@ static grpc_error *parse_lithdr_incidx_v(grpc_exec_ctx *exec_ctx,
894
900
  }
895
901
 
896
902
  /* finish a literal header without incremental indexing */
897
- static grpc_error *finish_lithdr_notidx(grpc_exec_ctx *exec_ctx,
898
- grpc_chttp2_hpack_parser *p,
899
- const uint8_t *cur,
900
- const uint8_t *end) {
903
+ static grpc_error* finish_lithdr_notidx(grpc_exec_ctx* exec_ctx,
904
+ grpc_chttp2_hpack_parser* p,
905
+ const uint8_t* cur,
906
+ const uint8_t* end) {
901
907
  grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
902
908
  GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
903
909
  GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX(exec_ctx);
904
- grpc_error *err = on_hdr(
910
+ grpc_error* err = on_hdr(
905
911
  exec_ctx, p,
906
912
  grpc_mdelem_from_slices(exec_ctx, grpc_slice_ref_internal(GRPC_MDKEY(md)),
907
913
  take_string(exec_ctx, p, &p->value, false)),
@@ -911,12 +917,12 @@ static grpc_error *finish_lithdr_notidx(grpc_exec_ctx *exec_ctx,
911
917
  }
912
918
 
913
919
  /* finish a literal header without incremental indexing with index = 0 */
914
- static grpc_error *finish_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
915
- grpc_chttp2_hpack_parser *p,
916
- const uint8_t *cur,
917
- const uint8_t *end) {
920
+ static grpc_error* finish_lithdr_notidx_v(grpc_exec_ctx* exec_ctx,
921
+ grpc_chttp2_hpack_parser* p,
922
+ const uint8_t* cur,
923
+ const uint8_t* end) {
918
924
  GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX_V(exec_ctx);
919
- grpc_error *err = on_hdr(
925
+ grpc_error* err = on_hdr(
920
926
  exec_ctx, p,
921
927
  grpc_mdelem_from_slices(exec_ctx, take_string(exec_ctx, p, &p->key, true),
922
928
  take_string(exec_ctx, p, &p->value, false)),
@@ -926,9 +932,9 @@ static grpc_error *finish_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
926
932
  }
927
933
 
928
934
  /* parse a literal header without incremental indexing; index < 15 */
929
- static grpc_error *parse_lithdr_notidx(grpc_exec_ctx *exec_ctx,
930
- grpc_chttp2_hpack_parser *p,
931
- const uint8_t *cur, const uint8_t *end) {
935
+ static grpc_error* parse_lithdr_notidx(grpc_exec_ctx* exec_ctx,
936
+ grpc_chttp2_hpack_parser* p,
937
+ const uint8_t* cur, const uint8_t* end) {
932
938
  static const grpc_chttp2_hpack_parser_state and_then[] = {
933
939
  parse_value_string_with_indexed_key, finish_lithdr_notidx};
934
940
  p->dynamic_table_update_allowed = 0;
@@ -938,10 +944,10 @@ static grpc_error *parse_lithdr_notidx(grpc_exec_ctx *exec_ctx,
938
944
  }
939
945
 
940
946
  /* parse a literal header without incremental indexing; index >= 15 */
941
- static grpc_error *parse_lithdr_notidx_x(grpc_exec_ctx *exec_ctx,
942
- grpc_chttp2_hpack_parser *p,
943
- const uint8_t *cur,
944
- const uint8_t *end) {
947
+ static grpc_error* parse_lithdr_notidx_x(grpc_exec_ctx* exec_ctx,
948
+ grpc_chttp2_hpack_parser* p,
949
+ const uint8_t* cur,
950
+ const uint8_t* end) {
945
951
  static const grpc_chttp2_hpack_parser_state and_then[] = {
946
952
  parse_string_prefix, parse_value_string_with_indexed_key,
947
953
  finish_lithdr_notidx};
@@ -953,10 +959,10 @@ static grpc_error *parse_lithdr_notidx_x(grpc_exec_ctx *exec_ctx,
953
959
  }
954
960
 
955
961
  /* parse a literal header without incremental indexing; index == 0 */
956
- static grpc_error *parse_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
957
- grpc_chttp2_hpack_parser *p,
958
- const uint8_t *cur,
959
- const uint8_t *end) {
962
+ static grpc_error* parse_lithdr_notidx_v(grpc_exec_ctx* exec_ctx,
963
+ grpc_chttp2_hpack_parser* p,
964
+ const uint8_t* cur,
965
+ const uint8_t* end) {
960
966
  static const grpc_chttp2_hpack_parser_state and_then[] = {
961
967
  parse_key_string, parse_string_prefix,
962
968
  parse_value_string_with_literal_key, finish_lithdr_notidx_v};
@@ -966,14 +972,14 @@ static grpc_error *parse_lithdr_notidx_v(grpc_exec_ctx *exec_ctx,
966
972
  }
967
973
 
968
974
  /* finish a literal header that is never indexed */
969
- static grpc_error *finish_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
970
- grpc_chttp2_hpack_parser *p,
971
- const uint8_t *cur,
972
- const uint8_t *end) {
975
+ static grpc_error* finish_lithdr_nvridx(grpc_exec_ctx* exec_ctx,
976
+ grpc_chttp2_hpack_parser* p,
977
+ const uint8_t* cur,
978
+ const uint8_t* end) {
973
979
  grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
974
980
  GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
975
981
  GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX(exec_ctx);
976
- grpc_error *err = on_hdr(
982
+ grpc_error* err = on_hdr(
977
983
  exec_ctx, p,
978
984
  grpc_mdelem_from_slices(exec_ctx, grpc_slice_ref_internal(GRPC_MDKEY(md)),
979
985
  take_string(exec_ctx, p, &p->value, false)),
@@ -983,12 +989,12 @@ static grpc_error *finish_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
983
989
  }
984
990
 
985
991
  /* finish a literal header that is never indexed with an extra value */
986
- static grpc_error *finish_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
987
- grpc_chttp2_hpack_parser *p,
988
- const uint8_t *cur,
989
- const uint8_t *end) {
992
+ static grpc_error* finish_lithdr_nvridx_v(grpc_exec_ctx* exec_ctx,
993
+ grpc_chttp2_hpack_parser* p,
994
+ const uint8_t* cur,
995
+ const uint8_t* end) {
990
996
  GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX_V(exec_ctx);
991
- grpc_error *err = on_hdr(
997
+ grpc_error* err = on_hdr(
992
998
  exec_ctx, p,
993
999
  grpc_mdelem_from_slices(exec_ctx, take_string(exec_ctx, p, &p->key, true),
994
1000
  take_string(exec_ctx, p, &p->value, false)),
@@ -998,9 +1004,9 @@ static grpc_error *finish_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
998
1004
  }
999
1005
 
1000
1006
  /* parse a literal header that is never indexed; index < 15 */
1001
- static grpc_error *parse_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
1002
- grpc_chttp2_hpack_parser *p,
1003
- const uint8_t *cur, const uint8_t *end) {
1007
+ static grpc_error* parse_lithdr_nvridx(grpc_exec_ctx* exec_ctx,
1008
+ grpc_chttp2_hpack_parser* p,
1009
+ const uint8_t* cur, const uint8_t* end) {
1004
1010
  static const grpc_chttp2_hpack_parser_state and_then[] = {
1005
1011
  parse_value_string_with_indexed_key, finish_lithdr_nvridx};
1006
1012
  p->dynamic_table_update_allowed = 0;
@@ -1010,10 +1016,10 @@ static grpc_error *parse_lithdr_nvridx(grpc_exec_ctx *exec_ctx,
1010
1016
  }
1011
1017
 
1012
1018
  /* parse a literal header that is never indexed; index >= 15 */
1013
- static grpc_error *parse_lithdr_nvridx_x(grpc_exec_ctx *exec_ctx,
1014
- grpc_chttp2_hpack_parser *p,
1015
- const uint8_t *cur,
1016
- const uint8_t *end) {
1019
+ static grpc_error* parse_lithdr_nvridx_x(grpc_exec_ctx* exec_ctx,
1020
+ grpc_chttp2_hpack_parser* p,
1021
+ const uint8_t* cur,
1022
+ const uint8_t* end) {
1017
1023
  static const grpc_chttp2_hpack_parser_state and_then[] = {
1018
1024
  parse_string_prefix, parse_value_string_with_indexed_key,
1019
1025
  finish_lithdr_nvridx};
@@ -1025,10 +1031,10 @@ static grpc_error *parse_lithdr_nvridx_x(grpc_exec_ctx *exec_ctx,
1025
1031
  }
1026
1032
 
1027
1033
  /* parse a literal header that is never indexed; index == 0 */
1028
- static grpc_error *parse_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
1029
- grpc_chttp2_hpack_parser *p,
1030
- const uint8_t *cur,
1031
- const uint8_t *end) {
1034
+ static grpc_error* parse_lithdr_nvridx_v(grpc_exec_ctx* exec_ctx,
1035
+ grpc_chttp2_hpack_parser* p,
1036
+ const uint8_t* cur,
1037
+ const uint8_t* end) {
1032
1038
  static const grpc_chttp2_hpack_parser_state and_then[] = {
1033
1039
  parse_key_string, parse_string_prefix,
1034
1040
  parse_value_string_with_literal_key, finish_lithdr_nvridx_v};
@@ -1038,22 +1044,22 @@ static grpc_error *parse_lithdr_nvridx_v(grpc_exec_ctx *exec_ctx,
1038
1044
  }
1039
1045
 
1040
1046
  /* finish parsing a max table size change */
1041
- static grpc_error *finish_max_tbl_size(grpc_exec_ctx *exec_ctx,
1042
- grpc_chttp2_hpack_parser *p,
1043
- const uint8_t *cur, const uint8_t *end) {
1044
- if (GRPC_TRACER_ON(grpc_http_trace)) {
1047
+ static grpc_error* finish_max_tbl_size(grpc_exec_ctx* exec_ctx,
1048
+ grpc_chttp2_hpack_parser* p,
1049
+ const uint8_t* cur, const uint8_t* end) {
1050
+ if (grpc_http_trace.enabled()) {
1045
1051
  gpr_log(GPR_INFO, "MAX TABLE SIZE: %d", p->index);
1046
1052
  }
1047
- grpc_error *err =
1053
+ grpc_error* err =
1048
1054
  grpc_chttp2_hptbl_set_current_table_size(exec_ctx, &p->table, p->index);
1049
1055
  if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
1050
1056
  return parse_begin(exec_ctx, p, cur, end);
1051
1057
  }
1052
1058
 
1053
1059
  /* parse a max table size change, max size < 15 */
1054
- static grpc_error *parse_max_tbl_size(grpc_exec_ctx *exec_ctx,
1055
- grpc_chttp2_hpack_parser *p,
1056
- const uint8_t *cur, const uint8_t *end) {
1060
+ static grpc_error* parse_max_tbl_size(grpc_exec_ctx* exec_ctx,
1061
+ grpc_chttp2_hpack_parser* p,
1062
+ const uint8_t* cur, const uint8_t* end) {
1057
1063
  if (p->dynamic_table_update_allowed == 0) {
1058
1064
  return parse_error(
1059
1065
  exec_ctx, p, cur, end,
@@ -1066,10 +1072,10 @@ static grpc_error *parse_max_tbl_size(grpc_exec_ctx *exec_ctx,
1066
1072
  }
1067
1073
 
1068
1074
  /* parse a max table size change, max size >= 15 */
1069
- static grpc_error *parse_max_tbl_size_x(grpc_exec_ctx *exec_ctx,
1070
- grpc_chttp2_hpack_parser *p,
1071
- const uint8_t *cur,
1072
- const uint8_t *end) {
1075
+ static grpc_error* parse_max_tbl_size_x(grpc_exec_ctx* exec_ctx,
1076
+ grpc_chttp2_hpack_parser* p,
1077
+ const uint8_t* cur,
1078
+ const uint8_t* end) {
1073
1079
  static const grpc_chttp2_hpack_parser_state and_then[] = {
1074
1080
  finish_max_tbl_size};
1075
1081
  if (p->dynamic_table_update_allowed == 0) {
@@ -1086,9 +1092,9 @@ static grpc_error *parse_max_tbl_size_x(grpc_exec_ctx *exec_ctx,
1086
1092
  }
1087
1093
 
1088
1094
  /* a parse error: jam the parse state into parse_error, and return error */
1089
- static grpc_error *parse_error(grpc_exec_ctx *exec_ctx,
1090
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1091
- const uint8_t *end, grpc_error *err) {
1095
+ static grpc_error* parse_error(grpc_exec_ctx* exec_ctx,
1096
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1097
+ const uint8_t* end, grpc_error* err) {
1092
1098
  GPR_ASSERT(err != GRPC_ERROR_NONE);
1093
1099
  if (p->last_error == GRPC_ERROR_NONE) {
1094
1100
  p->last_error = GRPC_ERROR_REF(err);
@@ -1097,28 +1103,28 @@ static grpc_error *parse_error(grpc_exec_ctx *exec_ctx,
1097
1103
  return err;
1098
1104
  }
1099
1105
 
1100
- static grpc_error *still_parse_error(grpc_exec_ctx *exec_ctx,
1101
- grpc_chttp2_hpack_parser *p,
1102
- const uint8_t *cur, const uint8_t *end) {
1106
+ static grpc_error* still_parse_error(grpc_exec_ctx* exec_ctx,
1107
+ grpc_chttp2_hpack_parser* p,
1108
+ const uint8_t* cur, const uint8_t* end) {
1103
1109
  return GRPC_ERROR_REF(p->last_error);
1104
1110
  }
1105
1111
 
1106
- static grpc_error *parse_illegal_op(grpc_exec_ctx *exec_ctx,
1107
- grpc_chttp2_hpack_parser *p,
1108
- const uint8_t *cur, const uint8_t *end) {
1112
+ static grpc_error* parse_illegal_op(grpc_exec_ctx* exec_ctx,
1113
+ grpc_chttp2_hpack_parser* p,
1114
+ const uint8_t* cur, const uint8_t* end) {
1109
1115
  GPR_ASSERT(cur != end);
1110
- char *msg;
1116
+ char* msg;
1111
1117
  gpr_asprintf(&msg, "Illegal hpack op code %d", *cur);
1112
- grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1118
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1113
1119
  gpr_free(msg);
1114
1120
  return parse_error(exec_ctx, p, cur, end, err);
1115
1121
  }
1116
1122
 
1117
1123
  /* parse the 1st byte of a varint into p->parsing.value
1118
1124
  no overflow is possible */
1119
- static grpc_error *parse_value0(grpc_exec_ctx *exec_ctx,
1120
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1121
- const uint8_t *end) {
1125
+ static grpc_error* parse_value0(grpc_exec_ctx* exec_ctx,
1126
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1127
+ const uint8_t* end) {
1122
1128
  if (cur == end) {
1123
1129
  p->state = parse_value0;
1124
1130
  return GRPC_ERROR_NONE;
@@ -1135,9 +1141,9 @@ static grpc_error *parse_value0(grpc_exec_ctx *exec_ctx,
1135
1141
 
1136
1142
  /* parse the 2nd byte of a varint into p->parsing.value
1137
1143
  no overflow is possible */
1138
- static grpc_error *parse_value1(grpc_exec_ctx *exec_ctx,
1139
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1140
- const uint8_t *end) {
1144
+ static grpc_error* parse_value1(grpc_exec_ctx* exec_ctx,
1145
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1146
+ const uint8_t* end) {
1141
1147
  if (cur == end) {
1142
1148
  p->state = parse_value1;
1143
1149
  return GRPC_ERROR_NONE;
@@ -1154,9 +1160,9 @@ static grpc_error *parse_value1(grpc_exec_ctx *exec_ctx,
1154
1160
 
1155
1161
  /* parse the 3rd byte of a varint into p->parsing.value
1156
1162
  no overflow is possible */
1157
- static grpc_error *parse_value2(grpc_exec_ctx *exec_ctx,
1158
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1159
- const uint8_t *end) {
1163
+ static grpc_error* parse_value2(grpc_exec_ctx* exec_ctx,
1164
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1165
+ const uint8_t* end) {
1160
1166
  if (cur == end) {
1161
1167
  p->state = parse_value2;
1162
1168
  return GRPC_ERROR_NONE;
@@ -1173,9 +1179,9 @@ static grpc_error *parse_value2(grpc_exec_ctx *exec_ctx,
1173
1179
 
1174
1180
  /* parse the 4th byte of a varint into p->parsing.value
1175
1181
  no overflow is possible */
1176
- static grpc_error *parse_value3(grpc_exec_ctx *exec_ctx,
1177
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1178
- const uint8_t *end) {
1182
+ static grpc_error* parse_value3(grpc_exec_ctx* exec_ctx,
1183
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1184
+ const uint8_t* end) {
1179
1185
  if (cur == end) {
1180
1186
  p->state = parse_value3;
1181
1187
  return GRPC_ERROR_NONE;
@@ -1192,13 +1198,13 @@ static grpc_error *parse_value3(grpc_exec_ctx *exec_ctx,
1192
1198
 
1193
1199
  /* parse the 5th byte of a varint into p->parsing.value
1194
1200
  depending on the byte, we may overflow, and care must be taken */
1195
- static grpc_error *parse_value4(grpc_exec_ctx *exec_ctx,
1196
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1197
- const uint8_t *end) {
1201
+ static grpc_error* parse_value4(grpc_exec_ctx* exec_ctx,
1202
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1203
+ const uint8_t* end) {
1198
1204
  uint8_t c;
1199
1205
  uint32_t cur_value;
1200
1206
  uint32_t add_value;
1201
- char *msg;
1207
+ char* msg;
1202
1208
 
1203
1209
  if (cur == end) {
1204
1210
  p->state = parse_value4;
@@ -1229,7 +1235,7 @@ error:
1229
1235
  "integer overflow in hpack integer decoding: have 0x%08x, "
1230
1236
  "got byte 0x%02x on byte 5",
1231
1237
  *p->parsing.value, *cur);
1232
- grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1238
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1233
1239
  gpr_free(msg);
1234
1240
  return parse_error(exec_ctx, p, cur, end, err);
1235
1241
  }
@@ -1237,9 +1243,9 @@ error:
1237
1243
  /* parse any trailing bytes in a varint: it's possible to append an arbitrary
1238
1244
  number of 0x80's and not affect the value - a zero will terminate - and
1239
1245
  anything else will overflow */
1240
- static grpc_error *parse_value5up(grpc_exec_ctx *exec_ctx,
1241
- grpc_chttp2_hpack_parser *p,
1242
- const uint8_t *cur, const uint8_t *end) {
1246
+ static grpc_error* parse_value5up(grpc_exec_ctx* exec_ctx,
1247
+ grpc_chttp2_hpack_parser* p,
1248
+ const uint8_t* cur, const uint8_t* end) {
1243
1249
  while (cur != end && *cur == 0x80) {
1244
1250
  ++cur;
1245
1251
  }
@@ -1253,20 +1259,20 @@ static grpc_error *parse_value5up(grpc_exec_ctx *exec_ctx,
1253
1259
  return parse_next(exec_ctx, p, cur + 1, end);
1254
1260
  }
1255
1261
 
1256
- char *msg;
1262
+ char* msg;
1257
1263
  gpr_asprintf(&msg,
1258
1264
  "integer overflow in hpack integer decoding: have 0x%08x, "
1259
1265
  "got byte 0x%02x sometime after byte 5",
1260
1266
  *p->parsing.value, *cur);
1261
- grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1267
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1262
1268
  gpr_free(msg);
1263
1269
  return parse_error(exec_ctx, p, cur, end, err);
1264
1270
  }
1265
1271
 
1266
1272
  /* parse a string prefix */
1267
- static grpc_error *parse_string_prefix(grpc_exec_ctx *exec_ctx,
1268
- grpc_chttp2_hpack_parser *p,
1269
- const uint8_t *cur, const uint8_t *end) {
1273
+ static grpc_error* parse_string_prefix(grpc_exec_ctx* exec_ctx,
1274
+ grpc_chttp2_hpack_parser* p,
1275
+ const uint8_t* cur, const uint8_t* end) {
1270
1276
  if (cur == end) {
1271
1277
  p->state = parse_string_prefix;
1272
1278
  return GRPC_ERROR_NONE;
@@ -1283,24 +1289,24 @@ static grpc_error *parse_string_prefix(grpc_exec_ctx *exec_ctx,
1283
1289
  }
1284
1290
 
1285
1291
  /* append some bytes to a string */
1286
- static void append_bytes(grpc_chttp2_hpack_parser_string *str,
1287
- const uint8_t *data, size_t length) {
1292
+ static void append_bytes(grpc_chttp2_hpack_parser_string* str,
1293
+ const uint8_t* data, size_t length) {
1288
1294
  if (length == 0) return;
1289
1295
  if (length + str->data.copied.length > str->data.copied.capacity) {
1290
1296
  GPR_ASSERT(str->data.copied.length + length <= UINT32_MAX);
1291
1297
  str->data.copied.capacity = (uint32_t)(str->data.copied.length + length);
1292
1298
  str->data.copied.str =
1293
- (char *)gpr_realloc(str->data.copied.str, str->data.copied.capacity);
1299
+ (char*)gpr_realloc(str->data.copied.str, str->data.copied.capacity);
1294
1300
  }
1295
1301
  memcpy(str->data.copied.str + str->data.copied.length, data, length);
1296
1302
  GPR_ASSERT(length <= UINT32_MAX - str->data.copied.length);
1297
1303
  str->data.copied.length += (uint32_t)length;
1298
1304
  }
1299
1305
 
1300
- static grpc_error *append_string(grpc_exec_ctx *exec_ctx,
1301
- grpc_chttp2_hpack_parser *p,
1302
- const uint8_t *cur, const uint8_t *end) {
1303
- grpc_chttp2_hpack_parser_string *str = p->parsing.str;
1306
+ static grpc_error* append_string(grpc_exec_ctx* exec_ctx,
1307
+ grpc_chttp2_hpack_parser* p,
1308
+ const uint8_t* cur, const uint8_t* end) {
1309
+ grpc_chttp2_hpack_parser_string* str = p->parsing.str;
1304
1310
  uint32_t bits;
1305
1311
  uint8_t decoded[3];
1306
1312
  switch ((binary_state)p->binary) {
@@ -1397,12 +1403,12 @@ static grpc_error *append_string(grpc_exec_ctx *exec_ctx,
1397
1403
  GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here")));
1398
1404
  }
1399
1405
 
1400
- static grpc_error *finish_str(grpc_exec_ctx *exec_ctx,
1401
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1402
- const uint8_t *end) {
1406
+ static grpc_error* finish_str(grpc_exec_ctx* exec_ctx,
1407
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1408
+ const uint8_t* end) {
1403
1409
  uint8_t decoded[2];
1404
1410
  uint32_t bits;
1405
- grpc_chttp2_hpack_parser_string *str = p->parsing.str;
1411
+ grpc_chttp2_hpack_parser_string* str = p->parsing.str;
1406
1412
  switch ((binary_state)p->binary) {
1407
1413
  case NOT_BINARY:
1408
1414
  break;
@@ -1417,10 +1423,10 @@ static grpc_error *finish_str(grpc_exec_ctx *exec_ctx,
1417
1423
  case B64_BYTE2:
1418
1424
  bits = p->base64_buffer;
1419
1425
  if (bits & 0xffff) {
1420
- char *msg;
1426
+ char* msg;
1421
1427
  gpr_asprintf(&msg, "trailing bits in base64 encoding: 0x%04x",
1422
1428
  bits & 0xffff);
1423
- grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1429
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1424
1430
  gpr_free(msg);
1425
1431
  return parse_error(exec_ctx, p, cur, end, err);
1426
1432
  }
@@ -1430,10 +1436,10 @@ static grpc_error *finish_str(grpc_exec_ctx *exec_ctx,
1430
1436
  case B64_BYTE3:
1431
1437
  bits = p->base64_buffer;
1432
1438
  if (bits & 0xff) {
1433
- char *msg;
1439
+ char* msg;
1434
1440
  gpr_asprintf(&msg, "trailing bits in base64 encoding: 0x%02x",
1435
1441
  bits & 0xff);
1436
- grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1442
+ grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
1437
1443
  gpr_free(msg);
1438
1444
  return parse_error(exec_ctx, p, cur, end, err);
1439
1445
  }
@@ -1446,14 +1452,14 @@ static grpc_error *finish_str(grpc_exec_ctx *exec_ctx,
1446
1452
  }
1447
1453
 
1448
1454
  /* decode a nibble from a huffman encoded stream */
1449
- static grpc_error *huff_nibble(grpc_exec_ctx *exec_ctx,
1450
- grpc_chttp2_hpack_parser *p, uint8_t nibble) {
1455
+ static grpc_error* huff_nibble(grpc_exec_ctx* exec_ctx,
1456
+ grpc_chttp2_hpack_parser* p, uint8_t nibble) {
1451
1457
  int16_t emit = emit_sub_tbl[16 * emit_tbl[p->huff_state] + nibble];
1452
1458
  int16_t next = next_sub_tbl[16 * next_tbl[p->huff_state] + nibble];
1453
1459
  if (emit != -1) {
1454
1460
  if (emit >= 0 && emit < 256) {
1455
1461
  uint8_t c = (uint8_t)emit;
1456
- grpc_error *err = append_string(exec_ctx, p, &c, (&c) + 1);
1462
+ grpc_error* err = append_string(exec_ctx, p, &c, (&c) + 1);
1457
1463
  if (err != GRPC_ERROR_NONE) return err;
1458
1464
  } else {
1459
1465
  assert(emit == 256);
@@ -1464,11 +1470,11 @@ static grpc_error *huff_nibble(grpc_exec_ctx *exec_ctx,
1464
1470
  }
1465
1471
 
1466
1472
  /* decode full bytes from a huffman encoded stream */
1467
- static grpc_error *add_huff_bytes(grpc_exec_ctx *exec_ctx,
1468
- grpc_chttp2_hpack_parser *p,
1469
- const uint8_t *cur, const uint8_t *end) {
1473
+ static grpc_error* add_huff_bytes(grpc_exec_ctx* exec_ctx,
1474
+ grpc_chttp2_hpack_parser* p,
1475
+ const uint8_t* cur, const uint8_t* end) {
1470
1476
  for (; cur != end; ++cur) {
1471
- grpc_error *err = huff_nibble(exec_ctx, p, *cur >> 4);
1477
+ grpc_error* err = huff_nibble(exec_ctx, p, *cur >> 4);
1472
1478
  if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
1473
1479
  err = huff_nibble(exec_ctx, p, *cur & 0xf);
1474
1480
  if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
@@ -1478,9 +1484,9 @@ static grpc_error *add_huff_bytes(grpc_exec_ctx *exec_ctx,
1478
1484
 
1479
1485
  /* decode some string bytes based on the current decoding mode
1480
1486
  (huffman or not) */
1481
- static grpc_error *add_str_bytes(grpc_exec_ctx *exec_ctx,
1482
- grpc_chttp2_hpack_parser *p,
1483
- const uint8_t *cur, const uint8_t *end) {
1487
+ static grpc_error* add_str_bytes(grpc_exec_ctx* exec_ctx,
1488
+ grpc_chttp2_hpack_parser* p,
1489
+ const uint8_t* cur, const uint8_t* end) {
1484
1490
  if (p->huff) {
1485
1491
  return add_huff_bytes(exec_ctx, p, cur, end);
1486
1492
  } else {
@@ -1489,19 +1495,19 @@ static grpc_error *add_str_bytes(grpc_exec_ctx *exec_ctx,
1489
1495
  }
1490
1496
 
1491
1497
  /* parse a string - tries to do large chunks at a time */
1492
- static grpc_error *parse_string(grpc_exec_ctx *exec_ctx,
1493
- grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1494
- const uint8_t *end) {
1498
+ static grpc_error* parse_string(grpc_exec_ctx* exec_ctx,
1499
+ grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1500
+ const uint8_t* end) {
1495
1501
  size_t remaining = p->strlen - p->strgot;
1496
1502
  size_t given = (size_t)(end - cur);
1497
1503
  if (remaining <= given) {
1498
- grpc_error *err = add_str_bytes(exec_ctx, p, cur, cur + remaining);
1504
+ grpc_error* err = add_str_bytes(exec_ctx, p, cur, cur + remaining);
1499
1505
  if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
1500
1506
  err = finish_str(exec_ctx, p, cur + remaining, end);
1501
1507
  if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
1502
1508
  return parse_next(exec_ctx, p, cur + remaining, end);
1503
1509
  } else {
1504
- grpc_error *err = add_str_bytes(exec_ctx, p, cur, cur + given);
1510
+ grpc_error* err = add_str_bytes(exec_ctx, p, cur, cur + given);
1505
1511
  if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
1506
1512
  GPR_ASSERT(given <= UINT32_MAX - p->strgot);
1507
1513
  p->strgot += (uint32_t)given;
@@ -1511,17 +1517,17 @@ static grpc_error *parse_string(grpc_exec_ctx *exec_ctx,
1511
1517
  }
1512
1518
 
1513
1519
  /* begin parsing a string - performs setup, calls parse_string */
1514
- static grpc_error *begin_parse_string(grpc_exec_ctx *exec_ctx,
1515
- grpc_chttp2_hpack_parser *p,
1516
- const uint8_t *cur, const uint8_t *end,
1520
+ static grpc_error* begin_parse_string(grpc_exec_ctx* exec_ctx,
1521
+ grpc_chttp2_hpack_parser* p,
1522
+ const uint8_t* cur, const uint8_t* end,
1517
1523
  uint8_t binary,
1518
- grpc_chttp2_hpack_parser_string *str) {
1524
+ grpc_chttp2_hpack_parser_string* str) {
1519
1525
  if (!p->huff && binary == NOT_BINARY && (end - cur) >= (intptr_t)p->strlen &&
1520
- p->current_slice_refcount != NULL) {
1526
+ p->current_slice_refcount != nullptr) {
1521
1527
  GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED(exec_ctx);
1522
1528
  str->copied = false;
1523
1529
  str->data.referenced.refcount = p->current_slice_refcount;
1524
- str->data.referenced.data.refcounted.bytes = (uint8_t *)cur;
1530
+ str->data.referenced.data.refcounted.bytes = (uint8_t*)cur;
1525
1531
  str->data.referenced.data.refcounted.length = p->strlen;
1526
1532
  grpc_slice_ref_internal(str->data.referenced);
1527
1533
  return parse_next(exec_ctx, p, cur + p->strlen, end);
@@ -1550,23 +1556,23 @@ static grpc_error *begin_parse_string(grpc_exec_ctx *exec_ctx,
1550
1556
  }
1551
1557
 
1552
1558
  /* parse the key string */
1553
- static grpc_error *parse_key_string(grpc_exec_ctx *exec_ctx,
1554
- grpc_chttp2_hpack_parser *p,
1555
- const uint8_t *cur, const uint8_t *end) {
1559
+ static grpc_error* parse_key_string(grpc_exec_ctx* exec_ctx,
1560
+ grpc_chttp2_hpack_parser* p,
1561
+ const uint8_t* cur, const uint8_t* end) {
1556
1562
  return begin_parse_string(exec_ctx, p, cur, end, NOT_BINARY, &p->key);
1557
1563
  }
1558
1564
 
1559
1565
  /* check if a key represents a binary header or not */
1560
1566
 
1561
- static bool is_binary_literal_header(grpc_chttp2_hpack_parser *p) {
1567
+ static bool is_binary_literal_header(grpc_chttp2_hpack_parser* p) {
1562
1568
  return grpc_is_binary_header(
1563
1569
  p->key.copied ? grpc_slice_from_static_buffer(p->key.data.copied.str,
1564
1570
  p->key.data.copied.length)
1565
1571
  : p->key.data.referenced);
1566
1572
  }
1567
1573
 
1568
- static grpc_error *is_binary_indexed_header(grpc_chttp2_hpack_parser *p,
1569
- bool *is) {
1574
+ static grpc_error* is_binary_indexed_header(grpc_chttp2_hpack_parser* p,
1575
+ bool* is) {
1570
1576
  grpc_mdelem elem = grpc_chttp2_hptbl_lookup(&p->table, p->index);
1571
1577
  if (GRPC_MDISNULL(elem)) {
1572
1578
  return grpc_error_set_int(
@@ -1580,42 +1586,42 @@ static grpc_error *is_binary_indexed_header(grpc_chttp2_hpack_parser *p,
1580
1586
  }
1581
1587
 
1582
1588
  /* parse the value string */
1583
- static grpc_error *parse_value_string(grpc_exec_ctx *exec_ctx,
1584
- grpc_chttp2_hpack_parser *p,
1585
- const uint8_t *cur, const uint8_t *end,
1589
+ static grpc_error* parse_value_string(grpc_exec_ctx* exec_ctx,
1590
+ grpc_chttp2_hpack_parser* p,
1591
+ const uint8_t* cur, const uint8_t* end,
1586
1592
  bool is_binary) {
1587
1593
  return begin_parse_string(exec_ctx, p, cur, end,
1588
1594
  is_binary ? BINARY_BEGIN : NOT_BINARY, &p->value);
1589
1595
  }
1590
1596
 
1591
- static grpc_error *parse_value_string_with_indexed_key(
1592
- grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1593
- const uint8_t *end) {
1597
+ static grpc_error* parse_value_string_with_indexed_key(
1598
+ grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1599
+ const uint8_t* end) {
1594
1600
  bool is_binary = false;
1595
- grpc_error *err = is_binary_indexed_header(p, &is_binary);
1601
+ grpc_error* err = is_binary_indexed_header(p, &is_binary);
1596
1602
  if (err != GRPC_ERROR_NONE) return parse_error(exec_ctx, p, cur, end, err);
1597
1603
  return parse_value_string(exec_ctx, p, cur, end, is_binary);
1598
1604
  }
1599
1605
 
1600
- static grpc_error *parse_value_string_with_literal_key(
1601
- grpc_exec_ctx *exec_ctx, grpc_chttp2_hpack_parser *p, const uint8_t *cur,
1602
- const uint8_t *end) {
1606
+ static grpc_error* parse_value_string_with_literal_key(
1607
+ grpc_exec_ctx* exec_ctx, grpc_chttp2_hpack_parser* p, const uint8_t* cur,
1608
+ const uint8_t* end) {
1603
1609
  return parse_value_string(exec_ctx, p, cur, end, is_binary_literal_header(p));
1604
1610
  }
1605
1611
 
1606
1612
  /* PUBLIC INTERFACE */
1607
1613
 
1608
- void grpc_chttp2_hpack_parser_init(grpc_exec_ctx *exec_ctx,
1609
- grpc_chttp2_hpack_parser *p) {
1610
- p->on_header = NULL;
1611
- p->on_header_user_data = NULL;
1614
+ void grpc_chttp2_hpack_parser_init(grpc_exec_ctx* exec_ctx,
1615
+ grpc_chttp2_hpack_parser* p) {
1616
+ p->on_header = nullptr;
1617
+ p->on_header_user_data = nullptr;
1612
1618
  p->state = parse_begin;
1613
1619
  p->key.data.referenced = grpc_empty_slice();
1614
- p->key.data.copied.str = NULL;
1620
+ p->key.data.copied.str = nullptr;
1615
1621
  p->key.data.copied.capacity = 0;
1616
1622
  p->key.data.copied.length = 0;
1617
1623
  p->value.data.referenced = grpc_empty_slice();
1618
- p->value.data.copied.str = NULL;
1624
+ p->value.data.copied.str = nullptr;
1619
1625
  p->value.data.copied.capacity = 0;
1620
1626
  p->value.data.copied.length = 0;
1621
1627
  p->dynamic_table_update_allowed = 2;
@@ -1623,13 +1629,13 @@ void grpc_chttp2_hpack_parser_init(grpc_exec_ctx *exec_ctx,
1623
1629
  grpc_chttp2_hptbl_init(exec_ctx, &p->table);
1624
1630
  }
1625
1631
 
1626
- void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser *p) {
1632
+ void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p) {
1627
1633
  p->after_prioritization = p->state;
1628
1634
  p->state = parse_stream_dep0;
1629
1635
  }
1630
1636
 
1631
- void grpc_chttp2_hpack_parser_destroy(grpc_exec_ctx *exec_ctx,
1632
- grpc_chttp2_hpack_parser *p) {
1637
+ void grpc_chttp2_hpack_parser_destroy(grpc_exec_ctx* exec_ctx,
1638
+ grpc_chttp2_hpack_parser* p) {
1633
1639
  grpc_chttp2_hptbl_destroy(exec_ctx, &p->table);
1634
1640
  GRPC_ERROR_UNREF(p->last_error);
1635
1641
  grpc_slice_unref_internal(exec_ctx, p->key.data.referenced);
@@ -1638,36 +1644,36 @@ void grpc_chttp2_hpack_parser_destroy(grpc_exec_ctx *exec_ctx,
1638
1644
  gpr_free(p->value.data.copied.str);
1639
1645
  }
1640
1646
 
1641
- grpc_error *grpc_chttp2_hpack_parser_parse(grpc_exec_ctx *exec_ctx,
1642
- grpc_chttp2_hpack_parser *p,
1647
+ grpc_error* grpc_chttp2_hpack_parser_parse(grpc_exec_ctx* exec_ctx,
1648
+ grpc_chttp2_hpack_parser* p,
1643
1649
  grpc_slice slice) {
1644
1650
  /* max number of bytes to parse at a time... limits call stack depth on
1645
1651
  * compilers without TCO */
1646
1652
  #define MAX_PARSE_LENGTH 1024
1647
1653
  p->current_slice_refcount = slice.refcount;
1648
- uint8_t *start = GRPC_SLICE_START_PTR(slice);
1649
- uint8_t *end = GRPC_SLICE_END_PTR(slice);
1650
- grpc_error *error = GRPC_ERROR_NONE;
1654
+ uint8_t* start = GRPC_SLICE_START_PTR(slice);
1655
+ uint8_t* end = GRPC_SLICE_END_PTR(slice);
1656
+ grpc_error* error = GRPC_ERROR_NONE;
1651
1657
  while (start != end && error == GRPC_ERROR_NONE) {
1652
- uint8_t *target = start + GPR_MIN(MAX_PARSE_LENGTH, end - start);
1658
+ uint8_t* target = start + GPR_MIN(MAX_PARSE_LENGTH, end - start);
1653
1659
  error = p->state(exec_ctx, p, start, target);
1654
1660
  start = target;
1655
1661
  }
1656
- p->current_slice_refcount = NULL;
1662
+ p->current_slice_refcount = nullptr;
1657
1663
  return error;
1658
1664
  }
1659
1665
 
1660
- typedef void (*maybe_complete_func_type)(grpc_exec_ctx *exec_ctx,
1661
- grpc_chttp2_transport *t,
1662
- grpc_chttp2_stream *s);
1666
+ typedef void (*maybe_complete_func_type)(grpc_exec_ctx* exec_ctx,
1667
+ grpc_chttp2_transport* t,
1668
+ grpc_chttp2_stream* s);
1663
1669
  static const maybe_complete_func_type maybe_complete_funcs[] = {
1664
1670
  grpc_chttp2_maybe_complete_recv_initial_metadata,
1665
1671
  grpc_chttp2_maybe_complete_recv_trailing_metadata};
1666
1672
 
1667
- static void force_client_rst_stream(grpc_exec_ctx *exec_ctx, void *sp,
1668
- grpc_error *error) {
1669
- grpc_chttp2_stream *s = (grpc_chttp2_stream *)sp;
1670
- grpc_chttp2_transport *t = s->t;
1673
+ static void force_client_rst_stream(grpc_exec_ctx* exec_ctx, void* sp,
1674
+ grpc_error* error) {
1675
+ grpc_chttp2_stream* s = (grpc_chttp2_stream*)sp;
1676
+ grpc_chttp2_transport* t = s->t;
1671
1677
  if (!s->write_closed) {
1672
1678
  grpc_slice_buffer_add(
1673
1679
  &t->qbuf, grpc_chttp2_rst_stream_create(s->id, GRPC_HTTP2_NO_ERROR,
@@ -1679,11 +1685,11 @@ static void force_client_rst_stream(grpc_exec_ctx *exec_ctx, void *sp,
1679
1685
  GRPC_CHTTP2_STREAM_UNREF(exec_ctx, s, "final_rst");
1680
1686
  }
1681
1687
 
1682
- static void parse_stream_compression_md(grpc_exec_ctx *exec_ctx,
1683
- grpc_chttp2_transport *t,
1684
- grpc_chttp2_stream *s,
1685
- grpc_metadata_batch *initial_metadata) {
1686
- if (initial_metadata->idx.named.content_encoding == NULL ||
1688
+ static void parse_stream_compression_md(grpc_exec_ctx* exec_ctx,
1689
+ grpc_chttp2_transport* t,
1690
+ grpc_chttp2_stream* s,
1691
+ grpc_metadata_batch* initial_metadata) {
1692
+ if (initial_metadata->idx.named.content_encoding == nullptr ||
1687
1693
  grpc_stream_compression_method_parse(
1688
1694
  GRPC_MDVALUE(initial_metadata->idx.named.content_encoding->md), false,
1689
1695
  &s->stream_decompression_method) == 0) {
@@ -1692,17 +1698,17 @@ static void parse_stream_compression_md(grpc_exec_ctx *exec_ctx,
1692
1698
  }
1693
1699
  }
1694
1700
 
1695
- grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
1696
- void *hpack_parser,
1697
- grpc_chttp2_transport *t,
1698
- grpc_chttp2_stream *s,
1701
+ grpc_error* grpc_chttp2_header_parser_parse(grpc_exec_ctx* exec_ctx,
1702
+ void* hpack_parser,
1703
+ grpc_chttp2_transport* t,
1704
+ grpc_chttp2_stream* s,
1699
1705
  grpc_slice slice, int is_last) {
1700
- grpc_chttp2_hpack_parser *parser = (grpc_chttp2_hpack_parser *)hpack_parser;
1706
+ grpc_chttp2_hpack_parser* parser = (grpc_chttp2_hpack_parser*)hpack_parser;
1701
1707
  GPR_TIMER_BEGIN("grpc_chttp2_hpack_parser_parse", 0);
1702
- if (s != NULL) {
1708
+ if (s != nullptr) {
1703
1709
  s->stats.incoming.header_bytes += GRPC_SLICE_LENGTH(slice);
1704
1710
  }
1705
- grpc_error *error = grpc_chttp2_hpack_parser_parse(exec_ctx, parser, slice);
1711
+ grpc_error* error = grpc_chttp2_hpack_parser_parse(exec_ctx, parser, slice);
1706
1712
  if (error != GRPC_ERROR_NONE) {
1707
1713
  GPR_TIMER_END("grpc_chttp2_hpack_parser_parse", 0);
1708
1714
  return error;
@@ -1715,7 +1721,7 @@ grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
1715
1721
  }
1716
1722
  /* need to check for null stream: this can occur if we receive an invalid
1717
1723
  stream id on a header */
1718
- if (s != NULL) {
1724
+ if (s != nullptr) {
1719
1725
  if (parser->is_boundary) {
1720
1726
  if (s->header_frames_received == GPR_ARRAY_SIZE(s->metadata_buffer)) {
1721
1727
  GPR_TIMER_END("grpc_chttp2_hpack_parser_parse", 0);
@@ -1750,8 +1756,8 @@ grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx,
1750
1756
  GRPC_ERROR_NONE);
1751
1757
  }
1752
1758
  }
1753
- parser->on_header = NULL;
1754
- parser->on_header_user_data = NULL;
1759
+ parser->on_header = nullptr;
1760
+ parser->on_header_user_data = nullptr;
1755
1761
  parser->is_boundary = 0xde;
1756
1762
  parser->is_eof = 0xde;
1757
1763
  parser->dynamic_table_update_allowed = 2;