grpc 1.43.1 → 1.48.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 (1686) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +488 -338
  3. data/include/grpc/compression.h +1 -1
  4. data/include/grpc/event_engine/event_engine.h +64 -20
  5. data/include/grpc/event_engine/memory_allocator.h +0 -15
  6. data/include/grpc/event_engine/port.h +1 -1
  7. data/include/grpc/event_engine/slice.h +286 -0
  8. data/include/grpc/event_engine/slice_buffer.h +118 -0
  9. data/include/grpc/grpc.h +43 -17
  10. data/include/grpc/grpc_posix.h +20 -19
  11. data/include/grpc/grpc_security.h +47 -50
  12. data/include/grpc/impl/codegen/compression_types.h +2 -3
  13. data/include/grpc/impl/codegen/connectivity_state.h +2 -1
  14. data/include/grpc/impl/codegen/gpr_types.h +2 -1
  15. data/include/grpc/impl/codegen/grpc_types.h +26 -22
  16. data/include/grpc/impl/codegen/port_platform.h +107 -40
  17. data/include/grpc/impl/codegen/slice.h +5 -2
  18. data/include/grpc/slice.h +0 -11
  19. data/src/core/ext/filters/census/grpc_context.cc +3 -0
  20. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +309 -0
  21. data/src/core/ext/filters/channel_idle/channel_idle_filter.h +141 -0
  22. data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.cc +1 -1
  23. data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.h +7 -5
  24. data/src/core/ext/filters/client_channel/backend_metric.cc +20 -15
  25. data/src/core/ext/filters/client_channel/backend_metric.h +19 -9
  26. data/src/core/ext/filters/client_channel/backup_poller.cc +20 -14
  27. data/src/core/ext/filters/client_channel/backup_poller.h +2 -4
  28. data/src/core/ext/filters/client_channel/channel_connectivity.cc +48 -26
  29. data/src/core/ext/filters/client_channel/client_channel.cc +413 -301
  30. data/src/core/ext/filters/client_channel/client_channel.h +83 -45
  31. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +3 -5
  32. data/src/core/ext/filters/client_channel/client_channel_channelz.h +12 -2
  33. data/src/core/ext/filters/client_channel/client_channel_factory.cc +5 -0
  34. data/src/core/ext/filters/client_channel/client_channel_factory.h +8 -0
  35. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +8 -23
  36. data/src/core/ext/filters/client_channel/config_selector.cc +1 -0
  37. data/src/core/ext/filters/client_channel/config_selector.h +12 -10
  38. data/src/core/ext/filters/client_channel/connector.h +10 -4
  39. data/src/core/ext/filters/client_channel/dynamic_filters.cc +20 -8
  40. data/src/core/ext/filters/client_channel/dynamic_filters.h +14 -4
  41. data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +4 -22
  42. data/src/core/ext/filters/client_channel/global_subchannel_pool.h +6 -15
  43. data/src/core/ext/filters/client_channel/health/health_check_client.cc +140 -583
  44. data/src/core/ext/filters/client_channel/health/health_check_client.h +26 -160
  45. data/src/core/ext/filters/client_channel/http_proxy.cc +98 -112
  46. data/src/core/ext/filters/client_channel/http_proxy.h +20 -0
  47. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +10 -5
  48. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
  49. data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +49 -0
  50. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +12 -0
  51. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +5 -0
  52. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +15 -12
  53. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +1 -0
  54. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +227 -137
  55. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -7
  56. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +4 -0
  57. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +1 -1
  58. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +6 -0
  59. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +25 -16
  60. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +10 -7
  61. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +407 -0
  62. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +57 -0
  63. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +1036 -0
  64. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +54 -0
  65. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +196 -176
  66. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +364 -224
  67. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +381 -233
  68. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +6 -1
  69. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +253 -175
  70. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +261 -234
  71. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +133 -120
  72. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +155 -105
  73. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +172 -84
  74. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +7 -1
  75. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +99 -46
  76. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +55 -30
  77. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +355 -394
  78. data/src/core/ext/filters/client_channel/lb_policy.cc +19 -16
  79. data/src/core/ext/filters/client_channel/lb_policy.h +37 -34
  80. data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -0
  81. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +11 -6
  82. data/src/core/ext/filters/client_channel/lb_policy_registry.h +6 -1
  83. data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +4 -0
  84. data/src/core/ext/filters/client_channel/local_subchannel_pool.h +1 -0
  85. data/src/core/ext/filters/client_channel/proxy_mapper.h +1 -1
  86. data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +1 -0
  87. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +5 -0
  88. data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +36 -22
  89. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +383 -318
  90. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +30 -13
  91. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +29 -23
  92. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +29 -44
  93. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +172 -240
  94. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +38 -36
  95. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +3 -2
  96. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc +2 -0
  97. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +2 -1
  98. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +123 -254
  99. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +37 -37
  100. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -3
  101. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +144 -77
  102. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +213 -0
  103. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +113 -0
  104. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +56 -50
  105. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +368 -167
  106. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -1
  107. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +19 -28
  108. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +22 -10
  109. data/src/core/ext/filters/client_channel/retry_filter.cc +322 -201
  110. data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
  111. data/src/core/ext/filters/client_channel/retry_service_config.cc +27 -30
  112. data/src/core/ext/filters/client_channel/retry_service_config.h +28 -13
  113. data/src/core/ext/filters/client_channel/retry_throttle.cc +10 -31
  114. data/src/core/ext/filters/client_channel/retry_throttle.h +18 -6
  115. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +30 -11
  116. data/src/core/ext/filters/client_channel/subchannel.cc +227 -235
  117. data/src/core/ext/filters/client_channel/subchannel.h +84 -40
  118. data/src/core/ext/filters/client_channel/subchannel_interface.h +51 -41
  119. data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +38 -0
  120. data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +12 -2
  121. data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +6 -3
  122. data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +473 -0
  123. data/src/core/ext/filters/client_channel/subchannel_stream_client.h +222 -0
  124. data/src/core/ext/filters/deadline/deadline_filter.cc +31 -21
  125. data/src/core/ext/filters/deadline/deadline_filter.h +11 -3
  126. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +173 -402
  127. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +31 -3
  128. data/src/core/ext/filters/fault_injection/service_config_parser.cc +18 -17
  129. data/src/core/ext/filters/fault_injection/service_config_parser.h +27 -7
  130. data/src/core/ext/filters/http/client/http_client_filter.cc +108 -535
  131. data/src/core/ext/filters/http/client/http_client_filter.h +35 -5
  132. data/src/core/ext/filters/http/client_authority_filter.cc +44 -112
  133. data/src/core/ext/filters/http/client_authority_filter.h +28 -6
  134. data/src/core/ext/filters/http/http_filters_plugin.cc +33 -24
  135. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +101 -320
  136. data/src/core/ext/filters/http/message_compress/message_compress_filter.h +1 -2
  137. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +59 -133
  138. data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +1 -0
  139. data/src/core/ext/filters/http/server/http_server_filter.cc +100 -458
  140. data/src/core/ext/filters/http/server/http_server_filter.h +37 -3
  141. data/src/core/ext/filters/message_size/message_size_filter.cc +66 -70
  142. data/src/core/ext/filters/message_size/message_size_filter.h +25 -5
  143. data/src/core/ext/filters/rbac/rbac_filter.cc +174 -0
  144. data/src/core/ext/filters/rbac/rbac_filter.h +84 -0
  145. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +617 -0
  146. data/src/core/ext/filters/rbac/rbac_service_config_parser.h +87 -0
  147. data/src/core/ext/filters/server_config_selector/server_config_selector.cc +3 -8
  148. data/src/core/ext/filters/server_config_selector/server_config_selector.h +14 -4
  149. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +97 -199
  150. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +1 -0
  151. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +278 -77
  152. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +9 -7
  153. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +288 -56
  154. data/src/core/ext/transport/chttp2/server/chttp2_server.h +2 -0
  155. data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +3 -3
  156. data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -1
  157. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -0
  158. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +512 -710
  159. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +14 -3
  160. data/src/core/ext/transport/chttp2/transport/context_list.cc +4 -0
  161. data/src/core/ext/transport/chttp2/transport/context_list.h +4 -1
  162. data/src/core/ext/transport/chttp2/transport/flow_control.cc +147 -263
  163. data/src/core/ext/transport/chttp2/transport/flow_control.h +180 -289
  164. data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
  165. data/src/core/ext/transport/chttp2/transport/frame_data.cc +59 -212
  166. data/src/core/ext/transport/chttp2/transport/frame_data.h +13 -36
  167. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +3 -0
  168. data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -1
  169. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +9 -4
  170. data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
  171. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +11 -2
  172. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -0
  173. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +12 -42
  174. data/src/core/ext/transport/chttp2/transport/frame_settings.h +4 -0
  175. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +10 -12
  176. data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -0
  177. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +349 -290
  178. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +85 -162
  179. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +4 -1
  180. data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +5 -0
  181. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +61 -91
  182. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -2
  183. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +146 -37
  184. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +41 -46
  185. data/src/core/ext/transport/chttp2/transport/http2_settings.h +0 -1
  186. data/src/core/ext/transport/chttp2/transport/internal.h +41 -153
  187. data/src/core/ext/transport/chttp2/transport/parsing.cc +87 -51
  188. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +11 -11
  189. data/src/core/ext/transport/chttp2/transport/stream_map.cc +1 -1
  190. data/src/core/ext/transport/chttp2/transport/stream_map.h +1 -0
  191. data/src/core/ext/transport/chttp2/transport/varint.h +2 -0
  192. data/src/core/ext/transport/chttp2/transport/writing.cc +135 -157
  193. data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -5
  194. data/src/core/ext/transport/inproc/inproc_transport.cc +117 -158
  195. data/src/core/ext/transport/inproc/inproc_transport.h +3 -4
  196. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +117 -0
  197. data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +482 -0
  198. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +121 -0
  199. data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +553 -0
  200. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +182 -176
  201. data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +1248 -685
  202. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +56 -0
  203. data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +151 -0
  204. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +62 -0
  205. data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +160 -0
  206. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +46 -0
  207. data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +124 -0
  208. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +43 -0
  209. data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +102 -0
  210. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +43 -0
  211. data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +97 -0
  212. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +106 -0
  213. data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +605 -0
  214. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +48 -0
  215. data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +103 -0
  216. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +14 -12
  217. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +49 -16
  218. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +13 -11
  219. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +49 -23
  220. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +98 -96
  221. data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +669 -386
  222. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +185 -173
  223. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1269 -664
  224. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +34 -26
  225. data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +200 -91
  226. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +252 -238
  227. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +1670 -827
  228. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +10 -8
  229. data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +42 -24
  230. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +49 -27
  231. data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +272 -99
  232. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +299 -0
  233. data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +1381 -0
  234. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +54 -50
  235. data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +354 -190
  236. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +11 -8
  237. data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +45 -25
  238. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +157 -154
  239. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1068 -582
  240. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +87 -42
  241. data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +525 -167
  242. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +9 -7
  243. data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +38 -24
  244. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +11 -29
  245. data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +41 -101
  246. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +58 -0
  247. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +151 -0
  248. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +108 -104
  249. data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +768 -410
  250. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +115 -84
  251. data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +736 -349
  252. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +11 -9
  253. data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +57 -31
  254. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +162 -108
  255. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +992 -397
  256. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +8 -6
  257. data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +28 -17
  258. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +15 -13
  259. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +83 -49
  260. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +13 -11
  261. data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +75 -34
  262. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +15 -13
  263. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +93 -49
  264. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +11 -9
  265. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +46 -26
  266. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +34 -32
  267. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +194 -109
  268. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +51 -48
  269. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +349 -190
  270. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +49 -47
  271. data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +357 -188
  272. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +9 -7
  273. data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +34 -21
  274. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +72 -61
  275. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +504 -260
  276. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +77 -69
  277. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +560 -301
  278. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +19 -15
  279. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +104 -49
  280. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +12 -10
  281. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +66 -41
  282. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +53 -0
  283. data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +136 -0
  284. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +58 -55
  285. data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +413 -235
  286. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +62 -60
  287. data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +406 -237
  288. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +82 -76
  289. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +562 -294
  290. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +37 -31
  291. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +271 -142
  292. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +503 -475
  293. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +3642 -1901
  294. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +25 -19
  295. data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +148 -72
  296. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +222 -0
  297. data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +1052 -0
  298. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +44 -0
  299. data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +88 -0
  300. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +49 -0
  301. data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +103 -0
  302. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +15 -13
  303. data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +77 -46
  304. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +52 -0
  305. data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +134 -0
  306. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +63 -0
  307. data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +250 -0
  308. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +47 -0
  309. data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +94 -0
  310. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +69 -0
  311. data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +213 -0
  312. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +32 -0
  313. data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +42 -0
  314. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +71 -0
  315. data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +218 -0
  316. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +54 -0
  317. data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +146 -0
  318. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +8 -6
  319. data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +34 -24
  320. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +29 -27
  321. data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +188 -113
  322. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +36 -34
  323. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +260 -132
  324. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +64 -0
  325. data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +183 -0
  326. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +16 -14
  327. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +86 -43
  328. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +229 -198
  329. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1553 -734
  330. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +52 -0
  331. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +164 -0
  332. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +46 -0
  333. data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +94 -0
  334. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +3 -1
  335. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +2 -1
  336. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +87 -58
  337. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +554 -235
  338. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +26 -24
  339. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +156 -87
  340. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +98 -71
  341. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +622 -263
  342. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +62 -0
  343. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +160 -0
  344. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +6 -4
  345. data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +22 -16
  346. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +67 -65
  347. data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +474 -256
  348. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +18 -16
  349. data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +107 -62
  350. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +51 -49
  351. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +347 -186
  352. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +48 -0
  353. data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +112 -0
  354. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +20 -18
  355. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +124 -82
  356. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +74 -0
  357. data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +214 -0
  358. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +16 -14
  359. data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +99 -57
  360. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +10 -8
  361. data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +50 -31
  362. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +10 -8
  363. data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +48 -27
  364. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +9 -7
  365. data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +38 -24
  366. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +21 -19
  367. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +117 -69
  368. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +19 -17
  369. data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +123 -65
  370. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +14 -12
  371. data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +85 -53
  372. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +23 -21
  373. data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +150 -83
  374. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +32 -30
  375. data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +230 -146
  376. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +36 -34
  377. data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +235 -131
  378. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +66 -0
  379. data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +201 -0
  380. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +3 -1
  381. data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +2 -1
  382. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +42 -0
  383. data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +139 -0
  384. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +13 -11
  385. data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +62 -36
  386. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +19 -17
  387. data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +98 -52
  388. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +26 -0
  389. data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +41 -0
  390. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +10 -8
  391. data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +40 -19
  392. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +51 -0
  393. data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +127 -0
  394. data/src/core/ext/upb-generated/google/api/annotations.upb.c +8 -6
  395. data/src/core/ext/upb-generated/google/api/annotations.upb.h +22 -6
  396. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +109 -103
  397. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +720 -382
  398. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +120 -112
  399. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +795 -402
  400. data/src/core/ext/upb-generated/google/api/http.upb.c +29 -27
  401. data/src/core/ext/upb-generated/google/api/http.upb.h +216 -115
  402. data/src/core/ext/upb-generated/google/api/httpbody.upb.c +46 -0
  403. data/src/core/ext/upb-generated/google/api/httpbody.upb.h +111 -0
  404. data/src/core/ext/upb-generated/google/protobuf/any.upb.c +9 -7
  405. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +38 -22
  406. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +291 -237
  407. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +2076 -1030
  408. data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +9 -7
  409. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +36 -20
  410. data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +6 -4
  411. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +22 -16
  412. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +31 -29
  413. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +177 -93
  414. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +9 -7
  415. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +36 -20
  416. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +40 -38
  417. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +240 -149
  418. data/src/core/ext/upb-generated/google/rpc/status.upb.c +11 -9
  419. data/src/core/ext/upb-generated/google/rpc/status.upb.h +52 -30
  420. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +84 -0
  421. data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +319 -0
  422. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +21 -19
  423. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +103 -48
  424. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +102 -96
  425. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +685 -359
  426. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +16 -13
  427. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +76 -41
  428. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +12 -10
  429. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +56 -35
  430. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +57 -55
  431. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +383 -219
  432. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +22 -20
  433. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +115 -63
  434. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
  435. data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +764 -0
  436. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +36 -34
  437. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +189 -78
  438. data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +14 -12
  439. data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +53 -22
  440. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +7 -5
  441. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +15 -6
  442. data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +14 -12
  443. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +55 -24
  444. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +13 -11
  445. data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +49 -23
  446. data/src/core/ext/upb-generated/validate/validate.upb.c +339 -312
  447. data/src/core/ext/upb-generated/validate/validate.upb.h +2726 -1180
  448. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +110 -0
  449. data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +278 -0
  450. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +55 -0
  451. data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +108 -0
  452. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +38 -0
  453. data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +46 -0
  454. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +34 -32
  455. data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +171 -80
  456. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +53 -0
  457. data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +99 -0
  458. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +8 -6
  459. data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +30 -19
  460. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +18 -16
  461. data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +98 -55
  462. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +14 -12
  463. data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +53 -30
  464. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +46 -0
  465. data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +103 -0
  466. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +12 -10
  467. data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +55 -30
  468. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +20 -18
  469. data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +130 -70
  470. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +12 -10
  471. data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +58 -30
  472. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +23 -21
  473. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +101 -46
  474. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +47 -0
  475. data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +109 -0
  476. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +207 -0
  477. data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +878 -0
  478. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +52 -0
  479. data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +143 -0
  480. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +65 -0
  481. data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +218 -0
  482. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +10 -8
  483. data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +42 -24
  484. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +84 -0
  485. data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +55 -0
  486. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +127 -0
  487. data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +50 -0
  488. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +14 -12
  489. data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +67 -67
  490. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +43 -0
  491. data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +40 -0
  492. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +53 -0
  493. data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +40 -0
  494. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +49 -0
  495. data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +35 -0
  496. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +46 -0
  497. data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +35 -0
  498. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +46 -0
  499. data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +35 -0
  500. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +142 -0
  501. data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +40 -0
  502. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +51 -0
  503. data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +35 -0
  504. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +8 -6
  505. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +1 -1
  506. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +8 -6
  507. data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +4 -4
  508. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +20 -17
  509. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +46 -46
  510. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +248 -240
  511. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +55 -55
  512. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +58 -51
  513. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +10 -10
  514. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +385 -371
  515. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +76 -76
  516. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +14 -11
  517. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +4 -4
  518. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +23 -16
  519. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +4 -4
  520. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +206 -0
  521. data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +105 -0
  522. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +15 -13
  523. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +22 -22
  524. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +15 -12
  525. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +4 -4
  526. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +85 -80
  527. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +73 -73
  528. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +138 -101
  529. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +26 -16
  530. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +14 -12
  531. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +4 -4
  532. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +22 -34
  533. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +4 -9
  534. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +53 -0
  535. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +40 -0
  536. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +21 -18
  537. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +43 -43
  538. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +177 -166
  539. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +30 -25
  540. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +14 -12
  541. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +4 -4
  542. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +250 -221
  543. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +53 -43
  544. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +12 -9
  545. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +4 -4
  546. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +14 -11
  547. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +7 -7
  548. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +14 -11
  549. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +4 -4
  550. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +18 -15
  551. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +4 -4
  552. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +13 -11
  553. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +4 -4
  554. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +18 -15
  555. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +13 -13
  556. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +19 -16
  557. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +19 -19
  558. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +18 -15
  559. data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +16 -16
  560. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +14 -11
  561. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +4 -4
  562. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +52 -45
  563. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +19 -19
  564. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +153 -147
  565. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +22 -22
  566. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +19 -16
  567. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +4 -4
  568. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +15 -12
  569. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +7 -7
  570. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +69 -0
  571. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +35 -0
  572. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +17 -14
  573. data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +25 -25
  574. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +17 -14
  575. data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +28 -28
  576. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +190 -0
  577. data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +70 -0
  578. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +36 -27
  579. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +10 -10
  580. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +826 -803
  581. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +160 -160
  582. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +52 -37
  583. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +10 -10
  584. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +188 -0
  585. data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +85 -0
  586. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +54 -0
  587. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +35 -0
  588. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +57 -0
  589. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +35 -0
  590. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +15 -12
  591. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +7 -7
  592. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +72 -0
  593. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +35 -0
  594. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +99 -0
  595. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +35 -0
  596. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +52 -0
  597. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +35 -0
  598. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +71 -0
  599. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +40 -0
  600. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +57 -0
  601. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +30 -0
  602. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +75 -0
  603. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +40 -0
  604. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +77 -0
  605. data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +35 -0
  606. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +15 -11
  607. data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +4 -4
  608. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +17 -14
  609. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +16 -16
  610. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +18 -15
  611. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +10 -10
  612. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +59 -0
  613. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +40 -0
  614. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +17 -13
  615. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +4 -4
  616. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +197 -172
  617. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +63 -58
  618. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +15 -11
  619. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +1 -1
  620. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +169 -140
  621. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +24 -19
  622. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +19 -16
  623. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +10 -10
  624. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +217 -199
  625. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +24 -19
  626. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +58 -0
  627. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +40 -0
  628. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +14 -11
  629. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +4 -4
  630. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +17 -14
  631. data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +22 -22
  632. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +16 -13
  633. data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +7 -7
  634. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +20 -17
  635. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +16 -16
  636. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +46 -0
  637. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +35 -0
  638. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +13 -10
  639. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +13 -13
  640. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +52 -0
  641. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +50 -0
  642. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +15 -12
  643. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +7 -7
  644. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +15 -12
  645. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +4 -4
  646. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +15 -12
  647. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +4 -4
  648. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +15 -12
  649. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +4 -4
  650. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +15 -12
  651. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +10 -10
  652. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +15 -12
  653. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +7 -7
  654. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +14 -12
  655. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +7 -7
  656. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +16 -13
  657. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +10 -10
  658. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +13 -10
  659. data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +22 -22
  660. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +14 -11
  661. data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +16 -16
  662. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +53 -0
  663. data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +45 -0
  664. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +10 -8
  665. data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +1 -1
  666. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +94 -0
  667. data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +35 -0
  668. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +12 -10
  669. data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +7 -7
  670. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +11 -8
  671. data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +10 -10
  672. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +38 -0
  673. data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +30 -0
  674. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +11 -9
  675. data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +4 -4
  676. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +57 -0
  677. data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +35 -0
  678. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +5 -5
  679. data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +1 -1
  680. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +154 -0
  681. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +95 -0
  682. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +153 -0
  683. data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +100 -0
  684. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +3 -3
  685. data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +10 -10
  686. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +39 -0
  687. data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +35 -0
  688. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +3 -3
  689. data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +4 -4
  690. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +3 -3
  691. data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +82 -82
  692. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +3 -3
  693. data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +4 -4
  694. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +3 -3
  695. data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +4 -4
  696. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +3 -3
  697. data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +13 -13
  698. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +3 -3
  699. data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +4 -4
  700. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +3 -3
  701. data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +28 -28
  702. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +4 -4
  703. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +4 -4
  704. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +67 -0
  705. data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +50 -0
  706. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
  707. data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
  708. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +4 -4
  709. data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +10 -10
  710. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +5 -5
  711. data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +4 -4
  712. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +4 -4
  713. data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +1 -1
  714. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +4 -4
  715. data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +4 -4
  716. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +4 -4
  717. data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +4 -4
  718. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +6 -6
  719. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +70 -70
  720. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +63 -0
  721. data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +45 -0
  722. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +47 -0
  723. data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +35 -0
  724. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +35 -0
  725. data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +30 -0
  726. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +4 -4
  727. data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +13 -13
  728. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +40 -0
  729. data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +35 -0
  730. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +5 -5
  731. data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +4 -4
  732. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +7 -7
  733. data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +7 -7
  734. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +4 -4
  735. data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +7 -7
  736. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +41 -0
  737. data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +35 -0
  738. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +6 -6
  739. data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +4 -4
  740. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +6 -6
  741. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +7 -7
  742. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +6 -6
  743. data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +4 -4
  744. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +126 -0
  745. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +80 -0
  746. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +40 -0
  747. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +40 -0
  748. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +52 -0
  749. data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +40 -0
  750. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +5 -5
  751. data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +4 -4
  752. data/src/core/ext/xds/certificate_provider_factory.h +6 -1
  753. data/src/core/ext/xds/certificate_provider_registry.cc +8 -8
  754. data/src/core/ext/xds/certificate_provider_registry.h +3 -1
  755. data/src/core/ext/xds/certificate_provider_store.cc +12 -0
  756. data/src/core/ext/xds/certificate_provider_store.h +18 -0
  757. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +13 -4
  758. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +10 -2
  759. data/src/core/ext/xds/upb_utils.h +66 -0
  760. data/src/core/ext/xds/xds_api.cc +376 -3718
  761. data/src/core/ext/xds/xds_api.h +71 -619
  762. data/src/core/ext/xds/xds_bootstrap.cc +250 -141
  763. data/src/core/ext/xds/xds_bootstrap.h +39 -23
  764. data/src/core/ext/xds/xds_certificate_provider.cc +17 -3
  765. data/src/core/ext/xds/xds_certificate_provider.h +25 -1
  766. data/src/core/ext/xds/xds_channel_stack_modifier.cc +24 -18
  767. data/src/core/ext/xds/xds_channel_stack_modifier.h +9 -4
  768. data/src/core/ext/xds/xds_client.cc +850 -1160
  769. data/src/core/ext/xds/xds_client.h +129 -156
  770. data/src/core/ext/xds/xds_client_stats.cc +18 -19
  771. data/src/core/ext/xds/xds_client_stats.h +9 -7
  772. data/src/core/ext/xds/xds_cluster.cc +554 -0
  773. data/src/core/ext/xds/xds_cluster.h +119 -0
  774. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +151 -0
  775. data/src/core/ext/xds/xds_cluster_specifier_plugin.h +72 -0
  776. data/src/core/ext/xds/xds_common_types.cc +402 -0
  777. data/src/core/ext/xds/xds_common_types.h +103 -0
  778. data/src/core/ext/xds/xds_endpoint.cc +381 -0
  779. data/src/core/ext/xds/xds_endpoint.h +143 -0
  780. data/src/core/ext/xds/xds_http_fault_filter.cc +17 -15
  781. data/src/core/ext/xds/xds_http_fault_filter.h +6 -4
  782. data/src/core/ext/xds/xds_http_filters.cc +18 -5
  783. data/src/core/ext/xds/xds_http_filters.h +7 -7
  784. data/src/core/ext/xds/xds_http_rbac_filter.cc +579 -0
  785. data/src/core/ext/xds/xds_http_rbac_filter.h +61 -0
  786. data/src/core/ext/xds/xds_lb_policy_registry.cc +291 -0
  787. data/src/core/ext/xds/xds_lb_policy_registry.h +72 -0
  788. data/src/core/ext/xds/xds_listener.cc +1067 -0
  789. data/src/core/ext/xds/xds_listener.h +229 -0
  790. data/src/core/ext/{transport/chttp2/transport/hpack_utils.h → xds/xds_resource_type.cc} +12 -9
  791. data/src/core/ext/xds/xds_resource_type.h +98 -0
  792. data/src/core/ext/xds/xds_resource_type_impl.h +91 -0
  793. data/src/core/ext/xds/xds_route_config.cc +1150 -0
  794. data/src/core/ext/xds/xds_route_config.h +227 -0
  795. data/src/core/ext/xds/xds_routing.cc +28 -9
  796. data/src/core/ext/xds/xds_routing.h +15 -7
  797. data/src/core/ext/xds/xds_server_config_fetcher.cc +234 -129
  798. data/src/core/lib/address_utils/parse_address.cc +25 -8
  799. data/src/core/lib/address_utils/parse_address.h +8 -2
  800. data/src/core/lib/address_utils/sockaddr_utils.cc +82 -51
  801. data/src/core/lib/address_utils/sockaddr_utils.h +9 -19
  802. data/src/core/lib/avl/avl.h +71 -6
  803. data/src/core/lib/backoff/backoff.cc +9 -38
  804. data/src/core/lib/backoff/backoff.h +12 -12
  805. data/src/core/lib/channel/call_finalization.h +90 -0
  806. data/src/core/lib/channel/call_tracer.h +15 -6
  807. data/src/core/lib/channel/channel_args.cc +202 -45
  808. data/src/core/lib/channel/channel_args.h +243 -9
  809. data/src/core/lib/channel/channel_args_preconditioning.cc +6 -10
  810. data/src/core/lib/channel/channel_args_preconditioning.h +4 -4
  811. data/src/core/lib/channel/channel_fwd.h +26 -0
  812. data/src/core/lib/channel/channel_stack.cc +55 -10
  813. data/src/core/lib/channel/channel_stack.h +83 -14
  814. data/src/core/lib/channel/channel_stack_builder.cc +19 -276
  815. data/src/core/lib/channel/channel_stack_builder.h +104 -150
  816. data/src/core/lib/channel/channel_stack_builder_impl.cc +97 -0
  817. data/src/core/lib/channel/channel_stack_builder_impl.h +46 -0
  818. data/src/core/lib/channel/channel_trace.cc +11 -19
  819. data/src/core/lib/channel/channel_trace.h +6 -3
  820. data/src/core/lib/channel/channelz.cc +11 -14
  821. data/src/core/lib/channel/channelz.h +15 -7
  822. data/src/core/lib/channel/channelz_registry.cc +11 -19
  823. data/src/core/lib/channel/channelz_registry.h +10 -9
  824. data/src/core/lib/channel/connected_channel.cc +26 -30
  825. data/src/core/lib/channel/connected_channel.h +4 -1
  826. data/src/core/lib/channel/context.h +11 -0
  827. data/src/core/lib/channel/promise_based_filter.cc +1263 -0
  828. data/src/core/lib/channel/promise_based_filter.h +572 -0
  829. data/src/core/lib/channel/status_util.cc +2 -0
  830. data/src/core/lib/channel/status_util.h +0 -3
  831. data/src/core/lib/compression/compression.cc +26 -113
  832. data/src/core/lib/compression/compression_internal.cc +170 -204
  833. data/src/core/lib/compression/compression_internal.h +68 -72
  834. data/src/core/lib/compression/message_compress.cc +14 -12
  835. data/src/core/lib/compression/message_compress.h +4 -5
  836. data/src/core/lib/config/core_configuration.cc +11 -2
  837. data/src/core/lib/config/core_configuration.h +41 -1
  838. data/src/core/lib/debug/stats.cc +9 -9
  839. data/src/core/lib/debug/stats.h +2 -1
  840. data/src/core/lib/debug/stats_data.cc +4 -7
  841. data/src/core/lib/debug/stats_data.h +18 -25
  842. data/src/core/lib/debug/trace.h +13 -12
  843. data/src/core/lib/event_engine/channel_args_endpoint_config.cc +4 -2
  844. data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -2
  845. data/src/core/lib/{iomgr/event_engine/resolved_address_internal.h → event_engine/default_event_engine_factory.cc} +10 -12
  846. data/src/core/lib/event_engine/event_engine.cc +40 -10
  847. data/src/core/lib/event_engine/event_engine_factory.h +8 -0
  848. data/src/core/lib/event_engine/handle_containers.h +67 -0
  849. data/src/core/lib/event_engine/iomgr_engine/iomgr_engine.cc +159 -0
  850. data/src/core/lib/event_engine/iomgr_engine/iomgr_engine.h +122 -0
  851. data/src/core/lib/event_engine/iomgr_engine/thread_pool.cc +123 -0
  852. data/src/core/lib/event_engine/iomgr_engine/thread_pool.h +70 -0
  853. data/src/core/lib/event_engine/iomgr_engine/time_averaged_stats.cc +62 -0
  854. data/src/core/lib/event_engine/iomgr_engine/time_averaged_stats.h +81 -0
  855. data/src/core/lib/event_engine/iomgr_engine/timer.cc +312 -0
  856. data/src/core/lib/event_engine/iomgr_engine/timer.h +193 -0
  857. data/src/core/lib/event_engine/iomgr_engine/timer_heap.cc +107 -0
  858. data/src/core/lib/event_engine/iomgr_engine/timer_heap.h +56 -0
  859. data/src/core/lib/event_engine/iomgr_engine/timer_manager.cc +254 -0
  860. data/src/core/lib/event_engine/iomgr_engine/timer_manager.h +111 -0
  861. data/src/core/lib/event_engine/memory_allocator.cc +20 -16
  862. data/src/core/lib/{iomgr/event_engine → event_engine}/promise.h +27 -9
  863. data/src/core/lib/{iomgr/event_engine/resolved_address_internal.cc → event_engine/resolved_address.cc} +13 -13
  864. data/src/core/lib/event_engine/slice.cc +102 -0
  865. data/src/core/lib/event_engine/slice_buffer.cc +50 -0
  866. data/src/core/{ext/filters/max_age/max_age_filter.h → lib/event_engine/trace.cc} +3 -11
  867. data/src/core/lib/{iomgr/endpoint_pair_event_engine.cc → event_engine/trace.h} +12 -14
  868. data/src/core/lib/gpr/log.cc +5 -0
  869. data/src/core/lib/gpr/sync_posix.cc +1 -0
  870. data/src/core/lib/gpr/time.cc +2 -1
  871. data/src/core/lib/gpr/time_posix.cc +6 -9
  872. data/src/core/lib/gpr/time_windows.cc +10 -7
  873. data/src/core/lib/gpr/tls.h +4 -5
  874. data/src/core/lib/gpr/useful.h +18 -0
  875. data/src/core/lib/gprpp/bitset.h +24 -1
  876. data/src/core/lib/gprpp/chunked_vector.h +49 -3
  877. data/src/core/lib/gprpp/construct_destruct.h +1 -0
  878. data/src/core/lib/gprpp/cpp_impl_of.h +4 -0
  879. data/src/core/lib/gprpp/debug_location.h +2 -0
  880. data/src/core/lib/gprpp/dual_ref_counted.h +1 -4
  881. data/src/core/lib/gprpp/examine_stack.h +0 -1
  882. data/src/core/lib/gprpp/fork.cc +3 -6
  883. data/src/core/lib/gprpp/global_config.h +2 -4
  884. data/src/core/lib/gprpp/global_config_env.cc +3 -2
  885. data/src/core/lib/gprpp/global_config_env.h +3 -1
  886. data/src/core/lib/gprpp/global_config_generic.h +0 -4
  887. data/src/core/lib/gprpp/host_port.cc +2 -0
  888. data/src/core/lib/gprpp/manual_constructor.h +0 -68
  889. data/src/core/lib/gprpp/match.h +75 -0
  890. data/src/core/lib/gprpp/memory.h +1 -5
  891. data/src/core/lib/gprpp/orphanable.h +1 -4
  892. data/src/core/lib/gprpp/overload.h +59 -0
  893. data/src/core/lib/gprpp/ref_counted.h +3 -3
  894. data/src/core/lib/gprpp/ref_counted_ptr.h +1 -1
  895. data/src/core/lib/gprpp/single_set_ptr.h +87 -0
  896. data/src/core/lib/gprpp/stat.h +0 -2
  897. data/src/core/lib/gprpp/stat_posix.cc +7 -2
  898. data/src/core/lib/gprpp/status_helper.cc +74 -48
  899. data/src/core/lib/gprpp/status_helper.h +10 -19
  900. data/src/core/lib/gprpp/sync.h +3 -1
  901. data/src/core/lib/gprpp/table.h +21 -0
  902. data/src/core/lib/gprpp/thd.h +2 -5
  903. data/src/core/lib/gprpp/thd_posix.cc +4 -2
  904. data/src/core/lib/gprpp/thd_windows.cc +2 -0
  905. data/src/core/lib/gprpp/time.cc +214 -0
  906. data/src/core/lib/gprpp/time.h +301 -0
  907. data/src/core/lib/gprpp/time_util.cc +4 -0
  908. data/src/core/lib/gprpp/time_util.h +1 -1
  909. data/src/core/lib/gprpp/unique_type_name.h +104 -0
  910. data/src/core/lib/http/format_request.cc +62 -29
  911. data/src/core/lib/http/format_request.h +10 -7
  912. data/src/core/lib/http/httpcli.cc +325 -244
  913. data/src/core/lib/http/httpcli.h +232 -91
  914. data/src/core/lib/http/httpcli_security_connector.cc +79 -79
  915. data/src/core/lib/http/httpcli_ssl_credentials.h +39 -0
  916. data/src/core/lib/http/parser.cc +85 -15
  917. data/src/core/lib/http/parser.h +18 -2
  918. data/src/core/lib/iomgr/buffer_list.h +5 -5
  919. data/src/core/lib/iomgr/call_combiner.cc +17 -6
  920. data/src/core/lib/iomgr/closure.h +29 -9
  921. data/src/core/lib/iomgr/combiner.cc +25 -3
  922. data/src/core/lib/iomgr/endpoint.cc +4 -4
  923. data/src/core/lib/iomgr/endpoint.h +7 -5
  924. data/src/core/lib/iomgr/endpoint_cfstream.cc +9 -6
  925. data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -1
  926. data/src/core/lib/iomgr/error.cc +24 -19
  927. data/src/core/lib/iomgr/error.h +9 -7
  928. data/src/core/lib/iomgr/ev_apple.cc +6 -5
  929. data/src/core/lib/iomgr/ev_epoll1_linux.cc +65 -25
  930. data/src/core/lib/iomgr/ev_epoll1_linux.h +1 -1
  931. data/src/core/lib/iomgr/ev_poll_posix.cc +84 -59
  932. data/src/core/lib/iomgr/ev_poll_posix.h +2 -2
  933. data/src/core/lib/iomgr/ev_posix.cc +58 -100
  934. data/src/core/lib/iomgr/ev_posix.h +6 -4
  935. data/src/core/lib/iomgr/exec_ctx.cc +25 -97
  936. data/src/core/lib/iomgr/exec_ctx.h +8 -25
  937. data/src/core/lib/iomgr/executor.cc +10 -1
  938. data/src/core/lib/iomgr/fork_posix.cc +1 -0
  939. data/src/core/lib/iomgr/internal_errqueue.cc +38 -47
  940. data/src/core/lib/iomgr/internal_errqueue.h +1 -6
  941. data/src/core/lib/iomgr/iocp_windows.cc +9 -9
  942. data/src/core/lib/iomgr/iocp_windows.h +1 -1
  943. data/src/core/lib/iomgr/iomgr.cc +7 -1
  944. data/src/core/lib/iomgr/{event_engine/pollset.h → iomgr_fwd.h} +9 -9
  945. data/src/core/lib/iomgr/iomgr_posix.cc +3 -2
  946. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +3 -2
  947. data/src/core/lib/iomgr/iomgr_windows.cc +2 -2
  948. data/src/core/lib/iomgr/load_file.cc +1 -1
  949. data/src/core/lib/iomgr/polling_entity.h +6 -0
  950. data/src/core/lib/iomgr/pollset.cc +1 -1
  951. data/src/core/lib/iomgr/pollset.h +4 -4
  952. data/src/core/lib/iomgr/pollset_set.h +1 -2
  953. data/src/core/lib/iomgr/pollset_windows.cc +2 -2
  954. data/src/core/lib/iomgr/port.h +26 -12
  955. data/src/core/lib/iomgr/resolve_address.cc +12 -23
  956. data/src/core/lib/iomgr/resolve_address.h +56 -46
  957. data/src/core/lib/iomgr/resolve_address_impl.h +58 -0
  958. data/src/core/lib/iomgr/resolve_address_posix.cc +76 -66
  959. data/src/core/lib/iomgr/resolve_address_posix.h +50 -0
  960. data/src/core/lib/iomgr/resolve_address_windows.cc +87 -75
  961. data/src/core/lib/iomgr/resolve_address_windows.h +50 -0
  962. data/src/core/{ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc → lib/iomgr/resolved_address.h} +21 -10
  963. data/src/core/lib/iomgr/sockaddr.h +2 -3
  964. data/src/core/lib/iomgr/sockaddr_posix.h +2 -0
  965. data/src/core/lib/iomgr/sockaddr_utils_posix.cc +62 -0
  966. data/src/core/lib/iomgr/sockaddr_windows.h +2 -0
  967. data/src/core/lib/iomgr/socket_utils_common_posix.cc +3 -19
  968. data/src/core/lib/iomgr/tcp_client.cc +12 -7
  969. data/src/core/lib/iomgr/tcp_client.h +24 -12
  970. data/src/core/lib/iomgr/tcp_client_cfstream.cc +24 -10
  971. data/src/core/lib/iomgr/tcp_client_posix.cc +157 -32
  972. data/src/core/lib/iomgr/tcp_client_posix.h +2 -2
  973. data/src/core/lib/iomgr/tcp_client_windows.cc +27 -16
  974. data/src/core/lib/iomgr/tcp_posix.cc +167 -64
  975. data/src/core/lib/iomgr/tcp_server_posix.cc +57 -34
  976. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +42 -38
  977. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +10 -6
  978. data/src/core/lib/iomgr/tcp_server_windows.cc +20 -12
  979. data/src/core/lib/iomgr/tcp_windows.cc +29 -19
  980. data/src/core/lib/iomgr/timer.cc +2 -2
  981. data/src/core/lib/iomgr/timer.h +11 -6
  982. data/src/core/lib/iomgr/timer_generic.cc +96 -77
  983. data/src/core/lib/iomgr/timer_manager.cc +15 -14
  984. data/src/core/lib/iomgr/unix_sockets_posix.cc +22 -34
  985. data/src/core/lib/iomgr/unix_sockets_posix.h +4 -7
  986. data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +6 -15
  987. data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -2
  988. data/src/core/lib/iomgr/wakeup_fd_posix.cc +15 -12
  989. data/src/core/lib/iomgr/wakeup_fd_posix.h +0 -2
  990. data/src/core/lib/iomgr/work_serializer.cc +15 -10
  991. data/src/core/lib/iomgr/work_serializer.h +2 -3
  992. data/src/core/lib/json/json.h +1 -2
  993. data/src/core/lib/json/json_reader.cc +9 -1
  994. data/src/core/lib/json/json_util.cc +11 -4
  995. data/src/core/lib/json/json_util.h +15 -6
  996. data/src/core/lib/json/json_writer.cc +6 -1
  997. data/src/core/lib/matchers/matchers.cc +7 -4
  998. data/src/core/lib/matchers/matchers.h +2 -0
  999. data/src/core/lib/promise/activity.cc +15 -10
  1000. data/src/core/lib/promise/activity.h +192 -157
  1001. data/src/core/lib/promise/arena_promise.h +198 -0
  1002. data/src/core/lib/promise/call_push_pull.h +148 -0
  1003. data/src/core/lib/promise/context.h +1 -1
  1004. data/src/core/lib/promise/detail/basic_seq.h +94 -5
  1005. data/src/core/lib/promise/detail/promise_factory.h +1 -2
  1006. data/src/core/lib/promise/detail/status.h +6 -0
  1007. data/src/core/lib/promise/intra_activity_waiter.h +49 -0
  1008. data/src/core/lib/promise/latch.h +103 -0
  1009. data/src/core/lib/promise/loop.h +36 -8
  1010. data/src/core/lib/promise/poll.h +6 -0
  1011. data/src/core/lib/promise/promise.h +96 -0
  1012. data/src/core/lib/promise/race.h +0 -1
  1013. data/src/core/lib/promise/seq.h +19 -3
  1014. data/src/core/lib/promise/sleep.cc +81 -0
  1015. data/src/core/lib/promise/sleep.h +76 -0
  1016. data/src/core/lib/promise/try_seq.h +157 -0
  1017. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.cc +22 -25
  1018. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.h +46 -44
  1019. data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_factory.h +36 -33
  1020. data/src/core/lib/resolver/resolver_registry.cc +149 -0
  1021. data/src/core/lib/resolver/resolver_registry.h +124 -0
  1022. data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.cc +18 -4
  1023. data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.h +17 -10
  1024. data/src/core/lib/resource_quota/api.cc +19 -31
  1025. data/src/core/lib/resource_quota/api.h +5 -3
  1026. data/src/core/lib/{gprpp → resource_quota}/arena.cc +16 -19
  1027. data/src/core/lib/{gprpp → resource_quota}/arena.h +25 -15
  1028. data/src/core/lib/resource_quota/memory_quota.cc +170 -146
  1029. data/src/core/lib/resource_quota/memory_quota.h +131 -90
  1030. data/src/core/lib/resource_quota/resource_quota.h +16 -0
  1031. data/src/core/lib/resource_quota/thread_quota.cc +2 -0
  1032. data/src/core/lib/resource_quota/thread_quota.h +4 -0
  1033. data/src/core/lib/security/authorization/authorization_policy_provider.h +14 -0
  1034. data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +4 -0
  1035. data/src/core/lib/security/authorization/evaluate_args.cc +34 -23
  1036. data/src/core/lib/security/authorization/evaluate_args.h +7 -4
  1037. data/src/core/lib/security/authorization/grpc_authorization_engine.cc +66 -0
  1038. data/src/core/lib/security/authorization/grpc_authorization_engine.h +69 -0
  1039. data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +121 -0
  1040. data/src/core/lib/security/authorization/grpc_server_authz_filter.h +61 -0
  1041. data/src/core/lib/security/authorization/matchers.cc +235 -0
  1042. data/src/core/lib/security/authorization/matchers.h +218 -0
  1043. data/src/core/lib/security/authorization/rbac_policy.cc +447 -0
  1044. data/src/core/lib/security/authorization/rbac_policy.h +178 -0
  1045. data/src/core/lib/security/context/security_context.cc +9 -4
  1046. data/src/core/lib/security/context/security_context.h +23 -4
  1047. data/src/core/lib/security/credentials/alts/alts_credentials.cc +16 -7
  1048. data/src/core/lib/security/credentials/alts/alts_credentials.h +16 -1
  1049. data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +1 -3
  1050. data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +1 -4
  1051. data/src/core/lib/security/credentials/call_creds_util.cc +97 -0
  1052. data/src/core/lib/security/credentials/call_creds_util.h +43 -0
  1053. data/src/core/lib/security/credentials/channel_creds_registry.h +103 -0
  1054. data/src/core/lib/security/credentials/channel_creds_registry_init.cc +80 -0
  1055. data/src/core/lib/security/credentials/composite/composite_credentials.cc +31 -86
  1056. data/src/core/lib/security/credentials/composite/composite_credentials.h +41 -13
  1057. data/src/core/lib/security/credentials/credentials.cc +6 -11
  1058. data/src/core/lib/security/credentials/credentials.h +90 -87
  1059. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +154 -39
  1060. data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +19 -0
  1061. data/src/core/lib/security/credentials/external/aws_request_signer.cc +9 -0
  1062. data/src/core/lib/security/credentials/external/external_account_credentials.cc +78 -42
  1063. data/src/core/lib/security/credentials/external/external_account_credentials.h +16 -9
  1064. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +12 -5
  1065. data/src/core/lib/security/credentials/external/file_external_account_credentials.h +6 -0
  1066. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +55 -17
  1067. data/src/core/lib/security/credentials/external/url_external_account_credentials.h +11 -0
  1068. data/src/core/lib/security/credentials/fake/fake_credentials.cc +40 -32
  1069. data/src/core/lib/security/credentials/fake/fake_credentials.h +35 -22
  1070. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +1 -0
  1071. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +69 -35
  1072. data/src/core/lib/security/credentials/google_default/google_default_credentials.h +20 -5
  1073. data/src/core/lib/security/credentials/iam/iam_credentials.cc +32 -30
  1074. data/src/core/lib/security/credentials/iam/iam_credentials.h +25 -9
  1075. data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +35 -26
  1076. data/src/core/lib/security/credentials/insecure/insecure_credentials.h +62 -0
  1077. data/src/core/lib/security/credentials/jwt/json_token.cc +9 -8
  1078. data/src/core/lib/security/credentials/jwt/json_token.h +2 -2
  1079. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +44 -49
  1080. data/src/core/lib/security/credentials/jwt/jwt_credentials.h +30 -12
  1081. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +81 -43
  1082. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +5 -3
  1083. data/src/core/lib/security/credentials/local/local_credentials.cc +16 -9
  1084. data/src/core/lib/security/credentials/local/local_credentials.h +17 -0
  1085. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +175 -171
  1086. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +81 -34
  1087. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +104 -156
  1088. data/src/core/lib/security/credentials/plugin/plugin_credentials.h +80 -27
  1089. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +18 -14
  1090. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +27 -3
  1091. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +6 -6
  1092. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +9 -3
  1093. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +39 -10
  1094. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +56 -4
  1095. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +43 -3
  1096. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +72 -10
  1097. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +29 -5
  1098. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +67 -80
  1099. data/src/core/lib/security/credentials/tls/tls_credentials.cc +26 -8
  1100. data/src/core/lib/security/credentials/tls/tls_credentials.h +11 -1
  1101. data/src/core/lib/security/credentials/tls/tls_utils.cc +2 -0
  1102. data/src/core/lib/security/credentials/tls/tls_utils.h +1 -1
  1103. data/src/core/lib/security/credentials/xds/xds_credentials.cc +65 -51
  1104. data/src/core/lib/security/credentials/xds/xds_credentials.h +51 -6
  1105. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +30 -16
  1106. data/src/core/lib/security/security_connector/alts/alts_security_connector.h +7 -4
  1107. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +22 -14
  1108. data/src/core/lib/security/security_connector/fake/fake_security_connector.h +2 -4
  1109. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +15 -16
  1110. data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +21 -11
  1111. data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +5 -3
  1112. data/src/core/lib/security/security_connector/{load_system_roots_linux.cc → load_system_roots_supported.cc} +27 -19
  1113. data/src/core/lib/security/security_connector/{load_system_roots_linux.h → load_system_roots_supported.h} +5 -5
  1114. data/src/core/lib/security/security_connector/local/local_security_connector.cc +32 -21
  1115. data/src/core/lib/security/security_connector/local/local_security_connector.h +6 -2
  1116. data/src/core/lib/security/security_connector/security_connector.cc +22 -32
  1117. data/src/core/lib/security/security_connector/security_connector.h +44 -28
  1118. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +29 -20
  1119. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +4 -2
  1120. data/src/core/lib/security/security_connector/ssl_utils.cc +41 -33
  1121. data/src/core/lib/security/security_connector/ssl_utils.h +23 -24
  1122. data/src/core/lib/security/security_connector/ssl_utils_config.h +1 -1
  1123. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +46 -28
  1124. data/src/core/lib/security/security_connector/tls/tls_security_connector.h +29 -9
  1125. data/src/core/lib/security/transport/auth_filters.h +45 -5
  1126. data/src/core/lib/security/transport/client_auth_filter.cc +112 -368
  1127. data/src/core/lib/security/transport/secure_endpoint.cc +267 -137
  1128. data/src/core/lib/security/transport/secure_endpoint.h +5 -4
  1129. data/src/core/lib/security/transport/security_handshaker.cc +69 -26
  1130. data/src/core/lib/security/transport/security_handshaker.h +5 -1
  1131. data/src/core/lib/security/transport/server_auth_filter.cc +70 -41
  1132. data/src/core/lib/security/util/json_util.cc +3 -2
  1133. data/src/core/lib/security/util/json_util.h +0 -2
  1134. data/src/core/lib/service_config/service_config.h +78 -0
  1135. data/src/core/{ext → lib}/service_config/service_config_call_data.h +11 -7
  1136. data/src/core/{ext/service_config/service_config.cc → lib/service_config/service_config_impl.cc} +33 -23
  1137. data/src/core/{ext/service_config/service_config.h → lib/service_config/service_config_impl.h} +24 -21
  1138. data/src/core/{ext → lib}/service_config/service_config_parser.cc +39 -29
  1139. data/src/core/{ext → lib}/service_config/service_config_parser.h +45 -29
  1140. data/src/core/lib/slice/b64.cc +1 -1
  1141. data/src/core/lib/slice/b64.h +2 -0
  1142. data/src/core/lib/slice/percent_encoding.cc +4 -1
  1143. data/src/core/lib/slice/percent_encoding.h +0 -6
  1144. data/src/core/lib/slice/slice.cc +78 -180
  1145. data/src/core/lib/slice/slice.h +77 -29
  1146. data/src/core/lib/slice/slice_api.cc +1 -1
  1147. data/src/core/lib/slice/slice_buffer.cc +79 -23
  1148. data/src/core/lib/slice/slice_buffer.h +137 -0
  1149. data/src/core/lib/{iomgr/is_epollexclusive_available.h → slice/slice_buffer_api.cc} +11 -12
  1150. data/src/core/lib/slice/slice_internal.h +16 -34
  1151. data/src/core/lib/slice/slice_refcount.cc +18 -0
  1152. data/src/core/lib/slice/slice_refcount.h +6 -86
  1153. data/src/core/lib/slice/slice_refcount_base.h +18 -139
  1154. data/src/core/lib/slice/slice_string_helpers.cc +0 -16
  1155. data/src/core/lib/slice/slice_string_helpers.h +1 -8
  1156. data/src/core/lib/surface/builtins.cc +11 -6
  1157. data/src/core/lib/surface/byte_buffer.cc +7 -1
  1158. data/src/core/lib/surface/byte_buffer_reader.cc +4 -4
  1159. data/src/core/lib/surface/call.cc +1113 -1275
  1160. data/src/core/lib/surface/call.h +26 -22
  1161. data/src/core/lib/surface/call_details.cc +4 -4
  1162. data/src/core/lib/surface/call_log_batch.cc +7 -1
  1163. data/src/core/lib/surface/call_test_only.h +4 -1
  1164. data/src/core/lib/surface/channel.cc +220 -289
  1165. data/src/core/lib/surface/channel.h +100 -62
  1166. data/src/core/lib/surface/channel_init.cc +2 -3
  1167. data/src/core/lib/surface/channel_init.h +4 -6
  1168. data/src/core/lib/surface/channel_ping.cc +8 -2
  1169. data/src/core/lib/surface/channel_stack_type.cc +0 -2
  1170. data/src/core/lib/surface/channel_stack_type.h +0 -2
  1171. data/src/core/lib/surface/completion_queue.cc +39 -29
  1172. data/src/core/lib/surface/completion_queue.h +7 -2
  1173. data/src/core/lib/surface/completion_queue_factory.cc +1 -0
  1174. data/src/core/lib/surface/completion_queue_factory.h +1 -3
  1175. data/src/core/lib/surface/event_string.cc +1 -7
  1176. data/src/core/lib/surface/event_string.h +1 -1
  1177. data/src/core/lib/surface/init.cc +66 -26
  1178. data/src/core/lib/surface/init.h +0 -10
  1179. data/src/core/lib/surface/lame_client.cc +63 -109
  1180. data/src/core/lib/surface/lame_client.h +41 -3
  1181. data/src/core/lib/surface/metadata_array.cc +2 -0
  1182. data/src/core/lib/surface/server.cc +106 -126
  1183. data/src/core/lib/surface/server.h +48 -16
  1184. data/src/core/lib/surface/validate_metadata.cc +3 -6
  1185. data/src/core/lib/surface/validate_metadata.h +3 -0
  1186. data/src/core/lib/surface/version.cc +2 -2
  1187. data/src/core/lib/transport/bdp_estimator.cc +12 -11
  1188. data/src/core/lib/transport/bdp_estimator.h +4 -5
  1189. data/src/core/lib/transport/connectivity_state.cc +6 -4
  1190. data/src/core/lib/transport/connectivity_state.h +2 -3
  1191. data/src/core/lib/transport/error_utils.cc +21 -11
  1192. data/src/core/lib/transport/error_utils.h +7 -2
  1193. data/src/core/lib/{channel → transport}/handshaker.cc +13 -8
  1194. data/src/core/lib/{channel → transport}/handshaker.h +14 -7
  1195. data/src/core/lib/{channel → transport}/handshaker_factory.h +9 -10
  1196. data/src/core/lib/{channel → transport}/handshaker_registry.cc +5 -1
  1197. data/src/core/lib/{channel → transport}/handshaker_registry.h +5 -4
  1198. data/src/core/{ext/filters/client_channel → lib/transport}/http_connect_handshaker.cc +37 -26
  1199. data/src/core/{ext/filters/client_channel → lib/transport}/http_connect_handshaker.h +3 -3
  1200. data/src/core/lib/transport/metadata_batch.cc +260 -72
  1201. data/src/core/lib/transport/metadata_batch.h +932 -799
  1202. data/src/core/lib/transport/parsed_metadata.cc +4 -0
  1203. data/src/core/lib/transport/parsed_metadata.h +124 -98
  1204. data/src/core/lib/transport/status_conversion.cc +4 -2
  1205. data/src/core/lib/transport/status_conversion.h +3 -3
  1206. data/src/core/lib/transport/tcp_connect_handshaker.cc +253 -0
  1207. data/src/core/lib/transport/tcp_connect_handshaker.h +39 -0
  1208. data/src/core/lib/transport/timeout_encoding.cc +203 -70
  1209. data/src/core/lib/transport/timeout_encoding.h +44 -10
  1210. data/src/core/lib/transport/transport.cc +21 -21
  1211. data/src/core/lib/transport/transport.h +151 -19
  1212. data/src/core/lib/transport/transport_fwd.h +20 -0
  1213. data/src/core/lib/transport/transport_impl.h +25 -0
  1214. data/src/core/lib/transport/transport_op_string.cc +21 -64
  1215. data/src/core/lib/uri/uri_parser.cc +238 -56
  1216. data/src/core/lib/uri/uri_parser.h +37 -25
  1217. data/src/core/plugin_registry/grpc_plugin_registry.cc +32 -91
  1218. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +85 -0
  1219. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +27 -22
  1220. data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +9 -1
  1221. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +22 -14
  1222. data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +2 -2
  1223. data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -1
  1224. data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -2
  1225. data/src/core/tsi/alts/handshaker/transport_security_common_api.h +2 -2
  1226. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +9 -1
  1227. data/src/core/tsi/fake_transport_security.cc +13 -1
  1228. data/src/core/tsi/fake_transport_security.h +6 -0
  1229. data/src/core/tsi/local_transport_security.cc +3 -11
  1230. data/src/core/tsi/local_transport_security.h +1 -4
  1231. data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +141 -0
  1232. data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +81 -0
  1233. data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
  1234. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +2 -0
  1235. data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -5
  1236. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +2 -0
  1237. data/src/core/tsi/ssl_transport_security.cc +180 -52
  1238. data/src/core/tsi/ssl_transport_security.h +46 -8
  1239. data/src/core/tsi/transport_security_grpc.cc +3 -2
  1240. data/src/core/tsi/transport_security_grpc.h +5 -2
  1241. data/src/core/tsi/transport_security_interface.h +2 -0
  1242. data/src/ruby/ext/grpc/ext-export-truffleruby.clang +2 -0
  1243. data/src/ruby/ext/grpc/ext-export-truffleruby.gcc +7 -0
  1244. data/src/ruby/ext/grpc/ext-export.clang +1 -0
  1245. data/src/ruby/ext/grpc/ext-export.gcc +1 -0
  1246. data/src/ruby/ext/grpc/extconf.rb +59 -21
  1247. data/src/ruby/ext/grpc/rb_channel.c +5 -2
  1248. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +20 -24
  1249. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +31 -37
  1250. data/src/ruby/ext/grpc/rb_server.c +7 -4
  1251. data/src/ruby/lib/grpc/errors.rb +1 -1
  1252. data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
  1253. data/src/ruby/lib/grpc/grpc.rb +1 -1
  1254. data/src/ruby/lib/grpc/version.rb +1 -1
  1255. data/src/ruby/pb/generate_proto_ruby.sh +1 -0
  1256. data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -1
  1257. data/src/ruby/pb/test/client.rb +769 -0
  1258. data/src/ruby/pb/test/server.rb +252 -0
  1259. data/src/ruby/pb/test/xds_client.rb +415 -0
  1260. data/src/ruby/spec/generic/client_stub_spec.rb +23 -23
  1261. data/third_party/abseil-cpp/absl/algorithm/container.h +1 -1
  1262. data/third_party/abseil-cpp/absl/base/attributes.h +49 -22
  1263. data/third_party/abseil-cpp/absl/base/casts.h +61 -68
  1264. data/third_party/abseil-cpp/absl/base/config.h +182 -41
  1265. data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +12 -42
  1266. data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +67 -2
  1267. data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +3 -3
  1268. data/third_party/abseil-cpp/absl/base/internal/endian.h +17 -62
  1269. data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +50 -0
  1270. data/third_party/abseil-cpp/absl/base/internal/invoke.h +54 -0
  1271. data/third_party/abseil-cpp/absl/base/internal/prefetch.h +138 -0
  1272. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +29 -22
  1273. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +13 -12
  1274. data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -0
  1275. data/third_party/abseil-cpp/absl/base/internal/spinlock.h +8 -0
  1276. data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +2 -5
  1277. data/third_party/abseil-cpp/absl/base/internal/strerror.cc +88 -0
  1278. data/third_party/abseil-cpp/absl/base/internal/strerror.h +39 -0
  1279. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +0 -1
  1280. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +2 -1
  1281. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +6 -7
  1282. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +12 -3
  1283. data/third_party/abseil-cpp/absl/base/log_severity.cc +28 -0
  1284. data/third_party/abseil-cpp/absl/base/log_severity.h +51 -0
  1285. data/third_party/abseil-cpp/absl/base/optimization.h +19 -11
  1286. data/third_party/abseil-cpp/absl/base/options.h +1 -1
  1287. data/third_party/abseil-cpp/absl/base/thread_annotations.h +2 -2
  1288. data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -0
  1289. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +11 -4
  1290. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +510 -0
  1291. data/third_party/abseil-cpp/absl/container/inlined_vector.h +20 -9
  1292. data/third_party/abseil-cpp/absl/container/internal/common.h +6 -5
  1293. data/third_party/abseil-cpp/absl/container/internal/container_memory.h +10 -28
  1294. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +68 -20
  1295. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +29 -11
  1296. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +59 -38
  1297. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +4 -0
  1298. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +515 -184
  1299. data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +45 -88
  1300. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +4 -0
  1301. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +3 -2
  1302. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +8 -3
  1303. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +8 -3
  1304. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +2 -1
  1305. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +8 -3
  1306. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +20 -18
  1307. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +8 -3
  1308. data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +15 -2
  1309. data/third_party/abseil-cpp/absl/debugging/symbolize.cc +6 -1
  1310. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +46 -7
  1311. data/third_party/abseil-cpp/absl/functional/bind_front.h +10 -1
  1312. data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -1
  1313. data/third_party/abseil-cpp/absl/hash/hash.h +82 -8
  1314. data/third_party/abseil-cpp/absl/hash/internal/hash.h +218 -23
  1315. data/third_party/abseil-cpp/absl/numeric/bits.h +2 -1
  1316. data/third_party/abseil-cpp/absl/numeric/int128.cc +4 -2
  1317. data/third_party/abseil-cpp/absl/numeric/int128.h +2 -2
  1318. data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +21 -6
  1319. data/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +200 -0
  1320. data/third_party/abseil-cpp/absl/random/beta_distribution.h +427 -0
  1321. data/third_party/abseil-cpp/absl/random/discrete_distribution.cc +98 -0
  1322. data/third_party/abseil-cpp/absl/random/discrete_distribution.h +247 -0
  1323. data/third_party/abseil-cpp/absl/random/distributions.h +452 -0
  1324. data/third_party/abseil-cpp/absl/random/exponential_distribution.h +165 -0
  1325. data/third_party/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
  1326. data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +275 -0
  1327. data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +95 -0
  1328. data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +269 -0
  1329. data/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
  1330. data/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
  1331. data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +245 -0
  1332. data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +161 -0
  1333. data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +308 -0
  1334. data/third_party/abseil-cpp/absl/random/internal/platform.h +171 -0
  1335. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +253 -0
  1336. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +131 -0
  1337. data/third_party/abseil-cpp/absl/random/internal/randen.cc +91 -0
  1338. data/third_party/abseil-cpp/absl/random/internal/randen.h +96 -0
  1339. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +225 -0
  1340. data/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
  1341. data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +264 -0
  1342. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
  1343. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
  1344. data/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
  1345. data/third_party/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
  1346. data/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
  1347. data/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
  1348. data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +165 -0
  1349. data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +267 -0
  1350. data/third_party/abseil-cpp/absl/random/internal/seed_material.h +104 -0
  1351. data/third_party/abseil-cpp/absl/random/internal/traits.h +149 -0
  1352. data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
  1353. data/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +96 -0
  1354. data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +256 -0
  1355. data/third_party/abseil-cpp/absl/random/poisson_distribution.h +261 -0
  1356. data/third_party/abseil-cpp/absl/random/random.h +189 -0
  1357. data/third_party/abseil-cpp/absl/random/seed_gen_exception.cc +46 -0
  1358. data/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
  1359. data/third_party/abseil-cpp/absl/random/seed_sequences.cc +29 -0
  1360. data/third_party/abseil-cpp/absl/random/seed_sequences.h +111 -0
  1361. data/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +275 -0
  1362. data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +202 -0
  1363. data/third_party/abseil-cpp/absl/random/zipf_distribution.h +272 -0
  1364. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +17 -0
  1365. data/third_party/abseil-cpp/absl/status/status.cc +174 -2
  1366. data/third_party/abseil-cpp/absl/status/status.h +22 -12
  1367. data/third_party/abseil-cpp/absl/status/statusor.h +9 -3
  1368. data/third_party/abseil-cpp/absl/strings/ascii.h +4 -4
  1369. data/third_party/abseil-cpp/absl/strings/cord.cc +194 -913
  1370. data/third_party/abseil-cpp/absl/strings/cord.h +202 -81
  1371. data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +188 -0
  1372. data/third_party/abseil-cpp/absl/strings/cord_analysis.h +44 -0
  1373. data/third_party/abseil-cpp/absl/strings/cord_buffer.cc +30 -0
  1374. data/third_party/abseil-cpp/absl/strings/cord_buffer.h +572 -0
  1375. data/third_party/abseil-cpp/absl/strings/internal/cord_data_edge.h +63 -0
  1376. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +20 -32
  1377. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +123 -88
  1378. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +149 -49
  1379. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +44 -59
  1380. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +3 -1
  1381. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +4 -2
  1382. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +3 -2
  1383. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +5 -4
  1384. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +7 -74
  1385. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +54 -0
  1386. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +102 -0
  1387. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +58 -17
  1388. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +13 -11
  1389. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +11 -38
  1390. data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +1 -0
  1391. data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +4 -2
  1392. data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +6 -5
  1393. data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +1 -1
  1394. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +1 -1
  1395. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -1
  1396. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +38 -7
  1397. data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -2
  1398. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +4 -5
  1399. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +5 -2
  1400. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +2 -1
  1401. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
  1402. data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +9 -6
  1403. data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +10 -2
  1404. data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +9 -9
  1405. data/third_party/abseil-cpp/absl/strings/numbers.cc +8 -8
  1406. data/third_party/abseil-cpp/absl/strings/numbers.h +26 -23
  1407. data/third_party/abseil-cpp/absl/strings/str_cat.h +20 -13
  1408. data/third_party/abseil-cpp/absl/strings/str_join.h +9 -15
  1409. data/third_party/abseil-cpp/absl/strings/str_split.h +1 -2
  1410. data/third_party/abseil-cpp/absl/strings/string_view.cc +2 -13
  1411. data/third_party/abseil-cpp/absl/strings/string_view.h +3 -2
  1412. data/third_party/abseil-cpp/absl/strings/strip.h +8 -6
  1413. data/third_party/abseil-cpp/absl/strings/substitute.h +10 -2
  1414. data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +9 -6
  1415. data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +0 -4
  1416. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +0 -4
  1417. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +1 -6
  1418. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -25
  1419. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +10 -4
  1420. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +75 -40
  1421. data/third_party/abseil-cpp/absl/synchronization/mutex.h +17 -9
  1422. data/third_party/abseil-cpp/absl/synchronization/notification.h +3 -2
  1423. data/third_party/abseil-cpp/absl/time/duration.cc +5 -4
  1424. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +11 -7
  1425. data/third_party/abseil-cpp/absl/time/time.h +16 -12
  1426. data/third_party/abseil-cpp/absl/types/internal/optional.h +8 -0
  1427. data/third_party/abseil-cpp/absl/types/internal/variant.h +3 -3
  1428. data/third_party/abseil-cpp/absl/types/optional.h +17 -14
  1429. data/third_party/abseil-cpp/absl/types/span.h +2 -1
  1430. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
  1431. data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
  1432. data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
  1433. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +12 -0
  1434. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +1 -2
  1435. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
  1436. data/third_party/boringssl-with-bazel/src/crypto/mem.c +1 -1
  1437. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +29 -0
  1438. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +0 -1
  1439. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +1 -1
  1440. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
  1441. data/third_party/boringssl-with-bazel/src/include/openssl/base64.h +8 -0
  1442. data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +13 -1
  1443. data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +10 -0
  1444. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
  1445. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +9 -4
  1446. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
  1447. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +23 -2
  1448. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
  1449. data/third_party/cares/cares/{ares.h → include/ares.h} +73 -1
  1450. data/third_party/cares/cares/{ares_dns.h → include/ares_dns.h} +9 -0
  1451. data/third_party/cares/cares/{ares_version.h → include/ares_version.h} +3 -3
  1452. data/third_party/cares/cares/{ares__close_sockets.c → src/lib/ares__close_sockets.c} +2 -2
  1453. data/third_party/cares/cares/{ares__get_hostent.c → src/lib/ares__get_hostent.c} +1 -2
  1454. data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +260 -0
  1455. data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +264 -0
  1456. data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +499 -0
  1457. data/third_party/cares/cares/src/lib/ares_android.c +444 -0
  1458. data/third_party/cares/cares/src/lib/ares_android.h +27 -0
  1459. data/third_party/cares/cares/{ares_create_query.c → src/lib/ares_create_query.c} +8 -17
  1460. data/third_party/cares/cares/{ares_data.c → src/lib/ares_data.c} +18 -0
  1461. data/third_party/cares/cares/{ares_data.h → src/lib/ares_data.h} +2 -0
  1462. data/third_party/cares/cares/{ares_expand_name.c → src/lib/ares_expand_name.c} +114 -23
  1463. data/third_party/cares/cares/{ares_expand_string.c → src/lib/ares_expand_string.c} +2 -5
  1464. data/third_party/cares/cares/{ares_free_hostent.c → src/lib/ares_free_hostent.c} +6 -4
  1465. data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +59 -0
  1466. data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +772 -0
  1467. data/third_party/cares/cares/{ares_getenv.c → src/lib/ares_getenv.c} +0 -2
  1468. data/third_party/cares/cares/{ares_gethostbyaddr.c → src/lib/ares_gethostbyaddr.c} +2 -9
  1469. data/third_party/cares/cares/{ares_gethostbyname.c → src/lib/ares_gethostbyname.c} +25 -20
  1470. data/third_party/cares/cares/{ares_getnameinfo.c → src/lib/ares_getnameinfo.c} +4 -10
  1471. data/third_party/cares/cares/{ares_init.c → src/lib/ares_init.c} +79 -40
  1472. data/third_party/cares/cares/{ares_ipv6.h → src/lib/ares_ipv6.h} +7 -0
  1473. data/third_party/cares/cares/{ares_library_init.c → src/lib/ares_library_init.c} +7 -2
  1474. data/third_party/cares/cares/{ares_library_init.h → src/lib/ares_library_init.h} +1 -1
  1475. data/third_party/cares/cares/src/lib/ares_nameser.h +482 -0
  1476. data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +209 -0
  1477. data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +212 -0
  1478. data/third_party/cares/cares/src/lib/ares_parse_caa_reply.c +199 -0
  1479. data/third_party/cares/cares/{ares_parse_mx_reply.c → src/lib/ares_parse_mx_reply.c} +2 -8
  1480. data/third_party/cares/cares/{ares_parse_naptr_reply.c → src/lib/ares_parse_naptr_reply.c} +2 -13
  1481. data/third_party/cares/cares/{ares_parse_ns_reply.c → src/lib/ares_parse_ns_reply.c} +5 -11
  1482. data/third_party/cares/cares/{ares_parse_ptr_reply.c → src/lib/ares_parse_ptr_reply.c} +53 -46
  1483. data/third_party/cares/cares/src/lib/ares_parse_soa_reply.c +179 -0
  1484. data/third_party/cares/cares/{ares_parse_srv_reply.c → src/lib/ares_parse_srv_reply.c} +2 -13
  1485. data/third_party/cares/cares/{ares_parse_txt_reply.c → src/lib/ares_parse_txt_reply.c} +3 -9
  1486. data/third_party/cares/cares/{ares_private.h → src/lib/ares_private.h} +52 -11
  1487. data/third_party/cares/cares/{ares_process.c → src/lib/ares_process.c} +127 -52
  1488. data/third_party/cares/cares/{ares_query.c → src/lib/ares_query.c} +3 -9
  1489. data/third_party/cares/cares/{ares_search.c → src/lib/ares_search.c} +5 -7
  1490. data/third_party/cares/cares/{ares_send.c → src/lib/ares_send.c} +2 -8
  1491. data/third_party/cares/cares/{ares_setup.h → src/lib/ares_setup.h} +4 -1
  1492. data/third_party/cares/cares/{ares_strsplit.c → src/lib/ares_strsplit.c} +4 -0
  1493. data/third_party/cares/cares/src/lib/ares_writev.h +36 -0
  1494. data/third_party/cares/cares/src/lib/config-dos.h +115 -0
  1495. data/third_party/cares/cares/{inet_net_pton.c → src/lib/inet_net_pton.c} +2 -8
  1496. data/third_party/cares/cares/{inet_ntop.c → src/lib/inet_ntop.c} +2 -8
  1497. data/third_party/upb/third_party/utf8_range/naive.c +92 -0
  1498. data/third_party/upb/third_party/utf8_range/range2-neon.c +157 -0
  1499. data/third_party/upb/third_party/utf8_range/range2-sse.c +170 -0
  1500. data/third_party/upb/third_party/utf8_range/utf8_range.h +9 -0
  1501. data/third_party/upb/upb/decode.c +542 -319
  1502. data/third_party/upb/upb/decode.h +43 -17
  1503. data/third_party/upb/upb/decode_fast.c +303 -301
  1504. data/third_party/upb/upb/decode_fast.h +18 -18
  1505. data/third_party/upb/upb/decode_internal.h +73 -56
  1506. data/third_party/upb/upb/def.c +1926 -1078
  1507. data/third_party/upb/upb/def.h +329 -288
  1508. data/third_party/upb/upb/def.hpp +129 -172
  1509. data/third_party/upb/upb/encode.c +208 -175
  1510. data/third_party/upb/upb/encode.h +15 -17
  1511. data/third_party/upb/upb/json_encode.c +776 -0
  1512. data/third_party/upb/upb/json_encode.h +62 -0
  1513. data/third_party/upb/upb/msg.c +142 -124
  1514. data/third_party/upb/upb/msg.h +39 -33
  1515. data/third_party/upb/upb/msg_internal.h +342 -280
  1516. data/third_party/upb/upb/port_def.inc +8 -0
  1517. data/third_party/upb/upb/port_undef.inc +1 -0
  1518. data/third_party/upb/upb/reflection.c +239 -199
  1519. data/third_party/upb/upb/reflection.h +87 -67
  1520. data/third_party/upb/upb/reflection.hpp +6 -6
  1521. data/third_party/upb/upb/table.c +231 -147
  1522. data/third_party/upb/upb/table_internal.h +129 -95
  1523. data/third_party/upb/upb/text_encode.c +113 -90
  1524. data/third_party/upb/upb/text_encode.h +10 -10
  1525. data/third_party/upb/upb/upb.c +111 -72
  1526. data/third_party/upb/upb/upb.h +157 -151
  1527. data/third_party/upb/upb/upb.hpp +31 -28
  1528. data/third_party/upb/upb/upb_internal.h +21 -11
  1529. data/third_party/xxhash/xxhash.h +607 -352
  1530. data/third_party/zlib/crc32.c +966 -292
  1531. data/third_party/zlib/crc32.h +9441 -436
  1532. data/third_party/zlib/deflate.c +78 -30
  1533. data/third_party/zlib/deflate.h +12 -15
  1534. data/third_party/zlib/gzguts.h +3 -2
  1535. data/third_party/zlib/gzlib.c +5 -3
  1536. data/third_party/zlib/gzread.c +5 -7
  1537. data/third_party/zlib/gzwrite.c +25 -13
  1538. data/third_party/zlib/infback.c +2 -1
  1539. data/third_party/zlib/inffast.c +14 -14
  1540. data/third_party/zlib/inflate.c +39 -8
  1541. data/third_party/zlib/inflate.h +3 -2
  1542. data/third_party/zlib/inftrees.c +3 -3
  1543. data/third_party/zlib/trees.c +27 -48
  1544. data/third_party/zlib/zlib.h +123 -100
  1545. data/third_party/zlib/zutil.c +2 -2
  1546. data/third_party/zlib/zutil.h +12 -9
  1547. metadata +502 -247
  1548. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +0 -44
  1549. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +0 -83
  1550. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +0 -31
  1551. data/src/core/ext/filters/client_channel/resolver_registry.cc +0 -194
  1552. data/src/core/ext/filters/client_channel/resolver_registry.h +0 -88
  1553. data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -264
  1554. data/src/core/ext/filters/max_age/max_age_filter.cc +0 -560
  1555. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +0 -122
  1556. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +0 -92
  1557. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +0 -192
  1558. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +0 -52
  1559. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +0 -79
  1560. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +0 -125
  1561. data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +0 -37
  1562. data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +0 -107
  1563. data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +0 -46
  1564. data/src/core/ext/transport/chttp2/transport/popularity_count.h +0 -60
  1565. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +0 -38
  1566. data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +0 -64
  1567. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -38
  1568. data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +0 -64
  1569. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -38
  1570. data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +0 -64
  1571. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -38
  1572. data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +0 -64
  1573. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +0 -38
  1574. data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +0 -64
  1575. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c +0 -102
  1576. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h +0 -306
  1577. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c +0 -56
  1578. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h +0 -135
  1579. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c +0 -115
  1580. data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h +0 -371
  1581. data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +0 -67
  1582. data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +0 -35
  1583. data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +0 -68
  1584. data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +0 -35
  1585. data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +0 -67
  1586. data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +0 -35
  1587. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +0 -75
  1588. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +0 -35
  1589. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +0 -69
  1590. data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +0 -35
  1591. data/src/core/lib/compression/algorithm_metadata.h +0 -62
  1592. data/src/core/lib/compression/compression_args.cc +0 -140
  1593. data/src/core/lib/compression/compression_args.h +0 -58
  1594. data/src/core/lib/compression/stream_compression.cc +0 -81
  1595. data/src/core/lib/compression/stream_compression.h +0 -117
  1596. data/src/core/lib/compression/stream_compression_gzip.cc +0 -231
  1597. data/src/core/lib/compression/stream_compression_gzip.h +0 -28
  1598. data/src/core/lib/compression/stream_compression_identity.cc +0 -91
  1599. data/src/core/lib/compression/stream_compression_identity.h +0 -29
  1600. data/src/core/lib/event_engine/event_engine_factory.cc +0 -49
  1601. data/src/core/lib/event_engine/sockaddr.cc +0 -40
  1602. data/src/core/lib/event_engine/sockaddr.h +0 -44
  1603. data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1654
  1604. data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
  1605. data/src/core/lib/iomgr/event_engine/closure.cc +0 -77
  1606. data/src/core/lib/iomgr/event_engine/closure.h +0 -42
  1607. data/src/core/lib/iomgr/event_engine/endpoint.cc +0 -172
  1608. data/src/core/lib/iomgr/event_engine/endpoint.h +0 -52
  1609. data/src/core/lib/iomgr/event_engine/iomgr.cc +0 -84
  1610. data/src/core/lib/iomgr/event_engine/pollset.cc +0 -88
  1611. data/src/core/lib/iomgr/event_engine/resolver.cc +0 -115
  1612. data/src/core/lib/iomgr/event_engine/tcp.cc +0 -295
  1613. data/src/core/lib/iomgr/event_engine/timer.cc +0 -63
  1614. data/src/core/lib/iomgr/iomgr_custom.cc +0 -79
  1615. data/src/core/lib/iomgr/iomgr_custom.h +0 -49
  1616. data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
  1617. data/src/core/lib/iomgr/pollset_custom.cc +0 -105
  1618. data/src/core/lib/iomgr/pollset_custom.h +0 -37
  1619. data/src/core/lib/iomgr/pollset_set_custom.cc +0 -47
  1620. data/src/core/lib/iomgr/pollset_set_custom.h +0 -26
  1621. data/src/core/lib/iomgr/resolve_address_custom.cc +0 -169
  1622. data/src/core/lib/iomgr/resolve_address_custom.h +0 -44
  1623. data/src/core/lib/iomgr/sys_epoll_wrapper.h +0 -30
  1624. data/src/core/lib/iomgr/tcp_client_custom.cc +0 -146
  1625. data/src/core/lib/iomgr/tcp_custom.cc +0 -350
  1626. data/src/core/lib/iomgr/tcp_custom.h +0 -85
  1627. data/src/core/lib/iomgr/tcp_server_custom.cc +0 -457
  1628. data/src/core/lib/iomgr/timer_custom.cc +0 -96
  1629. data/src/core/lib/iomgr/timer_custom.h +0 -43
  1630. data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +0 -173
  1631. data/src/core/lib/security/authorization/sdk_server_authz_filter.h +0 -67
  1632. data/src/core/lib/security/credentials/credentials_metadata.cc +0 -61
  1633. data/src/core/lib/slice/slice_intern.cc +0 -367
  1634. data/src/core/lib/slice/slice_split.cc +0 -100
  1635. data/src/core/lib/slice/slice_split.h +0 -40
  1636. data/src/core/lib/slice/slice_utils.h +0 -200
  1637. data/src/core/lib/slice/static_slice.cc +0 -377
  1638. data/src/core/lib/slice/static_slice.h +0 -300
  1639. data/src/core/lib/surface/init_secure.cc +0 -103
  1640. data/src/core/lib/transport/byte_stream.cc +0 -162
  1641. data/src/core/lib/transport/byte_stream.h +0 -166
  1642. data/src/core/lib/transport/metadata.cc +0 -714
  1643. data/src/core/lib/transport/metadata.h +0 -449
  1644. data/src/core/lib/transport/static_metadata.cc +0 -1032
  1645. data/src/core/lib/transport/static_metadata.h +0 -322
  1646. data/src/core/lib/transport/status_metadata.cc +0 -63
  1647. data/src/core/lib/transport/status_metadata.h +0 -48
  1648. data/third_party/abseil-cpp/absl/container/internal/have_sse.h +0 -50
  1649. data/third_party/cares/cares/ares_getopt.c +0 -122
  1650. data/third_party/cares/cares/ares_getopt.h +0 -53
  1651. data/third_party/cares/cares/ares_parse_a_reply.c +0 -264
  1652. data/third_party/cares/cares/ares_parse_aaaa_reply.c +0 -264
  1653. data/third_party/cares/cares/ares_parse_soa_reply.c +0 -133
  1654. /data/third_party/cares/cares/{ares_rules.h → include/ares_rules.h} +0 -0
  1655. /data/third_party/cares/cares/{ares__read_line.c → src/lib/ares__read_line.c} +0 -0
  1656. /data/third_party/cares/cares/{ares__timeval.c → src/lib/ares__timeval.c} +0 -0
  1657. /data/third_party/cares/cares/{ares_cancel.c → src/lib/ares_cancel.c} +0 -0
  1658. /data/third_party/cares/cares/{ares_destroy.c → src/lib/ares_destroy.c} +0 -0
  1659. /data/third_party/cares/cares/{ares_fds.c → src/lib/ares_fds.c} +0 -0
  1660. /data/third_party/cares/cares/{ares_free_string.c → src/lib/ares_free_string.c} +0 -0
  1661. /data/third_party/cares/cares/{ares_getenv.h → src/lib/ares_getenv.h} +0 -0
  1662. /data/third_party/cares/cares/{ares_getsock.c → src/lib/ares_getsock.c} +0 -0
  1663. /data/third_party/cares/cares/{ares_inet_net_pton.h → src/lib/ares_inet_net_pton.h} +0 -0
  1664. /data/third_party/cares/cares/{ares_iphlpapi.h → src/lib/ares_iphlpapi.h} +0 -0
  1665. /data/third_party/cares/cares/{ares_llist.c → src/lib/ares_llist.c} +0 -0
  1666. /data/third_party/cares/cares/{ares_llist.h → src/lib/ares_llist.h} +0 -0
  1667. /data/third_party/cares/cares/{ares_mkquery.c → src/lib/ares_mkquery.c} +0 -0
  1668. /data/third_party/cares/cares/{ares_nowarn.c → src/lib/ares_nowarn.c} +0 -0
  1669. /data/third_party/cares/cares/{ares_nowarn.h → src/lib/ares_nowarn.h} +0 -0
  1670. /data/third_party/cares/cares/{ares_options.c → src/lib/ares_options.c} +0 -0
  1671. /data/third_party/cares/cares/{ares_platform.c → src/lib/ares_platform.c} +0 -0
  1672. /data/third_party/cares/cares/{ares_platform.h → src/lib/ares_platform.h} +0 -0
  1673. /data/third_party/cares/cares/{ares_strcasecmp.c → src/lib/ares_strcasecmp.c} +0 -0
  1674. /data/third_party/cares/cares/{ares_strcasecmp.h → src/lib/ares_strcasecmp.h} +0 -0
  1675. /data/third_party/cares/cares/{ares_strdup.c → src/lib/ares_strdup.c} +0 -0
  1676. /data/third_party/cares/cares/{ares_strdup.h → src/lib/ares_strdup.h} +0 -0
  1677. /data/third_party/cares/cares/{ares_strerror.c → src/lib/ares_strerror.c} +0 -0
  1678. /data/third_party/cares/cares/{ares_strsplit.h → src/lib/ares_strsplit.h} +0 -0
  1679. /data/third_party/cares/cares/{ares_timeout.c → src/lib/ares_timeout.c} +0 -0
  1680. /data/third_party/cares/cares/{ares_version.c → src/lib/ares_version.c} +0 -0
  1681. /data/third_party/cares/cares/{ares_writev.c → src/lib/ares_writev.c} +0 -0
  1682. /data/third_party/cares/cares/{bitncmp.c → src/lib/bitncmp.c} +0 -0
  1683. /data/third_party/cares/cares/{bitncmp.h → src/lib/bitncmp.h} +0 -0
  1684. /data/third_party/cares/cares/{config-win32.h → src/lib/config-win32.h} +0 -0
  1685. /data/third_party/cares/cares/{setup_once.h → src/lib/setup_once.h} +0 -0
  1686. /data/third_party/cares/cares/{windows_port.c → src/lib/windows_port.c} +0 -0
@@ -20,44 +20,84 @@
20
20
 
21
21
  #include <inttypes.h>
22
22
  #include <limits.h>
23
- #include <math.h>
24
23
  #include <stdio.h>
24
+ #include <stdlib.h>
25
25
  #include <string.h>
26
26
 
27
+ #include <algorithm>
28
+ #include <memory>
29
+ #include <new>
30
+ #include <string>
31
+ #include <utility>
32
+
33
+ #include "absl/base/attributes.h"
34
+ #include "absl/status/status.h"
35
+ #include "absl/strings/cord.h"
36
+ #include "absl/strings/str_cat.h"
27
37
  #include "absl/strings/str_format.h"
38
+ #include "absl/strings/string_view.h"
39
+ #include "absl/types/optional.h"
40
+ #include "absl/types/variant.h"
28
41
 
42
+ #include <grpc/impl/codegen/connectivity_state.h>
29
43
  #include <grpc/slice_buffer.h>
44
+ #include <grpc/status.h>
30
45
  #include <grpc/support/alloc.h>
46
+ #include <grpc/support/atm.h>
31
47
  #include <grpc/support/log.h>
32
- #include <grpc/support/string_util.h>
33
48
 
34
49
  #include "src/core/ext/transport/chttp2/transport/context_list.h"
50
+ #include "src/core/ext/transport/chttp2/transport/flow_control.h"
51
+ #include "src/core/ext/transport/chttp2/transport/frame.h"
35
52
  #include "src/core/ext/transport/chttp2/transport/frame_data.h"
53
+ #include "src/core/ext/transport/chttp2/transport/frame_goaway.h"
54
+ #include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
55
+ #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
56
+ #include "src/core/ext/transport/chttp2/transport/http2_settings.h"
36
57
  #include "src/core/ext/transport/chttp2/transport/internal.h"
58
+ #include "src/core/ext/transport/chttp2/transport/stream_map.h"
37
59
  #include "src/core/ext/transport/chttp2/transport/varint.h"
38
60
  #include "src/core/lib/channel/channel_args.h"
39
- #include "src/core/lib/compression/stream_compression.h"
40
61
  #include "src/core/lib/debug/stats.h"
41
- #include "src/core/lib/gpr/env.h"
42
- #include "src/core/lib/gpr/string.h"
43
- #include "src/core/lib/gprpp/memory.h"
62
+ #include "src/core/lib/gpr/useful.h"
63
+ #include "src/core/lib/gprpp/bitset.h"
64
+ #include "src/core/lib/gprpp/debug_location.h"
65
+ #include "src/core/lib/gprpp/global_config_env.h"
66
+ #include "src/core/lib/gprpp/ref_counted.h"
67
+ #include "src/core/lib/gprpp/status_helper.h"
68
+ #include "src/core/lib/gprpp/time.h"
44
69
  #include "src/core/lib/http/parser.h"
45
- #include "src/core/lib/iomgr/executor.h"
46
- #include "src/core/lib/iomgr/iomgr.h"
70
+ #include "src/core/lib/iomgr/combiner.h"
71
+ #include "src/core/lib/iomgr/error.h"
72
+ #include "src/core/lib/iomgr/exec_ctx.h"
73
+ #include "src/core/lib/iomgr/iomgr_fwd.h"
74
+ #include "src/core/lib/iomgr/pollset.h"
47
75
  #include "src/core/lib/iomgr/timer.h"
48
76
  #include "src/core/lib/profiling/timers.h"
77
+ #include "src/core/lib/promise/poll.h"
49
78
  #include "src/core/lib/resource_quota/api.h"
79
+ #include "src/core/lib/resource_quota/arena.h"
80
+ #include "src/core/lib/resource_quota/memory_quota.h"
81
+ #include "src/core/lib/resource_quota/resource_quota.h"
50
82
  #include "src/core/lib/resource_quota/trace.h"
83
+ #include "src/core/lib/slice/slice.h"
84
+ #include "src/core/lib/slice/slice_buffer.h"
51
85
  #include "src/core/lib/slice/slice_internal.h"
52
- #include "src/core/lib/slice/slice_string_helpers.h"
86
+ #include "src/core/lib/slice/slice_refcount.h"
87
+ #include "src/core/lib/transport/bdp_estimator.h"
88
+ #include "src/core/lib/transport/connectivity_state.h"
53
89
  #include "src/core/lib/transport/error_utils.h"
54
90
  #include "src/core/lib/transport/http2_errors.h"
55
- #include "src/core/lib/transport/static_metadata.h"
91
+ #include "src/core/lib/transport/metadata_batch.h"
56
92
  #include "src/core/lib/transport/status_conversion.h"
57
- #include "src/core/lib/transport/timeout_encoding.h"
58
93
  #include "src/core/lib/transport/transport.h"
59
94
  #include "src/core/lib/transport/transport_impl.h"
60
- #include "src/core/lib/uri/uri_parser.h"
95
+
96
+ GPR_GLOBAL_CONFIG_DEFINE_BOOL(
97
+ grpc_experimental_enable_peer_state_based_framing, false,
98
+ "If set, the max sizes of frames sent to lower layers is controlled based "
99
+ "on the peer's memory pressure which is reflected in its max http2 frame "
100
+ "size.");
61
101
 
62
102
  #define DEFAULT_CONNECTION_WINDOW_TARGET (1024 * 1024)
63
103
  #define MAX_WINDOW 0x7fffffffu
@@ -111,8 +151,6 @@ static void read_action(void* t, grpc_error_handle error);
111
151
  static void read_action_locked(void* t, grpc_error_handle error);
112
152
  static void continue_read_action_locked(grpc_chttp2_transport* t);
113
153
 
114
- static void complete_fetch(void* gs, grpc_error_handle error);
115
- static void complete_fetch_locked(void* gs, grpc_error_handle error);
116
154
  // Set a transport level setting, and push it to our peer
117
155
  static void queue_setting_update(grpc_chttp2_transport* t,
118
156
  grpc_chttp2_setting_id id, uint32_t value);
@@ -162,18 +200,13 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error);
162
200
  static void keepalive_watchdog_fired(void* arg, grpc_error_handle error);
163
201
  static void keepalive_watchdog_fired_locked(void* arg, grpc_error_handle error);
164
202
 
165
- static void reset_byte_stream(void* arg, grpc_error_handle error);
166
-
167
- // Flow control default enabled. Can be disabled by setting
168
- // GRPC_EXPERIMENTAL_DISABLE_FLOW_CONTROL
169
- bool g_flow_control_enabled = true;
170
-
171
203
  namespace grpc_core {
172
204
 
173
205
  namespace {
174
206
  TestOnlyGlobalHttp2TransportInitCallback test_only_init_callback = nullptr;
175
207
  TestOnlyGlobalHttp2TransportDestructCallback test_only_destruct_callback =
176
208
  nullptr;
209
+ bool test_only_disable_transient_failure_state_notification = false;
177
210
  } // namespace
178
211
 
179
212
  void TestOnlySetGlobalHttp2TransportInitCallback(
@@ -186,6 +219,11 @@ void TestOnlySetGlobalHttp2TransportDestructCallback(
186
219
  test_only_destruct_callback = callback;
187
220
  }
188
221
 
222
+ void TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification(
223
+ bool disable) {
224
+ test_only_disable_transient_failure_state_notification = disable;
225
+ }
226
+
189
227
  } // namespace grpc_core
190
228
 
191
229
  //
@@ -238,8 +276,6 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
238
276
  write_cb_pool = next;
239
277
  }
240
278
 
241
- flow_control.Destroy();
242
-
243
279
  GRPC_ERROR_UNREF(closed_with_error);
244
280
  gpr_free(ping_acks);
245
281
  if (grpc_core::test_only_destruct_callback != nullptr) {
@@ -249,11 +285,9 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
249
285
 
250
286
  static const grpc_transport_vtable* get_vtable(void);
251
287
 
252
- // Returns whether bdp is enabled
253
- static bool read_channel_args(grpc_chttp2_transport* t,
288
+ static void read_channel_args(grpc_chttp2_transport* t,
254
289
  const grpc_channel_args* channel_args,
255
290
  bool is_client) {
256
- bool enable_bdp = true;
257
291
  bool channelz_enabled = GRPC_ENABLE_CHANNELZ_DEFAULT;
258
292
  size_t i;
259
293
  int j;
@@ -294,18 +328,15 @@ static bool read_channel_args(grpc_chttp2_transport* t,
294
328
  strcmp(channel_args->args[i].key,
295
329
  GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS)) {
296
330
  t->ping_policy.min_recv_ping_interval_without_data =
297
- grpc_channel_arg_get_integer(
331
+ grpc_core::Duration::Milliseconds(grpc_channel_arg_get_integer(
298
332
  &channel_args->args[i],
299
333
  grpc_integer_options{
300
334
  g_default_min_recv_ping_interval_without_data_ms, 0,
301
- INT_MAX});
335
+ INT_MAX}));
302
336
  } else if (0 == strcmp(channel_args->args[i].key,
303
337
  GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) {
304
338
  t->write_buffer_size = static_cast<uint32_t>(grpc_channel_arg_get_integer(
305
339
  &channel_args->args[i], {0, 0, MAX_WRITE_BUFFER_SIZE}));
306
- } else if (0 ==
307
- strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_BDP_PROBE)) {
308
- enable_bdp = grpc_channel_arg_get_bool(&channel_args->args[i], true);
309
340
  } else if (0 ==
310
341
  strcmp(channel_args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) {
311
342
  const int value = grpc_channel_arg_get_integer(
@@ -314,7 +345,9 @@ static bool read_channel_args(grpc_chttp2_transport* t,
314
345
  ? g_default_client_keepalive_time_ms
315
346
  : g_default_server_keepalive_time_ms,
316
347
  1, INT_MAX});
317
- t->keepalive_time = value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
348
+ t->keepalive_time = value == INT_MAX
349
+ ? grpc_core::Duration::Infinity()
350
+ : grpc_core::Duration::Milliseconds(value);
318
351
  } else if (0 == strcmp(channel_args->args[i].key,
319
352
  GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) {
320
353
  const int value = grpc_channel_arg_get_integer(
@@ -323,7 +356,9 @@ static bool read_channel_args(grpc_chttp2_transport* t,
323
356
  ? g_default_client_keepalive_timeout_ms
324
357
  : g_default_server_keepalive_timeout_ms,
325
358
  0, INT_MAX});
326
- t->keepalive_timeout = value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
359
+ t->keepalive_timeout = value == INT_MAX
360
+ ? grpc_core::Duration::Infinity()
361
+ : grpc_core::Duration::Milliseconds(value);
327
362
  } else if (0 == strcmp(channel_args->args[i].key,
328
363
  GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) {
329
364
  t->keepalive_permit_without_calls = static_cast<uint32_t>(
@@ -393,26 +428,29 @@ static bool read_channel_args(grpc_chttp2_transport* t,
393
428
  grpc_core::channelz::SocketNode::Security::GetFromChannelArgs(
394
429
  channel_args));
395
430
  }
396
- return enable_bdp;
397
431
  }
398
432
 
399
433
  static void init_transport_keepalive_settings(grpc_chttp2_transport* t) {
400
434
  if (t->is_client) {
401
435
  t->keepalive_time = g_default_client_keepalive_time_ms == INT_MAX
402
- ? GRPC_MILLIS_INF_FUTURE
403
- : g_default_client_keepalive_time_ms;
436
+ ? grpc_core::Duration::Infinity()
437
+ : grpc_core::Duration::Milliseconds(
438
+ g_default_client_keepalive_time_ms);
404
439
  t->keepalive_timeout = g_default_client_keepalive_timeout_ms == INT_MAX
405
- ? GRPC_MILLIS_INF_FUTURE
406
- : g_default_client_keepalive_timeout_ms;
440
+ ? grpc_core::Duration::Infinity()
441
+ : grpc_core::Duration::Milliseconds(
442
+ g_default_client_keepalive_timeout_ms);
407
443
  t->keepalive_permit_without_calls =
408
444
  g_default_client_keepalive_permit_without_calls;
409
445
  } else {
410
446
  t->keepalive_time = g_default_server_keepalive_time_ms == INT_MAX
411
- ? GRPC_MILLIS_INF_FUTURE
412
- : g_default_server_keepalive_time_ms;
447
+ ? grpc_core::Duration::Infinity()
448
+ : grpc_core::Duration::Milliseconds(
449
+ g_default_server_keepalive_time_ms);
413
450
  t->keepalive_timeout = g_default_server_keepalive_timeout_ms == INT_MAX
414
- ? GRPC_MILLIS_INF_FUTURE
415
- : g_default_server_keepalive_timeout_ms;
451
+ ? grpc_core::Duration::Infinity()
452
+ : grpc_core::Duration::Milliseconds(
453
+ g_default_server_keepalive_timeout_ms);
416
454
  t->keepalive_permit_without_calls =
417
455
  g_default_server_keepalive_permit_without_calls;
418
456
  }
@@ -422,11 +460,12 @@ static void configure_transport_ping_policy(grpc_chttp2_transport* t) {
422
460
  t->ping_policy.max_pings_without_data = g_default_max_pings_without_data;
423
461
  t->ping_policy.max_ping_strikes = g_default_max_ping_strikes;
424
462
  t->ping_policy.min_recv_ping_interval_without_data =
425
- g_default_min_recv_ping_interval_without_data_ms;
463
+ grpc_core::Duration::Milliseconds(
464
+ g_default_min_recv_ping_interval_without_data_ms);
426
465
  }
427
466
 
428
467
  static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
429
- if (t->keepalive_time != GRPC_MILLIS_INF_FUTURE) {
468
+ if (t->keepalive_time != grpc_core::Duration::Infinity()) {
430
469
  t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING;
431
470
  GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping");
432
471
  GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
@@ -459,6 +498,10 @@ grpc_chttp2_transport::grpc_chttp2_transport(
459
498
  GRPC_CHANNEL_READY),
460
499
  is_client(is_client),
461
500
  next_stream_id(is_client ? 1 : 2),
501
+ flow_control(peer_string.c_str(),
502
+ grpc_channel_args_find_bool(channel_args,
503
+ GRPC_ARG_HTTP2_BDP_PROBE, true),
504
+ &memory_owner),
462
505
  deframe_state(is_client ? GRPC_DTS_FH_0 : GRPC_DTS_CLIENT_PREFIX_0) {
463
506
  GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) ==
464
507
  GRPC_CHTTP2_CLIENT_CONNECT_STRLEN);
@@ -500,32 +543,23 @@ grpc_chttp2_transport::grpc_chttp2_transport(
500
543
  configure_transport_ping_policy(this);
501
544
  init_transport_keepalive_settings(this);
502
545
 
503
- bool enable_bdp = true;
504
- if (channel_args) {
505
- enable_bdp = read_channel_args(this, channel_args, is_client);
506
- }
507
-
508
- if (g_flow_control_enabled) {
509
- flow_control.Init<grpc_core::chttp2::TransportFlowControl>(this,
510
- enable_bdp);
511
- } else {
512
- flow_control.Init<grpc_core::chttp2::TransportFlowControlDisabled>(this);
513
- enable_bdp = false;
546
+ if (channel_args != nullptr) {
547
+ read_channel_args(this, channel_args, is_client);
514
548
  }
515
549
 
516
550
  // No pings allowed before receiving a header or data frame.
517
551
  ping_state.pings_before_data_required = 0;
518
552
  ping_state.is_delayed_ping_timer_set = false;
519
- ping_state.last_ping_sent_time = GRPC_MILLIS_INF_PAST;
553
+ ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast();
520
554
 
521
- ping_recv_state.last_ping_recv_time = GRPC_MILLIS_INF_PAST;
555
+ ping_recv_state.last_ping_recv_time = grpc_core::Timestamp::InfPast();
522
556
  ping_recv_state.ping_strikes = 0;
523
557
 
524
558
  init_keepalive_pings_if_enabled(this);
525
559
 
526
- if (enable_bdp) {
560
+ if (flow_control.bdp_probe()) {
527
561
  bdp_ping_blocked = true;
528
- grpc_chttp2_act_on_flowctl_action(flow_control->PeriodicUpdate(), this,
562
+ grpc_chttp2_act_on_flowctl_action(flow_control.PeriodicUpdate(), this,
529
563
  nullptr);
530
564
  }
531
565
 
@@ -558,13 +592,13 @@ static void close_transport_locked(grpc_chttp2_transport* t,
558
592
  grpc_error_handle error) {
559
593
  end_all_the_calls(t, GRPC_ERROR_REF(error));
560
594
  cancel_pings(t, GRPC_ERROR_REF(error));
561
- if (t->closed_with_error == GRPC_ERROR_NONE) {
595
+ if (GRPC_ERROR_IS_NONE(t->closed_with_error)) {
562
596
  if (!grpc_error_has_clear_grpc_status(error)) {
563
597
  error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
564
598
  GRPC_STATUS_UNAVAILABLE);
565
599
  }
566
600
  if (t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE) {
567
- if (t->close_transport_on_writes_finished == GRPC_ERROR_NONE) {
601
+ if (GRPC_ERROR_IS_NONE(t->close_transport_on_writes_finished)) {
568
602
  t->close_transport_on_writes_finished =
569
603
  GRPC_ERROR_CREATE_FROM_STATIC_STRING(
570
604
  "Delayed close due to in-progress write");
@@ -573,7 +607,7 @@ static void close_transport_locked(grpc_chttp2_transport* t,
573
607
  grpc_error_add_child(t->close_transport_on_writes_finished, error);
574
608
  return;
575
609
  }
576
- GPR_ASSERT(error != GRPC_ERROR_NONE);
610
+ GPR_ASSERT(!GRPC_ERROR_IS_NONE(error));
577
611
  t->closed_with_error = GRPC_ERROR_REF(error);
578
612
  connectivity_state_set(t, GRPC_CHANNEL_SHUTDOWN, absl::Status(),
579
613
  "close_transport");
@@ -649,34 +683,24 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
649
683
  : t(t),
650
684
  refcount(refcount),
651
685
  reffer(this),
652
- stream_reservation(t->memory_owner.MakeReservation(
653
- grpc_core::kResourceQuotaCallSize)), // TODO(ctiller): sizeof(*this),
654
- // or better, move allocation to
655
- // memory quota.
656
686
  initial_metadata_buffer(arena),
657
- trailing_metadata_buffer(arena) {
687
+ trailing_metadata_buffer(arena),
688
+ flow_control(&t->flow_control) {
658
689
  if (server_data) {
659
690
  id = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(server_data));
660
691
  *t->accepting_stream = this;
661
692
  grpc_chttp2_stream_map_add(&t->stream_map, id, this);
662
693
  post_destructive_reclaimer(t);
663
694
  }
664
- if (t->flow_control->flow_control_enabled()) {
665
- flow_control.Init<grpc_core::chttp2::StreamFlowControl>(
666
- static_cast<grpc_core::chttp2::TransportFlowControl*>(
667
- t->flow_control.get()),
668
- this);
669
- } else {
670
- flow_control.Init<grpc_core::chttp2::StreamFlowControlDisabled>();
671
- }
672
695
 
673
696
  grpc_slice_buffer_init(&frame_storage);
674
- grpc_slice_buffer_init(&unprocessed_incoming_frames_buffer);
675
697
  grpc_slice_buffer_init(&flow_controlled_buffer);
676
- GRPC_CLOSURE_INIT(&reset_byte_stream, ::reset_byte_stream, this, nullptr);
677
698
  }
678
699
 
679
700
  grpc_chttp2_stream::~grpc_chttp2_stream() {
701
+ grpc_chttp2_list_remove_stalled_by_stream(t, this);
702
+ grpc_chttp2_list_remove_stalled_by_transport(t, this);
703
+
680
704
  if (t->channelz_socket != nullptr) {
681
705
  if ((t->is_client && eos_received) || (!t->is_client && eos_sent)) {
682
706
  t->channelz_socket->RecordStreamSucceeded();
@@ -690,18 +714,10 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
690
714
  GPR_ASSERT(grpc_chttp2_stream_map_find(&t->stream_map, id) == nullptr);
691
715
  }
692
716
 
693
- grpc_slice_buffer_destroy_internal(&unprocessed_incoming_frames_buffer);
694
717
  grpc_slice_buffer_destroy_internal(&frame_storage);
695
- if (stream_compression_method != GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
696
- grpc_slice_buffer_destroy_internal(&compressed_data_buffer);
697
- }
698
- if (stream_decompression_method !=
699
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
700
- grpc_slice_buffer_destroy_internal(&decompressed_data_buffer);
701
- }
702
718
 
703
719
  for (int i = 0; i < STREAM_LIST_COUNT; i++) {
704
- if (GPR_UNLIKELY(included[i])) {
720
+ if (GPR_UNLIKELY(included.is_set(i))) {
705
721
  gpr_log(GPR_ERROR, "%s stream %d still included in list %d",
706
722
  t->is_client ? "client" : "server", id, i);
707
723
  abort();
@@ -709,7 +725,6 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
709
725
  }
710
726
 
711
727
  GPR_ASSERT(send_initial_metadata_finished == nullptr);
712
- GPR_ASSERT(fetching_send_message == nullptr);
713
728
  GPR_ASSERT(send_trailing_metadata_finished == nullptr);
714
729
  GPR_ASSERT(recv_initial_metadata_ready == nullptr);
715
730
  GPR_ASSERT(recv_message_ready == nullptr);
@@ -717,8 +732,6 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
717
732
  grpc_slice_buffer_destroy_internal(&flow_controlled_buffer);
718
733
  GRPC_ERROR_UNREF(read_closed_error);
719
734
  GRPC_ERROR_UNREF(write_closed_error);
720
- GRPC_ERROR_UNREF(byte_stream_error);
721
- flow_control.Destroy();
722
735
  GRPC_CHTTP2_UNREF_TRANSPORT(t, "stream");
723
736
  grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, GRPC_ERROR_NONE);
724
737
  }
@@ -743,18 +756,6 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
743
756
  GPR_TIMER_SCOPE("destroy_stream", 0);
744
757
  grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
745
758
  grpc_chttp2_stream* s = reinterpret_cast<grpc_chttp2_stream*>(gs);
746
- if (s->stream_compression_method !=
747
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS &&
748
- s->stream_compression_ctx != nullptr) {
749
- grpc_stream_compression_context_destroy(s->stream_compression_ctx);
750
- s->stream_compression_ctx = nullptr;
751
- }
752
- if (s->stream_decompression_method !=
753
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS &&
754
- s->stream_decompression_ctx != nullptr) {
755
- grpc_stream_compression_context_destroy(s->stream_decompression_ctx);
756
- s->stream_decompression_ctx = nullptr;
757
- }
758
759
 
759
760
  s->destroy_stream_arg = then_schedule_closure;
760
761
  t->combiner->Run(
@@ -807,7 +808,7 @@ static void set_write_state(grpc_chttp2_transport* t,
807
808
  // from peer while we had some pending writes)
808
809
  if (st == GRPC_CHTTP2_WRITE_STATE_IDLE) {
809
810
  grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &t->run_after_write);
810
- if (t->close_transport_on_writes_finished != GRPC_ERROR_NONE) {
811
+ if (!GRPC_ERROR_IS_NONE(t->close_transport_on_writes_finished)) {
811
812
  grpc_error_handle err = t->close_transport_on_writes_finished;
812
813
  t->close_transport_on_writes_finished = GRPC_ERROR_NONE;
813
814
  close_transport_locked(t, err);
@@ -857,6 +858,9 @@ static void inc_initiate_write_reason(
857
858
  case GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS:
858
859
  GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS();
859
860
  break;
861
+ case GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK:
862
+ GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SETTINGS_ACK();
863
+ break;
860
864
  case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING:
861
865
  GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_SETTING();
862
866
  break;
@@ -926,7 +930,7 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
926
930
 
927
931
  void grpc_chttp2_mark_stream_writable(grpc_chttp2_transport* t,
928
932
  grpc_chttp2_stream* s) {
929
- if (t->closed_with_error == GRPC_ERROR_NONE &&
933
+ if (GRPC_ERROR_IS_NONE(t->closed_with_error) &&
930
934
  grpc_chttp2_list_add_writable_stream(t, s)) {
931
935
  GRPC_CHTTP2_STREAM_REF(s, "chttp2_writing:become");
932
936
  }
@@ -946,7 +950,7 @@ static void write_action_begin_locked(void* gt,
946
950
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
947
951
  GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE);
948
952
  grpc_chttp2_begin_write_result r;
949
- if (t->closed_with_error != GRPC_ERROR_NONE) {
953
+ if (!GRPC_ERROR_IS_NONE(t->closed_with_error)) {
950
954
  r.writing = false;
951
955
  } else {
952
956
  r = grpc_chttp2_begin_write(t);
@@ -982,14 +986,26 @@ static void write_action_begin_locked(void* gt,
982
986
 
983
987
  static void write_action(void* gt, grpc_error_handle /*error*/) {
984
988
  GPR_TIMER_SCOPE("write_action", 0);
989
+ static bool kEnablePeerStateBasedFraming =
990
+ GPR_GLOBAL_CONFIG_GET(grpc_experimental_enable_peer_state_based_framing);
985
991
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
986
992
  void* cl = t->cl;
987
993
  t->cl = nullptr;
994
+ // If grpc_experimental_enable_peer_state_based_framing is set to true,
995
+ // choose max_frame_size as 2 * max http2 frame size of peer. If peer is under
996
+ // high memory pressure, then it would advertise a smaller max http2 frame
997
+ // size. With this logic, the sender would automatically reduce the sending
998
+ // frame size as well.
999
+ int max_frame_size =
1000
+ kEnablePeerStateBasedFraming
1001
+ ? 2 * t->settings[GRPC_PEER_SETTINGS]
1002
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]
1003
+ : INT_MAX;
988
1004
  grpc_endpoint_write(
989
1005
  t->ep, &t->outbuf,
990
1006
  GRPC_CLOSURE_INIT(&t->write_action_end_locked, write_action_end, t,
991
1007
  grpc_schedule_on_exec_ctx),
992
- cl);
1008
+ cl, max_frame_size);
993
1009
  }
994
1010
 
995
1011
  static void write_action_end(void* tp, grpc_error_handle error) {
@@ -1006,13 +1022,13 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
1006
1022
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
1007
1023
 
1008
1024
  bool closed = false;
1009
- if (error != GRPC_ERROR_NONE) {
1025
+ if (!GRPC_ERROR_IS_NONE(error)) {
1010
1026
  close_transport_locked(t, GRPC_ERROR_REF(error));
1011
1027
  closed = true;
1012
1028
  }
1013
1029
 
1014
- if (t->sent_goaway_state == GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED) {
1015
- t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SENT;
1030
+ if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED) {
1031
+ t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SENT;
1016
1032
  closed = true;
1017
1033
  if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
1018
1034
  close_transport_locked(
@@ -1067,12 +1083,25 @@ static void queue_setting_update(grpc_chttp2_transport* t,
1067
1083
  }
1068
1084
  }
1069
1085
 
1086
+ // Cancel out streams that haven't yet started if we have received a GOAWAY
1087
+ static void cancel_unstarted_streams(grpc_chttp2_transport* t,
1088
+ grpc_error_handle error) {
1089
+ grpc_chttp2_stream* s;
1090
+ while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
1091
+ s->trailing_metadata_buffer.Set(
1092
+ grpc_core::GrpcStreamNetworkState(),
1093
+ grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
1094
+ grpc_chttp2_cancel_stream(t, s, GRPC_ERROR_REF(error));
1095
+ }
1096
+ GRPC_ERROR_UNREF(error);
1097
+ }
1098
+
1070
1099
  void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
1071
1100
  uint32_t goaway_error,
1072
1101
  uint32_t last_stream_id,
1073
1102
  absl::string_view goaway_text) {
1074
1103
  // Discard the error from a previous goaway frame (if any)
1075
- if (t->goaway_error != GRPC_ERROR_NONE) {
1104
+ if (!GRPC_ERROR_IS_NONE(t->goaway_error)) {
1076
1105
  GRPC_ERROR_UNREF(t->goaway_error);
1077
1106
  }
1078
1107
  t->goaway_error = grpc_error_set_str(
@@ -1092,6 +1121,24 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
1092
1121
  gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string.c_str(),
1093
1122
  goaway_error, grpc_error_std_string(t->goaway_error).c_str());
1094
1123
  }
1124
+ if (t->is_client) {
1125
+ cancel_unstarted_streams(t, GRPC_ERROR_REF(t->goaway_error));
1126
+ // Cancel all unseen streams
1127
+ grpc_chttp2_stream_map_for_each(
1128
+ &t->stream_map,
1129
+ [](void* user_data, uint32_t /* key */, void* stream) {
1130
+ uint32_t last_stream_id = *(static_cast<uint32_t*>(user_data));
1131
+ grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(stream);
1132
+ if (s->id > last_stream_id) {
1133
+ s->trailing_metadata_buffer.Set(
1134
+ grpc_core::GrpcStreamNetworkState(),
1135
+ grpc_core::GrpcStreamNetworkState::kNotSeenByServer);
1136
+ grpc_chttp2_cancel_stream(s->t, s,
1137
+ GRPC_ERROR_REF(s->t->goaway_error));
1138
+ }
1139
+ },
1140
+ &last_stream_id);
1141
+ }
1095
1142
  absl::Status status = grpc_error_to_absl_status(t->goaway_error);
1096
1143
  // When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug
1097
1144
  // data equal to "too_many_pings", it should log the occurrence at a log level
@@ -1103,34 +1150,29 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
1103
1150
  gpr_log(GPR_ERROR,
1104
1151
  "Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug "
1105
1152
  "data equal to \"too_many_pings\"");
1106
- double current_keepalive_time_ms = static_cast<double>(t->keepalive_time);
1107
- constexpr int max_keepalive_time_ms =
1108
- INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
1153
+ constexpr auto max_keepalive_time = grpc_core::Duration::Milliseconds(
1154
+ INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER);
1109
1155
  t->keepalive_time =
1110
- current_keepalive_time_ms > static_cast<double>(max_keepalive_time_ms)
1111
- ? GRPC_MILLIS_INF_FUTURE
1112
- : static_cast<grpc_millis>(current_keepalive_time_ms *
1113
- KEEPALIVE_TIME_BACKOFF_MULTIPLIER);
1156
+ t->keepalive_time > max_keepalive_time
1157
+ ? grpc_core::Duration::Infinity()
1158
+ : t->keepalive_time * KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
1114
1159
  status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
1115
- absl::Cord(std::to_string(t->keepalive_time)));
1160
+ absl::Cord(std::to_string(t->keepalive_time.millis())));
1116
1161
  }
1117
1162
  // lie: use transient failure from the transport to indicate goaway has been
1118
1163
  // received.
1119
- connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE, status,
1120
- "got_goaway");
1164
+ if (!grpc_core::test_only_disable_transient_failure_state_notification) {
1165
+ connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE, status,
1166
+ "got_goaway");
1167
+ }
1121
1168
  }
1122
1169
 
1123
1170
  static void maybe_start_some_streams(grpc_chttp2_transport* t) {
1124
1171
  grpc_chttp2_stream* s;
1125
- // cancel out streams that haven't yet started if we have received a GOAWAY
1126
- if (t->goaway_error != GRPC_ERROR_NONE) {
1127
- while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
1128
- grpc_chttp2_cancel_stream(
1129
- t, s,
1130
- grpc_error_set_int(
1131
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("GOAWAY received"),
1132
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
1133
- }
1172
+ // maybe cancel out streams that haven't yet started if we have received a
1173
+ // GOAWAY
1174
+ if (!GRPC_ERROR_IS_NONE(t->goaway_error)) {
1175
+ cancel_unstarted_streams(t, GRPC_ERROR_REF(t->goaway_error));
1134
1176
  return;
1135
1177
  }
1136
1178
  // start streams where we have free grpc_chttp2_stream ids and free
@@ -1165,6 +1207,9 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
1165
1207
  // cancel out streams that will never be started
1166
1208
  if (t->next_stream_id >= MAX_CLIENT_STREAM_ID) {
1167
1209
  while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
1210
+ s->trailing_metadata_buffer.Set(
1211
+ grpc_core::GrpcStreamNetworkState(),
1212
+ grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
1168
1213
  grpc_chttp2_cancel_stream(
1169
1214
  t, s,
1170
1215
  grpc_error_set_int(
@@ -1190,6 +1235,12 @@ static grpc_closure* add_closure_barrier(grpc_closure* closure) {
1190
1235
  static void null_then_sched_closure(grpc_closure** closure) {
1191
1236
  grpc_closure* c = *closure;
1192
1237
  *closure = nullptr;
1238
+ // null_then_schedule_closure might be run during a start_batch which might
1239
+ // subsequently examine the batch for more operations contained within.
1240
+ // However, the closure run might make it back to the call object, push a
1241
+ // completion, have the application see it, and make a new operation on the
1242
+ // call which recycles the batch BEFORE the call to start_batch completes,
1243
+ // forcing a race.
1193
1244
  grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, GRPC_ERROR_NONE);
1194
1245
  }
1195
1246
 
@@ -1218,137 +1269,58 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
1218
1269
  desc, grpc_error_std_string(error).c_str(),
1219
1270
  write_state_name(t->write_state));
1220
1271
  }
1221
- if (error != GRPC_ERROR_NONE) {
1222
- if (closure->error_data.error == GRPC_ERROR_NONE) {
1223
- closure->error_data.error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1272
+ if (!GRPC_ERROR_IS_NONE(error)) {
1273
+ #ifdef GRPC_ERROR_IS_ABSEIL_STATUS
1274
+ grpc_error_handle cl_err =
1275
+ grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
1276
+ #else
1277
+ grpc_error_handle cl_err =
1278
+ reinterpret_cast<grpc_error_handle>(closure->error_data.error);
1279
+ #endif
1280
+ if (GRPC_ERROR_IS_NONE(cl_err)) {
1281
+ cl_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1224
1282
  "Error in HTTP transport completing operation");
1225
- closure->error_data.error =
1226
- grpc_error_set_str(closure->error_data.error,
1227
- GRPC_ERROR_STR_TARGET_ADDRESS, t->peer_string);
1283
+ cl_err = grpc_error_set_str(cl_err, GRPC_ERROR_STR_TARGET_ADDRESS,
1284
+ t->peer_string);
1228
1285
  }
1229
- closure->error_data.error =
1230
- grpc_error_add_child(closure->error_data.error, error);
1286
+ cl_err = grpc_error_add_child(cl_err, error);
1287
+ #ifdef GRPC_ERROR_IS_ABSEIL_STATUS
1288
+ closure->error_data.error = grpc_core::internal::StatusAllocHeapPtr(cl_err);
1289
+ #else
1290
+ closure->error_data.error = reinterpret_cast<intptr_t>(cl_err);
1291
+ #endif
1231
1292
  }
1232
1293
  if (closure->next_data.scratch < CLOSURE_BARRIER_FIRST_REF_BIT) {
1233
1294
  if ((t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE) ||
1234
1295
  !(closure->next_data.scratch & CLOSURE_BARRIER_MAY_COVER_WRITE)) {
1235
1296
  // Using GRPC_CLOSURE_SCHED instead of GRPC_CLOSURE_RUN to avoid running
1236
1297
  // closures earlier than when it is safe to do so.
1237
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure,
1238
- closure->error_data.error);
1298
+ #ifdef GRPC_ERROR_IS_ABSEIL_STATUS
1299
+ grpc_error_handle run_error =
1300
+ grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
1301
+ #else
1302
+ grpc_error_handle run_error =
1303
+ reinterpret_cast<grpc_error_handle>(closure->error_data.error);
1304
+ #endif
1305
+ closure->error_data.error = 0;
1306
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, run_error);
1239
1307
  } else {
1240
- grpc_closure_list_append(&t->run_after_write, closure,
1241
- closure->error_data.error);
1308
+ grpc_closure_list_append(&t->run_after_write, closure);
1242
1309
  }
1243
1310
  }
1244
1311
  }
1245
1312
 
1246
1313
  static bool contains_non_ok_status(grpc_metadata_batch* batch) {
1247
- if (batch->legacy_index()->named.grpc_status != nullptr) {
1248
- return !grpc_mdelem_static_value_eq(
1249
- batch->legacy_index()->named.grpc_status->md,
1250
- GRPC_MDELEM_GRPC_STATUS_0);
1251
- }
1252
- return false;
1253
- }
1254
-
1255
- static void maybe_become_writable_due_to_send_msg(grpc_chttp2_transport* t,
1256
- grpc_chttp2_stream* s) {
1257
- if (s->id != 0 && (!s->write_buffering ||
1258
- s->flow_controlled_buffer.length > t->write_buffer_size)) {
1259
- grpc_chttp2_mark_stream_writable(t, s);
1260
- grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE);
1261
- }
1262
- }
1263
-
1264
- static void add_fetched_slice_locked(grpc_chttp2_transport* t,
1265
- grpc_chttp2_stream* s) {
1266
- s->fetched_send_message_length +=
1267
- static_cast<uint32_t> GRPC_SLICE_LENGTH(s->fetching_slice);
1268
- grpc_slice_buffer_add(&s->flow_controlled_buffer, s->fetching_slice);
1269
- maybe_become_writable_due_to_send_msg(t, s);
1270
- }
1271
-
1272
- static void continue_fetching_send_locked(grpc_chttp2_transport* t,
1273
- grpc_chttp2_stream* s) {
1274
- for (;;) {
1275
- if (s->fetching_send_message == nullptr) {
1276
- // Stream was cancelled before message fetch completed
1277
- abort(); /* TODO(ctiller): what cleanup here? */
1278
- }
1279
- if (s->fetched_send_message_length == s->fetching_send_message->length()) {
1280
- int64_t notify_offset = s->next_message_end_offset;
1281
- if (notify_offset <= s->flow_controlled_bytes_written) {
1282
- grpc_chttp2_complete_closure_step(
1283
- t, s, &s->fetching_send_message_finished, GRPC_ERROR_NONE,
1284
- "fetching_send_message_finished");
1285
- } else {
1286
- grpc_chttp2_write_cb* cb = t->write_cb_pool;
1287
- if (cb == nullptr) {
1288
- cb = static_cast<grpc_chttp2_write_cb*>(gpr_malloc(sizeof(*cb)));
1289
- } else {
1290
- t->write_cb_pool = cb->next;
1291
- }
1292
- cb->call_at_byte = notify_offset;
1293
- cb->closure = s->fetching_send_message_finished;
1294
- s->fetching_send_message_finished = nullptr;
1295
- grpc_chttp2_write_cb** list =
1296
- s->fetching_send_message->flags() & GRPC_WRITE_THROUGH
1297
- ? &s->on_write_finished_cbs
1298
- : &s->on_flow_controlled_cbs;
1299
- cb->next = *list;
1300
- *list = cb;
1301
- }
1302
- s->fetching_send_message.reset();
1303
- return; /* early out */
1304
- } else if (s->fetching_send_message->Next(
1305
- UINT32_MAX, GRPC_CLOSURE_INIT(&s->complete_fetch_locked,
1306
- ::complete_fetch, s,
1307
- grpc_schedule_on_exec_ctx))) {
1308
- grpc_error_handle error =
1309
- s->fetching_send_message->Pull(&s->fetching_slice);
1310
- if (error != GRPC_ERROR_NONE) {
1311
- s->fetching_send_message.reset();
1312
- grpc_chttp2_cancel_stream(t, s, error);
1313
- } else {
1314
- add_fetched_slice_locked(t, s);
1315
- }
1316
- }
1317
- }
1318
- }
1319
-
1320
- static void complete_fetch(void* gs, grpc_error_handle error) {
1321
- grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(gs);
1322
- s->t->combiner->Run(GRPC_CLOSURE_INIT(&s->complete_fetch_locked,
1323
- ::complete_fetch_locked, s, nullptr),
1324
- GRPC_ERROR_REF(error));
1325
- }
1326
-
1327
- static void complete_fetch_locked(void* gs, grpc_error_handle error) {
1328
- grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(gs);
1329
- grpc_chttp2_transport* t = s->t;
1330
- if (error == GRPC_ERROR_NONE) {
1331
- error = s->fetching_send_message->Pull(&s->fetching_slice);
1332
- if (error == GRPC_ERROR_NONE) {
1333
- add_fetched_slice_locked(t, s);
1334
- continue_fetching_send_locked(t, s);
1335
- }
1336
- }
1337
- if (error != GRPC_ERROR_NONE) {
1338
- s->fetching_send_message.reset();
1339
- grpc_chttp2_cancel_stream(t, s, error);
1340
- }
1314
+ return batch->get(grpc_core::GrpcStatusMetadata()).value_or(GRPC_STATUS_OK) !=
1315
+ GRPC_STATUS_OK;
1341
1316
  }
1342
1317
 
1343
1318
  static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
1344
1319
  bool is_client, bool is_initial) {
1345
- md_batch->ForEach([=](grpc_mdelem md) {
1346
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
1347
- char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md));
1348
- gpr_log(GPR_INFO, "HTTP:%d:%s:%s: %s: %s", id, is_initial ? "HDR" : "TRL",
1349
- is_client ? "CLI" : "SVR", key, value);
1350
- gpr_free(key);
1351
- gpr_free(value);
1320
+ const std::string prefix = absl::StrCat(
1321
+ "HTTP:", id, is_initial ? ":HDR" : ":TRL", is_client ? ":CLI:" : ":SVR:");
1322
+ md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
1323
+ gpr_log(GPR_INFO, "%s", absl::StrCat(prefix, key, ": ", value).c_str());
1352
1324
  });
1353
1325
  }
1354
1326
 
@@ -1368,8 +1340,10 @@ static void perform_stream_op_locked(void* stream_op,
1368
1340
  s->context = op->payload->context;
1369
1341
  s->traced = op->is_traced;
1370
1342
  if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
1371
- gpr_log(GPR_INFO, "perform_stream_op_locked: %s; on_complete = %p",
1372
- grpc_transport_stream_op_batch_string(op).c_str(), op->on_complete);
1343
+ gpr_log(GPR_INFO,
1344
+ "perform_stream_op_locked[s=%p; op=%p]: %s; on_complete = %p", s,
1345
+ op, grpc_transport_stream_op_batch_string(op).c_str(),
1346
+ op->on_complete);
1373
1347
  if (op->send_initial_metadata) {
1374
1348
  log_metadata(op_payload->send_initial_metadata.send_initial_metadata,
1375
1349
  s->id, t->is_client, true);
@@ -1386,7 +1360,7 @@ static void perform_stream_op_locked(void* stream_op,
1386
1360
  // This batch has send ops. Use final_data as a barrier until enqueue time;
1387
1361
  // the initial counter is dropped at the end of this function.
1388
1362
  on_complete->next_data.scratch = CLOSURE_BARRIER_FIRST_REF_BIT;
1389
- on_complete->error_data.error = GRPC_ERROR_NONE;
1363
+ on_complete->error_data.error = 0;
1390
1364
  }
1391
1365
 
1392
1366
  if (op->cancel_stream) {
@@ -1402,23 +1376,6 @@ static void perform_stream_op_locked(void* stream_op,
1402
1376
  GPR_ASSERT(s->send_initial_metadata_finished == nullptr);
1403
1377
  on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
1404
1378
 
1405
- // Identify stream compression
1406
- if (op_payload->send_initial_metadata.send_initial_metadata->legacy_index()
1407
- ->named.content_encoding == nullptr ||
1408
- grpc_stream_compression_method_parse(
1409
- GRPC_MDVALUE(
1410
- op_payload->send_initial_metadata.send_initial_metadata
1411
- ->legacy_index()
1412
- ->named.content_encoding->md),
1413
- true, &s->stream_compression_method) == 0) {
1414
- s->stream_compression_method = GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS;
1415
- }
1416
- if (s->stream_compression_method !=
1417
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
1418
- s->uncompressed_data_size = 0;
1419
- s->stream_compression_ctx = nullptr;
1420
- grpc_slice_buffer_init(&s->compressed_data_buffer);
1421
- }
1422
1379
  s->send_initial_metadata_finished = add_closure_barrier(on_complete);
1423
1380
  s->send_initial_metadata =
1424
1381
  op_payload->send_initial_metadata.send_initial_metadata;
@@ -1426,18 +1383,21 @@ static void perform_stream_op_locked(void* stream_op,
1426
1383
  s->deadline = std::min(
1427
1384
  s->deadline,
1428
1385
  s->send_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
1429
- .value_or(GRPC_MILLIS_INF_FUTURE));
1386
+ .value_or(grpc_core::Timestamp::InfFuture()));
1430
1387
  }
1431
1388
  if (contains_non_ok_status(s->send_initial_metadata)) {
1432
1389
  s->seen_error = true;
1433
1390
  }
1434
1391
  if (!s->write_closed) {
1435
1392
  if (t->is_client) {
1436
- if (t->closed_with_error == GRPC_ERROR_NONE) {
1393
+ if (GRPC_ERROR_IS_NONE(t->closed_with_error)) {
1437
1394
  GPR_ASSERT(s->id == 0);
1438
1395
  grpc_chttp2_list_add_waiting_for_concurrency(t, s);
1439
1396
  maybe_start_some_streams(t);
1440
1397
  } else {
1398
+ s->trailing_metadata_buffer.Set(
1399
+ grpc_core::GrpcStreamNetworkState(),
1400
+ grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
1441
1401
  grpc_chttp2_cancel_stream(
1442
1402
  t, s,
1443
1403
  grpc_error_set_int(
@@ -1449,8 +1409,7 @@ static void perform_stream_op_locked(void* stream_op,
1449
1409
  GPR_ASSERT(s->id != 0);
1450
1410
  grpc_chttp2_mark_stream_writable(t, s);
1451
1411
  if (!(op->send_message &&
1452
- (op->payload->send_message.send_message->flags() &
1453
- GRPC_WRITE_BUFFER_HINT))) {
1412
+ (op->payload->send_message.flags & GRPC_WRITE_BUFFER_HINT))) {
1454
1413
  grpc_chttp2_initiate_write(
1455
1414
  t, GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA);
1456
1415
  }
@@ -1474,32 +1433,28 @@ static void perform_stream_op_locked(void* stream_op,
1474
1433
  GRPC_STATS_INC_HTTP2_OP_SEND_MESSAGE();
1475
1434
  t->num_messages_in_next_write++;
1476
1435
  GRPC_STATS_INC_HTTP2_SEND_MESSAGE_SIZE(
1477
- op->payload->send_message.send_message->length());
1436
+ op->payload->send_message.send_message->Length());
1478
1437
  on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
1479
- s->fetching_send_message_finished = add_closure_barrier(op->on_complete);
1438
+ s->send_message_finished = add_closure_barrier(op->on_complete);
1439
+ const uint32_t flags = op_payload->send_message.flags;
1480
1440
  if (s->write_closed) {
1481
1441
  op->payload->send_message.stream_write_closed = true;
1482
1442
  // We should NOT return an error here, so as to avoid a cancel OP being
1483
1443
  // started. The surface layer will notice that the stream has been closed
1484
1444
  // for writes and fail the send message op.
1485
- op->payload->send_message.send_message.reset();
1486
- grpc_chttp2_complete_closure_step(
1487
- t, s, &s->fetching_send_message_finished, GRPC_ERROR_NONE,
1488
- "fetching_send_message_finished");
1445
+ grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
1446
+ GRPC_ERROR_NONE,
1447
+ "fetching_send_message_finished");
1489
1448
  } else {
1490
- GPR_ASSERT(s->fetching_send_message == nullptr);
1491
1449
  uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(
1492
1450
  &s->flow_controlled_buffer, GRPC_HEADER_SIZE_IN_BYTES);
1493
- uint32_t flags = op_payload->send_message.send_message->flags();
1494
1451
  frame_hdr[0] = (flags & GRPC_WRITE_INTERNAL_COMPRESS) != 0;
1495
- size_t len = op_payload->send_message.send_message->length();
1452
+ size_t len = op_payload->send_message.send_message->Length();
1496
1453
  frame_hdr[1] = static_cast<uint8_t>(len >> 24);
1497
1454
  frame_hdr[2] = static_cast<uint8_t>(len >> 16);
1498
1455
  frame_hdr[3] = static_cast<uint8_t>(len >> 8);
1499
1456
  frame_hdr[4] = static_cast<uint8_t>(len);
1500
- s->fetching_send_message =
1501
- std::move(op_payload->send_message.send_message);
1502
- s->fetched_send_message_length = 0;
1457
+
1503
1458
  s->next_message_end_offset =
1504
1459
  s->flow_controlled_bytes_written +
1505
1460
  static_cast<int64_t>(s->flow_controlled_buffer.length) +
@@ -1510,8 +1465,44 @@ static void perform_stream_op_locked(void* stream_op,
1510
1465
  } else {
1511
1466
  s->write_buffering = false;
1512
1467
  }
1513
- continue_fetching_send_locked(t, s);
1514
- maybe_become_writable_due_to_send_msg(t, s);
1468
+
1469
+ grpc_slice* const slices =
1470
+ op_payload->send_message.send_message->c_slice_buffer()->slices;
1471
+ grpc_slice* const end =
1472
+ slices + op_payload->send_message.send_message->Count();
1473
+ for (grpc_slice* slice = slices; slice != end; slice++) {
1474
+ grpc_slice_buffer_add(&s->flow_controlled_buffer,
1475
+ grpc_slice_ref_internal(*slice));
1476
+ }
1477
+
1478
+ int64_t notify_offset = s->next_message_end_offset;
1479
+ if (notify_offset <= s->flow_controlled_bytes_written) {
1480
+ grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
1481
+ GRPC_ERROR_NONE,
1482
+ "fetching_send_message_finished");
1483
+ } else {
1484
+ grpc_chttp2_write_cb* cb = t->write_cb_pool;
1485
+ if (cb == nullptr) {
1486
+ cb = static_cast<grpc_chttp2_write_cb*>(gpr_malloc(sizeof(*cb)));
1487
+ } else {
1488
+ t->write_cb_pool = cb->next;
1489
+ }
1490
+ cb->call_at_byte = notify_offset;
1491
+ cb->closure = s->send_message_finished;
1492
+ s->send_message_finished = nullptr;
1493
+ grpc_chttp2_write_cb** list = flags & GRPC_WRITE_THROUGH
1494
+ ? &s->on_write_finished_cbs
1495
+ : &s->on_flow_controlled_cbs;
1496
+ cb->next = *list;
1497
+ *list = cb;
1498
+ }
1499
+
1500
+ if (s->id != 0 &&
1501
+ (!s->write_buffering ||
1502
+ s->flow_controlled_buffer.length > t->write_buffer_size)) {
1503
+ grpc_chttp2_mark_stream_writable(t, s);
1504
+ grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE);
1505
+ }
1515
1506
  }
1516
1507
  }
1517
1508
 
@@ -1565,28 +1556,14 @@ static void perform_stream_op_locked(void* stream_op,
1565
1556
 
1566
1557
  if (op->recv_message) {
1567
1558
  GRPC_STATS_INC_HTTP2_OP_RECV_MESSAGE();
1568
- size_t before = 0;
1569
1559
  GPR_ASSERT(s->recv_message_ready == nullptr);
1570
- GPR_ASSERT(!s->pending_byte_stream);
1571
1560
  s->recv_message_ready = op_payload->recv_message.recv_message_ready;
1572
1561
  s->recv_message = op_payload->recv_message.recv_message;
1562
+ s->recv_message->emplace();
1563
+ s->recv_message_flags = op_payload->recv_message.flags;
1573
1564
  s->call_failed_before_recv_message =
1574
1565
  op_payload->recv_message.call_failed_before_recv_message;
1575
- if (s->id != 0) {
1576
- if (!s->read_closed) {
1577
- before = s->frame_storage.length +
1578
- s->unprocessed_incoming_frames_buffer.length;
1579
- }
1580
- }
1581
- grpc_chttp2_maybe_complete_recv_message(t, s);
1582
- if (s->id != 0) {
1583
- if (!s->read_closed && s->frame_storage.length == 0) {
1584
- size_t after = s->unprocessed_incoming_frames_buffer_cached_length;
1585
- s->flow_control->IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES,
1586
- before - after);
1587
- grpc_chttp2_act_on_flowctl_action(s->flow_control->MakeAction(), t, s);
1588
- }
1589
- }
1566
+ grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
1590
1567
  }
1591
1568
 
1592
1569
  if (op->recv_trailing_metadata) {
@@ -1630,7 +1607,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
1630
1607
  }
1631
1608
 
1632
1609
  if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
1633
- gpr_log(GPR_INFO, "perform_stream_op[s=%p]: %s", s,
1610
+ gpr_log(GPR_INFO, "perform_stream_op[s=%p; op=%p]: %s", s, op,
1634
1611
  grpc_transport_stream_op_batch_string(op).c_str());
1635
1612
  }
1636
1613
 
@@ -1645,7 +1622,7 @@ static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error) {
1645
1622
  // callback remaining pings: they're not allowed to call into the transport,
1646
1623
  // and maybe they hold resources that need to be freed
1647
1624
  grpc_chttp2_ping_queue* pq = &t->ping_queue;
1648
- GPR_ASSERT(error != GRPC_ERROR_NONE);
1625
+ GPR_ASSERT(!GRPC_ERROR_IS_NONE(error));
1649
1626
  for (size_t j = 0; j < GRPC_CHTTP2_PCL_COUNT; j++) {
1650
1627
  grpc_closure_list_fail_all(&pq->lists[j], GRPC_ERROR_REF(error));
1651
1628
  grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &pq->lists[j]);
@@ -1655,7 +1632,7 @@ static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error) {
1655
1632
 
1656
1633
  static void send_ping_locked(grpc_chttp2_transport* t,
1657
1634
  grpc_closure* on_initiate, grpc_closure* on_ack) {
1658
- if (t->closed_with_error != GRPC_ERROR_NONE) {
1635
+ if (!GRPC_ERROR_IS_NONE(t->closed_with_error)) {
1659
1636
  grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_initiate,
1660
1637
  GRPC_ERROR_REF(t->closed_with_error));
1661
1638
  grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_ack,
@@ -1673,7 +1650,7 @@ static void send_ping_locked(grpc_chttp2_transport* t,
1673
1650
  // a ping in progress, the keepalive ping would piggyback onto that ping,
1674
1651
  // instead of waiting for that ping to complete and then starting a new ping.
1675
1652
  static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
1676
- if (t->closed_with_error != GRPC_ERROR_NONE) {
1653
+ if (!GRPC_ERROR_IS_NONE(t->closed_with_error)) {
1677
1654
  t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
1678
1655
  start_keepalive_ping_locked, t, nullptr),
1679
1656
  GRPC_ERROR_REF(t->closed_with_error));
@@ -1718,7 +1695,7 @@ void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error_handle error) {
1718
1695
  static void retry_initiate_ping_locked(void* tp, grpc_error_handle error) {
1719
1696
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
1720
1697
  t->ping_state.is_delayed_ping_timer_set = false;
1721
- if (error == GRPC_ERROR_NONE) {
1698
+ if (GRPC_ERROR_IS_NONE(error)) {
1722
1699
  grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING);
1723
1700
  }
1724
1701
  GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked");
@@ -1738,18 +1715,129 @@ void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) {
1738
1715
  }
1739
1716
  }
1740
1717
 
1741
- static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error) {
1742
- // We want to log this irrespective of whether http tracing is enabled
1743
- gpr_log(GPR_DEBUG, "%s: Sending goaway err=%s", t->peer_string.c_str(),
1744
- grpc_error_std_string(error).c_str());
1745
- t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED;
1718
+ namespace {
1719
+
1720
+ // Fire and forget (deletes itself on completion). Does a graceful shutdown by
1721
+ // sending a GOAWAY frame with the last stream id set to 2^31-1, sending a ping
1722
+ // and waiting for an ack (effective waiting for an RTT) and then sending a
1723
+ // final GOAWAY freame with an updated last stream identifier. This helps ensure
1724
+ // that a connection can be cleanly shut down without losing requests.
1725
+ // In the event, that the client does not respond to the ping for some reason,
1726
+ // we add a 20 second deadline, after which we send the second goaway.
1727
+ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
1728
+ public:
1729
+ static void Start(grpc_chttp2_transport* t) { new GracefulGoaway(t); }
1730
+
1731
+ ~GracefulGoaway() override {
1732
+ GRPC_CHTTP2_UNREF_TRANSPORT(t_, "graceful goaway");
1733
+ }
1734
+
1735
+ private:
1736
+ explicit GracefulGoaway(grpc_chttp2_transport* t) : t_(t) {
1737
+ t->sent_goaway_state = GRPC_CHTTP2_GRACEFUL_GOAWAY;
1738
+ GRPC_CHTTP2_REF_TRANSPORT(t_, "graceful goaway");
1739
+ grpc_chttp2_goaway_append((1u << 31) - 1, 0, grpc_empty_slice(), &t->qbuf);
1740
+ send_ping_locked(
1741
+ t, nullptr, GRPC_CLOSURE_INIT(&on_ping_ack_, OnPingAck, this, nullptr));
1742
+ grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
1743
+ Ref().release(); // Ref for the timer
1744
+ grpc_timer_init(
1745
+ &timer_,
1746
+ grpc_core::ExecCtx::Get()->Now() + grpc_core::Duration::Seconds(20),
1747
+ GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr));
1748
+ }
1749
+
1750
+ void MaybeSendFinalGoawayLocked() {
1751
+ if (t_->sent_goaway_state != GRPC_CHTTP2_GRACEFUL_GOAWAY) {
1752
+ // We already sent the final GOAWAY.
1753
+ return;
1754
+ }
1755
+ if (t_->destroying || !GRPC_ERROR_IS_NONE(t_->closed_with_error)) {
1756
+ GRPC_CHTTP2_IF_TRACING(gpr_log(
1757
+ GPR_INFO,
1758
+ "transport:%p %s peer:%s Transport already shutting down. "
1759
+ "Graceful GOAWAY abandoned.",
1760
+ t_, t_->is_client ? "CLIENT" : "SERVER", t_->peer_string.c_str()));
1761
+ return;
1762
+ }
1763
+ // Ping completed. Send final goaway.
1764
+ GRPC_CHTTP2_IF_TRACING(
1765
+ gpr_log(GPR_INFO,
1766
+ "transport:%p %s peer:%s Graceful shutdown: Ping received. "
1767
+ "Sending final GOAWAY with stream_id:%d",
1768
+ t_, t_->is_client ? "CLIENT" : "SERVER",
1769
+ t_->peer_string.c_str(), t_->last_new_stream_id));
1770
+ t_->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED;
1771
+ grpc_chttp2_goaway_append(t_->last_new_stream_id, 0, grpc_empty_slice(),
1772
+ &t_->qbuf);
1773
+ grpc_chttp2_initiate_write(t_, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
1774
+ }
1775
+
1776
+ static void OnPingAck(void* arg, grpc_error_handle /* error */) {
1777
+ auto* self = static_cast<GracefulGoaway*>(arg);
1778
+ self->t_->combiner->Run(
1779
+ GRPC_CLOSURE_INIT(&self->on_ping_ack_, OnPingAckLocked, self, nullptr),
1780
+ GRPC_ERROR_NONE);
1781
+ }
1782
+
1783
+ static void OnPingAckLocked(void* arg, grpc_error_handle /* error */) {
1784
+ auto* self = static_cast<GracefulGoaway*>(arg);
1785
+ grpc_timer_cancel(&self->timer_);
1786
+ self->MaybeSendFinalGoawayLocked();
1787
+ self->Unref();
1788
+ }
1789
+
1790
+ static void OnTimer(void* arg, grpc_error_handle error) {
1791
+ auto* self = static_cast<GracefulGoaway*>(arg);
1792
+ if (!GRPC_ERROR_IS_NONE(error)) {
1793
+ self->Unref();
1794
+ return;
1795
+ }
1796
+ self->t_->combiner->Run(
1797
+ GRPC_CLOSURE_INIT(&self->on_timer_, OnTimerLocked, self, nullptr),
1798
+ GRPC_ERROR_NONE);
1799
+ }
1800
+
1801
+ static void OnTimerLocked(void* arg, grpc_error_handle /* error */) {
1802
+ auto* self = static_cast<GracefulGoaway*>(arg);
1803
+ self->MaybeSendFinalGoawayLocked();
1804
+ self->Unref();
1805
+ }
1806
+
1807
+ grpc_chttp2_transport* t_;
1808
+ grpc_closure on_ping_ack_;
1809
+ grpc_timer timer_;
1810
+ grpc_closure on_timer_;
1811
+ };
1812
+
1813
+ } // namespace
1814
+
1815
+ static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error,
1816
+ bool immediate_disconnect_hint) {
1746
1817
  grpc_http2_error_code http_error;
1747
1818
  std::string message;
1748
- grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, nullptr, &message,
1749
- &http_error, nullptr);
1750
- grpc_chttp2_goaway_append(
1751
- t->last_new_stream_id, static_cast<uint32_t>(http_error),
1752
- grpc_slice_from_cpp_string(std::move(message)), &t->qbuf);
1819
+ grpc_error_get_status(error, grpc_core::Timestamp::InfFuture(), nullptr,
1820
+ &message, &http_error, nullptr);
1821
+ if (!t->is_client && http_error == GRPC_HTTP2_NO_ERROR &&
1822
+ !immediate_disconnect_hint) {
1823
+ // Do a graceful shutdown.
1824
+ if (t->sent_goaway_state == GRPC_CHTTP2_NO_GOAWAY_SEND) {
1825
+ GracefulGoaway::Start(t);
1826
+ } else {
1827
+ // Graceful GOAWAY is already in progress.
1828
+ }
1829
+ } else if (t->sent_goaway_state == GRPC_CHTTP2_NO_GOAWAY_SEND ||
1830
+ t->sent_goaway_state == GRPC_CHTTP2_GRACEFUL_GOAWAY) {
1831
+ // We want to log this irrespective of whether http tracing is enabled
1832
+ gpr_log(GPR_DEBUG, "%s: Sending goaway err=%s", t->peer_string.c_str(),
1833
+ grpc_error_std_string(error).c_str());
1834
+ t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED;
1835
+ grpc_chttp2_goaway_append(
1836
+ t->last_new_stream_id, static_cast<uint32_t>(http_error),
1837
+ grpc_slice_from_cpp_string(std::move(message)), &t->qbuf);
1838
+ } else {
1839
+ // Final GOAWAY has already been sent.
1840
+ }
1753
1841
  grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
1754
1842
  GRPC_ERROR_UNREF(error);
1755
1843
  }
@@ -1760,7 +1848,8 @@ void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) {
1760
1848
  send_goaway(t,
1761
1849
  grpc_error_set_int(
1762
1850
  GRPC_ERROR_CREATE_FROM_STATIC_STRING("too_many_pings"),
1763
- GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM));
1851
+ GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM),
1852
+ /*immediate_disconnect_hint=*/true);
1764
1853
  // The transport will be closed after the write is done
1765
1854
  close_transport_locked(
1766
1855
  t, grpc_error_set_int(
@@ -1771,7 +1860,7 @@ void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) {
1771
1860
 
1772
1861
  void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) {
1773
1862
  if (!t->is_client) {
1774
- t->ping_recv_state.last_ping_recv_time = GRPC_MILLIS_INF_PAST;
1863
+ t->ping_recv_state.last_ping_recv_time = grpc_core::Timestamp::InfPast();
1775
1864
  t->ping_recv_state.ping_strikes = 0;
1776
1865
  }
1777
1866
  t->ping_state.pings_before_data_required =
@@ -1784,8 +1873,8 @@ static void perform_transport_op_locked(void* stream_op,
1784
1873
  grpc_chttp2_transport* t =
1785
1874
  static_cast<grpc_chttp2_transport*>(op->handler_private.extra_arg);
1786
1875
 
1787
- if (op->goaway_error != GRPC_ERROR_NONE) {
1788
- send_goaway(t, op->goaway_error);
1876
+ if (!GRPC_ERROR_IS_NONE(op->goaway_error)) {
1877
+ send_goaway(t, op->goaway_error, /*immediate_disconnect_hint=*/false);
1789
1878
  }
1790
1879
 
1791
1880
  if (op->set_accept_stream) {
@@ -1814,7 +1903,9 @@ static void perform_transport_op_locked(void* stream_op,
1814
1903
  t->state_tracker.RemoveWatcher(op->stop_connectivity_watch);
1815
1904
  }
1816
1905
 
1817
- if (op->disconnect_with_error != GRPC_ERROR_NONE) {
1906
+ if (!GRPC_ERROR_IS_NONE(op->disconnect_with_error)) {
1907
+ send_goaway(t, GRPC_ERROR_REF(op->disconnect_with_error),
1908
+ /*immediate_disconnect_hint=*/true);
1818
1909
  close_transport_locked(t, op->disconnect_with_error);
1819
1910
  }
1820
1911
 
@@ -1840,101 +1931,84 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
1840
1931
  // INPUT PROCESSING - GENERAL
1841
1932
  //
1842
1933
 
1843
- void grpc_chttp2_maybe_complete_recv_initial_metadata(
1844
- grpc_chttp2_transport* /*t*/, grpc_chttp2_stream* s) {
1934
+ void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t,
1935
+ grpc_chttp2_stream* s) {
1845
1936
  if (s->recv_initial_metadata_ready != nullptr &&
1846
1937
  s->published_metadata[0] != GRPC_METADATA_NOT_PUBLISHED) {
1847
1938
  if (s->seen_error) {
1848
1939
  grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1849
- if (!s->pending_byte_stream) {
1850
- grpc_slice_buffer_reset_and_unref_internal(
1851
- &s->unprocessed_incoming_frames_buffer);
1852
- }
1853
1940
  }
1854
1941
  *s->recv_initial_metadata = std::move(s->initial_metadata_buffer);
1942
+ s->recv_initial_metadata->Set(grpc_core::PeerString(), t->peer_string);
1943
+ // If we didn't receive initial metadata from the wire and instead faked a
1944
+ // status (due to stream cancellations for example), let upper layers know
1945
+ // that trailing metadata is immediately available.
1946
+ if (s->trailing_metadata_available != nullptr &&
1947
+ s->published_metadata[0] != GRPC_METADATA_PUBLISHED_FROM_WIRE &&
1948
+ s->published_metadata[1] == GRPC_METADATA_SYNTHESIZED_FROM_FAKE) {
1949
+ *s->trailing_metadata_available = true;
1950
+ s->trailing_metadata_available = nullptr;
1951
+ }
1855
1952
  null_then_sched_closure(&s->recv_initial_metadata_ready);
1856
1953
  }
1857
1954
  }
1858
1955
 
1859
- void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* /*t*/,
1956
+ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
1860
1957
  grpc_chttp2_stream* s) {
1958
+ if (s->recv_message_ready == nullptr) return;
1959
+
1960
+ grpc_core::chttp2::StreamFlowControl::IncomingUpdateContext upd(
1961
+ &s->flow_control);
1861
1962
  grpc_error_handle error = GRPC_ERROR_NONE;
1862
- if (s->recv_message_ready != nullptr) {
1863
- *s->recv_message = nullptr;
1963
+
1964
+ // Lambda is immediately invoked as a big scoped section that can be
1965
+ // exited out of at any point by returning.
1966
+ [&]() {
1864
1967
  if (s->final_metadata_requested && s->seen_error) {
1865
1968
  grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1866
- if (!s->pending_byte_stream) {
1867
- grpc_slice_buffer_reset_and_unref_internal(
1868
- &s->unprocessed_incoming_frames_buffer);
1869
- }
1870
- }
1871
- if (!s->pending_byte_stream) {
1872
- while (s->unprocessed_incoming_frames_buffer.length > 0 ||
1873
- s->frame_storage.length > 0) {
1874
- if (s->unprocessed_incoming_frames_buffer.length == 0) {
1875
- grpc_slice_buffer_swap(&s->unprocessed_incoming_frames_buffer,
1876
- &s->frame_storage);
1877
- s->unprocessed_incoming_frames_decompressed = false;
1878
- }
1879
- if (!s->unprocessed_incoming_frames_decompressed &&
1880
- s->stream_decompression_method !=
1881
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
1882
- GPR_ASSERT(s->decompressed_data_buffer.length == 0);
1883
- bool end_of_context;
1884
- if (!s->stream_decompression_ctx) {
1885
- s->stream_decompression_ctx =
1886
- grpc_stream_compression_context_create(
1887
- s->stream_decompression_method);
1888
- }
1889
- if (!grpc_stream_decompress(
1890
- s->stream_decompression_ctx,
1891
- &s->unprocessed_incoming_frames_buffer,
1892
- &s->decompressed_data_buffer, nullptr,
1893
- GRPC_HEADER_SIZE_IN_BYTES - s->decompressed_header_bytes,
1894
- &end_of_context)) {
1895
- grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1896
- grpc_slice_buffer_reset_and_unref_internal(
1897
- &s->unprocessed_incoming_frames_buffer);
1898
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
1899
- "Stream decompression error.");
1900
- } else {
1901
- s->decompressed_header_bytes += s->decompressed_data_buffer.length;
1902
- if (s->decompressed_header_bytes == GRPC_HEADER_SIZE_IN_BYTES) {
1903
- s->decompressed_header_bytes = 0;
1969
+ s->recv_message->reset();
1970
+ } else {
1971
+ if (s->frame_storage.length != 0) {
1972
+ while (true) {
1973
+ GPR_ASSERT(s->frame_storage.length > 0);
1974
+ uint32_t min_progress_size;
1975
+ auto r = grpc_deframe_unprocessed_incoming_frames(
1976
+ s, &min_progress_size, &**s->recv_message, s->recv_message_flags);
1977
+ if (absl::holds_alternative<grpc_core::Pending>(r)) {
1978
+ if (s->read_closed) {
1979
+ grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1980
+ s->recv_message->reset();
1981
+ break;
1982
+ } else {
1983
+ upd.SetMinProgressSize(min_progress_size);
1984
+ return; // Out of lambda to enclosing function
1904
1985
  }
1905
- error = grpc_deframe_unprocessed_incoming_frames(
1906
- &s->data_parser, s, &s->decompressed_data_buffer, nullptr,
1907
- s->recv_message);
1908
- if (end_of_context) {
1909
- grpc_stream_compression_context_destroy(
1910
- s->stream_decompression_ctx);
1911
- s->stream_decompression_ctx = nullptr;
1986
+ } else {
1987
+ error = absl::get<grpc_error_handle>(r);
1988
+ if (!GRPC_ERROR_IS_NONE(error)) {
1989
+ s->seen_error = true;
1990
+ grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1991
+ break;
1992
+ } else {
1993
+ if (t->channelz_socket != nullptr) {
1994
+ t->channelz_socket->RecordMessageReceived();
1995
+ }
1996
+ break;
1912
1997
  }
1913
1998
  }
1914
- } else {
1915
- error = grpc_deframe_unprocessed_incoming_frames(
1916
- &s->data_parser, s, &s->unprocessed_incoming_frames_buffer,
1917
- nullptr, s->recv_message);
1918
- }
1919
- if (error != GRPC_ERROR_NONE) {
1920
- s->seen_error = true;
1921
- grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1922
- grpc_slice_buffer_reset_and_unref_internal(
1923
- &s->unprocessed_incoming_frames_buffer);
1924
- break;
1925
- } else if (*s->recv_message != nullptr) {
1926
- break;
1927
1999
  }
2000
+ } else if (s->read_closed) {
2001
+ s->recv_message->reset();
2002
+ } else {
2003
+ upd.SetMinProgressSize(GRPC_HEADER_SIZE_IN_BYTES);
2004
+ return; // Out of lambda to enclosing function
1928
2005
  }
1929
2006
  }
1930
2007
  // save the length of the buffer before handing control back to application
1931
2008
  // threads. Needed to support correct flow control bookkeeping
1932
- s->unprocessed_incoming_frames_buffer_cached_length =
1933
- s->unprocessed_incoming_frames_buffer.length;
1934
- if (error == GRPC_ERROR_NONE && *s->recv_message != nullptr) {
2009
+ if (GRPC_ERROR_IS_NONE(error) && s->recv_message->has_value()) {
1935
2010
  null_then_sched_closure(&s->recv_message_ready);
1936
2011
  } else if (s->published_metadata[1] != GRPC_METADATA_NOT_PUBLISHED) {
1937
- *s->recv_message = nullptr;
1938
2012
  if (s->call_failed_before_recv_message != nullptr) {
1939
2013
  *s->call_failed_before_recv_message =
1940
2014
  (s->published_metadata[1] != GRPC_METADATA_PUBLISHED_AT_CLOSE);
@@ -1942,7 +2016,10 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* /*t*/,
1942
2016
  null_then_sched_closure(&s->recv_message_ready);
1943
2017
  }
1944
2018
  GRPC_ERROR_UNREF(error);
1945
- }
2019
+ }();
2020
+
2021
+ upd.SetPendingSize(s->frame_storage.length);
2022
+ grpc_chttp2_act_on_flowctl_action(upd.MakeAction(), t, s);
1946
2023
  }
1947
2024
 
1948
2025
  void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
@@ -1952,60 +2029,13 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
1952
2029
  s->write_closed) {
1953
2030
  if (s->seen_error || !t->is_client) {
1954
2031
  grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1955
- if (!s->pending_byte_stream) {
1956
- grpc_slice_buffer_reset_and_unref_internal(
1957
- &s->unprocessed_incoming_frames_buffer);
1958
- }
1959
- }
1960
- bool pending_data = s->pending_byte_stream ||
1961
- s->unprocessed_incoming_frames_buffer.length > 0;
1962
- if (s->read_closed && s->frame_storage.length > 0 && !pending_data &&
1963
- !s->seen_error && s->recv_trailing_metadata_finished != nullptr) {
1964
- // Maybe some SYNC_FLUSH data is left in frame_storage. Consume them and
1965
- // maybe decompress the next 5 bytes in the stream.
1966
- if (s->stream_decompression_method ==
1967
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
1968
- grpc_slice_buffer_move_first(
1969
- &s->frame_storage,
1970
- std::min(s->frame_storage.length,
1971
- size_t(GRPC_HEADER_SIZE_IN_BYTES)),
1972
- &s->unprocessed_incoming_frames_buffer);
1973
- if (s->unprocessed_incoming_frames_buffer.length > 0) {
1974
- s->unprocessed_incoming_frames_decompressed = true;
1975
- pending_data = true;
1976
- }
1977
- } else {
1978
- bool end_of_context;
1979
- if (!s->stream_decompression_ctx) {
1980
- s->stream_decompression_ctx = grpc_stream_compression_context_create(
1981
- s->stream_decompression_method);
1982
- }
1983
- if (!grpc_stream_decompress(
1984
- s->stream_decompression_ctx, &s->frame_storage,
1985
- &s->unprocessed_incoming_frames_buffer, nullptr,
1986
- GRPC_HEADER_SIZE_IN_BYTES, &end_of_context)) {
1987
- grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
1988
- grpc_slice_buffer_reset_and_unref_internal(
1989
- &s->unprocessed_incoming_frames_buffer);
1990
- s->seen_error = true;
1991
- } else {
1992
- if (s->unprocessed_incoming_frames_buffer.length > 0) {
1993
- s->unprocessed_incoming_frames_decompressed = true;
1994
- pending_data = true;
1995
- }
1996
- if (end_of_context) {
1997
- grpc_stream_compression_context_destroy(
1998
- s->stream_decompression_ctx);
1999
- s->stream_decompression_ctx = nullptr;
2000
- }
2001
- }
2002
- }
2003
2032
  }
2004
- if (s->read_closed && s->frame_storage.length == 0 && !pending_data &&
2033
+ if (s->read_closed && s->frame_storage.length == 0 &&
2005
2034
  s->recv_trailing_metadata_finished != nullptr) {
2006
2035
  grpc_transport_move_stats(&s->stats, s->collecting_stats);
2007
2036
  s->collecting_stats = nullptr;
2008
2037
  *s->recv_trailing_metadata = std::move(s->trailing_metadata_buffer);
2038
+ s->recv_trailing_metadata->Set(grpc_core::PeerString(), t->peer_string);
2009
2039
  null_then_sched_closure(&s->recv_trailing_metadata_finished);
2010
2040
  }
2011
2041
  }
@@ -2020,24 +2050,10 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
2020
2050
  t->incoming_stream = nullptr;
2021
2051
  grpc_chttp2_parsing_become_skip_parser(t);
2022
2052
  }
2023
- if (s->pending_byte_stream) {
2024
- if (s->on_next != nullptr) {
2025
- grpc_core::Chttp2IncomingByteStream* bs = s->data_parser.parsing_frame;
2026
- if (error == GRPC_ERROR_NONE) {
2027
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
2028
- }
2029
- bs->PublishError(error);
2030
- bs->Unref();
2031
- s->data_parser.parsing_frame = nullptr;
2032
- } else {
2033
- GRPC_ERROR_UNREF(s->byte_stream_error);
2034
- s->byte_stream_error = GRPC_ERROR_REF(error);
2035
- }
2036
- }
2037
2053
 
2038
2054
  if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
2039
2055
  post_benign_reclaimer(t);
2040
- if (t->sent_goaway_state == GRPC_CHTTP2_GOAWAY_SENT) {
2056
+ if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SENT) {
2041
2057
  close_transport_locked(
2042
2058
  t, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
2043
2059
  "Last stream closed after sending GOAWAY", &error, 1));
@@ -2072,7 +2088,7 @@ void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
2072
2088
  grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM);
2073
2089
  }
2074
2090
  }
2075
- if (due_to_error != GRPC_ERROR_NONE && !s->seen_error) {
2091
+ if (!GRPC_ERROR_IS_NONE(due_to_error) && !s->seen_error) {
2076
2092
  s->seen_error = true;
2077
2093
  }
2078
2094
  grpc_chttp2_mark_stream_closed(t, s, 1, 1, due_to_error);
@@ -2095,12 +2111,7 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
2095
2111
  // about the metadata yet
2096
2112
  if (s->published_metadata[1] == GRPC_METADATA_NOT_PUBLISHED ||
2097
2113
  s->recv_trailing_metadata_finished != nullptr) {
2098
- char status_string[GPR_LTOA_MIN_BUFSIZE];
2099
- gpr_ltoa(status, status_string);
2100
- GRPC_LOG_IF_ERROR("add_status",
2101
- s->trailing_metadata_buffer.ReplaceOrAppend(
2102
- GRPC_MDSTR_GRPC_STATUS,
2103
- grpc_core::UnmanagedMemorySlice(status_string)));
2114
+ s->trailing_metadata_buffer.Set(grpc_core::GrpcStatusMetadata(), status);
2104
2115
  if (!message.empty()) {
2105
2116
  s->trailing_metadata_buffer.Set(
2106
2117
  grpc_core::GrpcMessageMetadata(),
@@ -2115,7 +2126,7 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
2115
2126
 
2116
2127
  static void add_error(grpc_error_handle error, grpc_error_handle* refs,
2117
2128
  size_t* nrefs) {
2118
- if (error == GRPC_ERROR_NONE) return;
2129
+ if (GRPC_ERROR_IS_NONE(error)) return;
2119
2130
  for (size_t i = 0; i < *nrefs; i++) {
2120
2131
  if (error == refs[i]) {
2121
2132
  return;
@@ -2172,8 +2183,7 @@ void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
2172
2183
  GRPC_ERROR_REF(error),
2173
2184
  "send_trailing_metadata_finished");
2174
2185
 
2175
- s->fetching_send_message.reset();
2176
- grpc_chttp2_complete_closure_step(t, s, &s->fetching_send_message_finished,
2186
+ grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
2177
2187
  GRPC_ERROR_REF(error),
2178
2188
  "fetching_send_message_finished");
2179
2189
  flush_write_list(t, s, &s->on_write_finished_cbs, GRPC_ERROR_REF(error));
@@ -2186,7 +2196,7 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
2186
2196
  if (s->read_closed && s->write_closed) {
2187
2197
  // already closed, but we should still fake the status if needed.
2188
2198
  grpc_error_handle overall_error = removal_error(error, s, "Stream removed");
2189
- if (overall_error != GRPC_ERROR_NONE) {
2199
+ if (!GRPC_ERROR_IS_NONE(overall_error)) {
2190
2200
  grpc_chttp2_fake_status(t, s, overall_error);
2191
2201
  }
2192
2202
  grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
@@ -2214,7 +2224,7 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
2214
2224
  // Purge streams waiting on concurrency still waiting for id assignment
2215
2225
  grpc_chttp2_list_remove_waiting_for_concurrency(t, s);
2216
2226
  }
2217
- if (overall_error != GRPC_ERROR_NONE) {
2227
+ if (!GRPC_ERROR_IS_NONE(overall_error)) {
2218
2228
  grpc_chttp2_fake_status(t, s, overall_error);
2219
2229
  }
2220
2230
  }
@@ -2413,6 +2423,7 @@ static void end_all_the_calls(grpc_chttp2_transport* t,
2413
2423
  error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
2414
2424
  GRPC_STATUS_UNAVAILABLE);
2415
2425
  }
2426
+ cancel_unstarted_streams(t, GRPC_ERROR_REF(error));
2416
2427
  cancel_stream_cb_args args = {error, t};
2417
2428
  grpc_chttp2_stream_map_for_each(&t->stream_map, cancel_stream_cb, &args);
2418
2429
  GRPC_ERROR_UNREF(error);
@@ -2442,8 +2453,11 @@ void grpc_chttp2_act_on_flowctl_action(
2442
2453
  const grpc_core::chttp2::FlowControlAction& action,
2443
2454
  grpc_chttp2_transport* t, grpc_chttp2_stream* s) {
2444
2455
  WithUrgency(t, action.send_stream_update(),
2445
- GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL,
2446
- [t, s]() { grpc_chttp2_mark_stream_writable(t, s); });
2456
+ GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL, [t, s]() {
2457
+ if (s->id != 0) {
2458
+ grpc_chttp2_mark_stream_writable(t, s);
2459
+ }
2460
+ });
2447
2461
  WithUrgency(t, action.send_transport_update(),
2448
2462
  GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL, []() {});
2449
2463
  WithUrgency(t, action.send_initial_window_update(),
@@ -2468,11 +2482,11 @@ static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) {
2468
2482
  grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
2469
2483
 
2470
2484
  grpc_error_handle parse_error = GRPC_ERROR_NONE;
2471
- for (; i < t->read_buffer.count && parse_error == GRPC_ERROR_NONE; i++) {
2485
+ for (; i < t->read_buffer.count && GRPC_ERROR_IS_NONE(parse_error); i++) {
2472
2486
  parse_error =
2473
2487
  grpc_http_parser_parse(&parser, t->read_buffer.slices[i], nullptr);
2474
2488
  }
2475
- if (parse_error == GRPC_ERROR_NONE &&
2489
+ if (GRPC_ERROR_IS_NONE(parse_error) &&
2476
2490
  (parse_error = grpc_http_parser_eof(&parser)) == GRPC_ERROR_NONE) {
2477
2491
  error = grpc_error_set_int(
2478
2492
  grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -2503,7 +2517,7 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
2503
2517
  (void)GRPC_ERROR_REF(error);
2504
2518
 
2505
2519
  grpc_error_handle err = error;
2506
- if (err != GRPC_ERROR_NONE) {
2520
+ if (!GRPC_ERROR_IS_NONE(err)) {
2507
2521
  err = grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
2508
2522
  "Endpoint read failed", &err, 1),
2509
2523
  GRPC_ERROR_INT_OCCURRED_DURING_WRITE,
@@ -2511,7 +2525,7 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
2511
2525
  }
2512
2526
  std::swap(err, error);
2513
2527
  GRPC_ERROR_UNREF(err);
2514
- if (t->closed_with_error == GRPC_ERROR_NONE) {
2528
+ if (GRPC_ERROR_IS_NONE(t->closed_with_error)) {
2515
2529
  GPR_TIMER_SCOPE("reading_action.parse", 0);
2516
2530
  size_t i = 0;
2517
2531
  grpc_error_handle errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
@@ -2545,20 +2559,20 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
2545
2559
 
2546
2560
  GPR_TIMER_SCOPE("post_reading_action_locked", 0);
2547
2561
  bool keep_reading = false;
2548
- if (error == GRPC_ERROR_NONE && t->closed_with_error != GRPC_ERROR_NONE) {
2562
+ if (GRPC_ERROR_IS_NONE(error) && !GRPC_ERROR_IS_NONE(t->closed_with_error)) {
2549
2563
  error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
2550
2564
  "Transport closed", &t->closed_with_error, 1);
2551
2565
  }
2552
- if (error != GRPC_ERROR_NONE) {
2566
+ if (!GRPC_ERROR_IS_NONE(error)) {
2553
2567
  // If a goaway frame was received, this might be the reason why the read
2554
2568
  // failed. Add this info to the error
2555
- if (t->goaway_error != GRPC_ERROR_NONE) {
2569
+ if (!GRPC_ERROR_IS_NONE(t->goaway_error)) {
2556
2570
  error = grpc_error_add_child(error, GRPC_ERROR_REF(t->goaway_error));
2557
2571
  }
2558
2572
 
2559
2573
  close_transport_locked(t, GRPC_ERROR_REF(error));
2560
2574
  t->endpoint_reading = 0;
2561
- } else if (t->closed_with_error == GRPC_ERROR_NONE) {
2575
+ } else if (GRPC_ERROR_IS_NONE(t->closed_with_error)) {
2562
2576
  keep_reading = true;
2563
2577
  // Since we have read a byte, reset the keepalive timer
2564
2578
  if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
@@ -2586,17 +2600,17 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
2586
2600
  }
2587
2601
 
2588
2602
  static void continue_read_action_locked(grpc_chttp2_transport* t) {
2589
- const bool urgent = t->goaway_error != GRPC_ERROR_NONE;
2603
+ const bool urgent = !GRPC_ERROR_IS_NONE(t->goaway_error);
2590
2604
  GRPC_CLOSURE_INIT(&t->read_action_locked, read_action, t,
2591
2605
  grpc_schedule_on_exec_ctx);
2592
- grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent);
2593
- grpc_chttp2_act_on_flowctl_action(t->flow_control->MakeAction(), t, nullptr);
2606
+ grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent,
2607
+ /*min_progress_size=*/1);
2594
2608
  }
2595
2609
 
2596
2610
  // t is reffed prior to calling the first time, and once the callback chain
2597
2611
  // that kicks off finishes, it's unreffed
2598
2612
  void schedule_bdp_ping_locked(grpc_chttp2_transport* t) {
2599
- t->flow_control->bdp_estimator()->SchedulePing();
2613
+ t->flow_control.bdp_estimator()->SchedulePing();
2600
2614
  send_ping_locked(
2601
2615
  t,
2602
2616
  GRPC_CLOSURE_INIT(&t->start_bdp_ping_locked, start_bdp_ping, t,
@@ -2619,14 +2633,14 @@ static void start_bdp_ping_locked(void* tp, grpc_error_handle error) {
2619
2633
  gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string.c_str(),
2620
2634
  grpc_error_std_string(error).c_str());
2621
2635
  }
2622
- if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
2636
+ if (!GRPC_ERROR_IS_NONE(error) || !GRPC_ERROR_IS_NONE(t->closed_with_error)) {
2623
2637
  return;
2624
2638
  }
2625
2639
  // Reset the keepalive ping timer
2626
2640
  if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
2627
2641
  grpc_timer_cancel(&t->keepalive_ping_timer);
2628
2642
  }
2629
- t->flow_control->bdp_estimator()->StartPing();
2643
+ t->flow_control.bdp_estimator()->StartPing();
2630
2644
  t->bdp_ping_started = true;
2631
2645
  }
2632
2646
 
@@ -2643,7 +2657,7 @@ static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
2643
2657
  gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string.c_str(),
2644
2658
  grpc_error_std_string(error).c_str());
2645
2659
  }
2646
- if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
2660
+ if (!GRPC_ERROR_IS_NONE(error) || !GRPC_ERROR_IS_NONE(t->closed_with_error)) {
2647
2661
  GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
2648
2662
  return;
2649
2663
  }
@@ -2656,8 +2670,9 @@ static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
2656
2670
  return;
2657
2671
  }
2658
2672
  t->bdp_ping_started = false;
2659
- grpc_millis next_ping = t->flow_control->bdp_estimator()->CompletePing();
2660
- grpc_chttp2_act_on_flowctl_action(t->flow_control->PeriodicUpdate(), t,
2673
+ grpc_core::Timestamp next_ping =
2674
+ t->flow_control.bdp_estimator()->CompletePing();
2675
+ grpc_chttp2_act_on_flowctl_action(t->flow_control.PeriodicUpdate(), t,
2661
2676
  nullptr);
2662
2677
  GPR_ASSERT(!t->have_next_bdp_ping_timer);
2663
2678
  t->have_next_bdp_ping_timer = true;
@@ -2680,11 +2695,11 @@ static void next_bdp_ping_timer_expired_locked(void* tp,
2680
2695
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
2681
2696
  GPR_ASSERT(t->have_next_bdp_ping_timer);
2682
2697
  t->have_next_bdp_ping_timer = false;
2683
- if (error != GRPC_ERROR_NONE) {
2698
+ if (!GRPC_ERROR_IS_NONE(error)) {
2684
2699
  GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
2685
2700
  return;
2686
2701
  }
2687
- if (t->flow_control->bdp_estimator()->accumulator() == 0) {
2702
+ if (t->flow_control.bdp_estimator()->accumulator() == 0) {
2688
2703
  // Block the bdp ping till we receive more data.
2689
2704
  t->bdp_ping_blocked = true;
2690
2705
  GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
@@ -2762,9 +2777,9 @@ static void init_keepalive_ping(void* arg, grpc_error_handle error) {
2762
2777
  static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
2763
2778
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
2764
2779
  GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING);
2765
- if (t->destroying || t->closed_with_error != GRPC_ERROR_NONE) {
2780
+ if (t->destroying || !GRPC_ERROR_IS_NONE(t->closed_with_error)) {
2766
2781
  t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
2767
- } else if (error == GRPC_ERROR_NONE) {
2782
+ } else if (GRPC_ERROR_IS_NONE(error)) {
2768
2783
  if (t->keepalive_permit_without_calls ||
2769
2784
  grpc_chttp2_stream_map_size(&t->stream_map) > 0) {
2770
2785
  t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_PINGING;
@@ -2801,7 +2816,7 @@ static void start_keepalive_ping(void* arg, grpc_error_handle error) {
2801
2816
 
2802
2817
  static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) {
2803
2818
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
2804
- if (error != GRPC_ERROR_NONE) {
2819
+ if (!GRPC_ERROR_IS_NONE(error)) {
2805
2820
  return;
2806
2821
  }
2807
2822
  if (t->channelz_socket != nullptr) {
@@ -2830,7 +2845,7 @@ static void finish_keepalive_ping(void* arg, grpc_error_handle error) {
2830
2845
  static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
2831
2846
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
2832
2847
  if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
2833
- if (error == GRPC_ERROR_NONE) {
2848
+ if (GRPC_ERROR_IS_NONE(error)) {
2834
2849
  if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
2835
2850
  GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
2836
2851
  gpr_log(GPR_INFO, "%s: Finish keepalive ping", t->peer_string.c_str());
@@ -2870,7 +2885,7 @@ static void keepalive_watchdog_fired_locked(void* arg,
2870
2885
  grpc_error_handle error) {
2871
2886
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
2872
2887
  if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
2873
- if (error == GRPC_ERROR_NONE) {
2888
+ if (GRPC_ERROR_IS_NONE(error)) {
2874
2889
  gpr_log(GPR_INFO, "%s: Keepalive watchdog fired. Closing transport.",
2875
2890
  t->peer_string.c_str());
2876
2891
  t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
@@ -2920,223 +2935,6 @@ static void set_pollset_set(grpc_transport* gt, grpc_stream* /*gs*/,
2920
2935
  grpc_endpoint_add_to_pollset_set(t->ep, pollset_set);
2921
2936
  }
2922
2937
 
2923
- //
2924
- // BYTE STREAM
2925
- //
2926
-
2927
- static void reset_byte_stream(void* arg, grpc_error_handle error) {
2928
- grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(arg);
2929
- s->pending_byte_stream = false;
2930
- if (error == GRPC_ERROR_NONE) {
2931
- grpc_chttp2_maybe_complete_recv_message(s->t, s);
2932
- grpc_chttp2_maybe_complete_recv_trailing_metadata(s->t, s);
2933
- } else {
2934
- GPR_ASSERT(error != GRPC_ERROR_NONE);
2935
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->on_next, GRPC_ERROR_REF(error));
2936
- s->on_next = nullptr;
2937
- GRPC_ERROR_UNREF(s->byte_stream_error);
2938
- s->byte_stream_error = GRPC_ERROR_NONE;
2939
- grpc_chttp2_cancel_stream(s->t, s, GRPC_ERROR_REF(error));
2940
- s->byte_stream_error = GRPC_ERROR_REF(error);
2941
- }
2942
- }
2943
-
2944
- namespace grpc_core {
2945
-
2946
- Chttp2IncomingByteStream::Chttp2IncomingByteStream(
2947
- grpc_chttp2_transport* transport, grpc_chttp2_stream* stream,
2948
- uint32_t frame_size, uint32_t flags)
2949
- : ByteStream(frame_size, flags),
2950
- transport_(transport),
2951
- stream_(stream),
2952
- refs_(2),
2953
- remaining_bytes_(frame_size) {
2954
- GRPC_ERROR_UNREF(stream->byte_stream_error);
2955
- stream->byte_stream_error = GRPC_ERROR_NONE;
2956
- }
2957
-
2958
- void Chttp2IncomingByteStream::OrphanLocked(
2959
- void* arg, grpc_error_handle /*error_ignored*/) {
2960
- Chttp2IncomingByteStream* bs = static_cast<Chttp2IncomingByteStream*>(arg);
2961
- grpc_chttp2_stream* s = bs->stream_;
2962
- grpc_chttp2_transport* t = s->t;
2963
- bs->Unref();
2964
- s->pending_byte_stream = false;
2965
- grpc_chttp2_maybe_complete_recv_message(t, s);
2966
- grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
2967
- }
2968
-
2969
- void Chttp2IncomingByteStream::Orphan() {
2970
- GPR_TIMER_SCOPE("incoming_byte_stream_destroy", 0);
2971
- transport_->combiner->Run(
2972
- GRPC_CLOSURE_INIT(&destroy_action_,
2973
- &Chttp2IncomingByteStream::OrphanLocked, this, nullptr),
2974
- GRPC_ERROR_NONE);
2975
- }
2976
-
2977
- void Chttp2IncomingByteStream::NextLocked(void* arg,
2978
- grpc_error_handle /*error_ignored*/) {
2979
- Chttp2IncomingByteStream* bs = static_cast<Chttp2IncomingByteStream*>(arg);
2980
- grpc_chttp2_transport* t = bs->transport_;
2981
- grpc_chttp2_stream* s = bs->stream_;
2982
- size_t cur_length = s->frame_storage.length;
2983
- if (!s->read_closed) {
2984
- s->flow_control->IncomingByteStreamUpdate(bs->next_action_.max_size_hint,
2985
- cur_length);
2986
- grpc_chttp2_act_on_flowctl_action(s->flow_control->MakeAction(), t, s);
2987
- }
2988
- GPR_ASSERT(s->unprocessed_incoming_frames_buffer.length == 0);
2989
- if (s->frame_storage.length > 0) {
2990
- grpc_slice_buffer_swap(&s->frame_storage,
2991
- &s->unprocessed_incoming_frames_buffer);
2992
- s->unprocessed_incoming_frames_decompressed = false;
2993
- ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, GRPC_ERROR_NONE);
2994
- } else if (s->byte_stream_error != GRPC_ERROR_NONE) {
2995
- ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
2996
- GRPC_ERROR_REF(s->byte_stream_error));
2997
- if (s->data_parser.parsing_frame != nullptr) {
2998
- s->data_parser.parsing_frame->Unref();
2999
- s->data_parser.parsing_frame = nullptr;
3000
- }
3001
- } else if (s->read_closed) {
3002
- if (bs->remaining_bytes_ != 0) {
3003
- s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
3004
- "Truncated message", &s->read_closed_error, 1);
3005
- ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
3006
- GRPC_ERROR_REF(s->byte_stream_error));
3007
- if (s->data_parser.parsing_frame != nullptr) {
3008
- s->data_parser.parsing_frame->Unref();
3009
- s->data_parser.parsing_frame = nullptr;
3010
- }
3011
- } else {
3012
- // Should never reach here.
3013
- GPR_ASSERT(false);
3014
- }
3015
- } else {
3016
- s->on_next = bs->next_action_.on_complete;
3017
- }
3018
- bs->Unref();
3019
- }
3020
-
3021
- bool Chttp2IncomingByteStream::Next(size_t max_size_hint,
3022
- grpc_closure* on_complete) {
3023
- GPR_TIMER_SCOPE("incoming_byte_stream_next", 0);
3024
- if (stream_->unprocessed_incoming_frames_buffer.length > 0) {
3025
- return true;
3026
- } else {
3027
- Ref();
3028
- next_action_.max_size_hint = max_size_hint;
3029
- next_action_.on_complete = on_complete;
3030
- transport_->combiner->Run(
3031
- GRPC_CLOSURE_INIT(&next_action_.closure,
3032
- &Chttp2IncomingByteStream::NextLocked, this, nullptr),
3033
- GRPC_ERROR_NONE);
3034
- return false;
3035
- }
3036
- }
3037
-
3038
- void Chttp2IncomingByteStream::MaybeCreateStreamDecompressionCtx() {
3039
- GPR_DEBUG_ASSERT(stream_->stream_decompression_method !=
3040
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS);
3041
- if (!stream_->stream_decompression_ctx) {
3042
- stream_->stream_decompression_ctx = grpc_stream_compression_context_create(
3043
- stream_->stream_decompression_method);
3044
- }
3045
- }
3046
-
3047
- grpc_error_handle Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
3048
- GPR_TIMER_SCOPE("incoming_byte_stream_pull", 0);
3049
- grpc_error_handle error;
3050
- if (stream_->unprocessed_incoming_frames_buffer.length > 0) {
3051
- if (!stream_->unprocessed_incoming_frames_decompressed &&
3052
- stream_->stream_decompression_method !=
3053
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
3054
- bool end_of_context;
3055
- MaybeCreateStreamDecompressionCtx();
3056
- if (!grpc_stream_decompress(stream_->stream_decompression_ctx,
3057
- &stream_->unprocessed_incoming_frames_buffer,
3058
- &stream_->decompressed_data_buffer, nullptr,
3059
- MAX_SIZE_T, &end_of_context)) {
3060
- error =
3061
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Stream decompression error.");
3062
- return error;
3063
- }
3064
- GPR_ASSERT(stream_->unprocessed_incoming_frames_buffer.length == 0);
3065
- grpc_slice_buffer_swap(&stream_->unprocessed_incoming_frames_buffer,
3066
- &stream_->decompressed_data_buffer);
3067
- stream_->unprocessed_incoming_frames_decompressed = true;
3068
- if (end_of_context) {
3069
- grpc_stream_compression_context_destroy(
3070
- stream_->stream_decompression_ctx);
3071
- stream_->stream_decompression_ctx = nullptr;
3072
- }
3073
- if (stream_->unprocessed_incoming_frames_buffer.length == 0) {
3074
- *slice = grpc_empty_slice();
3075
- }
3076
- }
3077
- error = grpc_deframe_unprocessed_incoming_frames(
3078
- &stream_->data_parser, stream_,
3079
- &stream_->unprocessed_incoming_frames_buffer, slice, nullptr);
3080
- if (error != GRPC_ERROR_NONE) {
3081
- return error;
3082
- }
3083
- } else {
3084
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
3085
- stream_->t->combiner->Run(&stream_->reset_byte_stream,
3086
- GRPC_ERROR_REF(error));
3087
- return error;
3088
- }
3089
- return GRPC_ERROR_NONE;
3090
- }
3091
-
3092
- void Chttp2IncomingByteStream::PublishError(grpc_error_handle error) {
3093
- GPR_ASSERT(error != GRPC_ERROR_NONE);
3094
- ExecCtx::Run(DEBUG_LOCATION, stream_->on_next, GRPC_ERROR_REF(error));
3095
- stream_->on_next = nullptr;
3096
- GRPC_ERROR_UNREF(stream_->byte_stream_error);
3097
- stream_->byte_stream_error = GRPC_ERROR_REF(error);
3098
- grpc_chttp2_cancel_stream(transport_, stream_, GRPC_ERROR_REF(error));
3099
- }
3100
-
3101
- grpc_error_handle Chttp2IncomingByteStream::Push(const grpc_slice& slice,
3102
- grpc_slice* slice_out) {
3103
- if (remaining_bytes_ < GRPC_SLICE_LENGTH(slice)) {
3104
- grpc_error_handle error =
3105
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many bytes in stream");
3106
- transport_->combiner->Run(&stream_->reset_byte_stream,
3107
- GRPC_ERROR_REF(error));
3108
- grpc_slice_unref_internal(slice);
3109
- return error;
3110
- } else {
3111
- remaining_bytes_ -= static_cast<uint32_t> GRPC_SLICE_LENGTH(slice);
3112
- if (slice_out != nullptr) {
3113
- *slice_out = slice;
3114
- }
3115
- return GRPC_ERROR_NONE;
3116
- }
3117
- }
3118
-
3119
- grpc_error_handle Chttp2IncomingByteStream::Finished(grpc_error_handle error,
3120
- bool reset_on_error) {
3121
- if (error == GRPC_ERROR_NONE) {
3122
- if (remaining_bytes_ != 0) {
3123
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
3124
- }
3125
- }
3126
- if (error != GRPC_ERROR_NONE && reset_on_error) {
3127
- transport_->combiner->Run(&stream_->reset_byte_stream,
3128
- GRPC_ERROR_REF(error));
3129
- }
3130
- Unref();
3131
- return error;
3132
- }
3133
-
3134
- void Chttp2IncomingByteStream::Shutdown(grpc_error_handle error) {
3135
- GRPC_ERROR_UNREF(Finished(error, true /* reset_on_error */));
3136
- }
3137
-
3138
- } // namespace grpc_core
3139
-
3140
2938
  //
3141
2939
  // RESOURCE QUOTAS
3142
2940
  //
@@ -3183,7 +2981,7 @@ static void post_destructive_reclaimer(grpc_chttp2_transport* t) {
3183
2981
 
3184
2982
  static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
3185
2983
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
3186
- if (error == GRPC_ERROR_NONE &&
2984
+ if (GRPC_ERROR_IS_NONE(error) &&
3187
2985
  grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
3188
2986
  // Channel with no active streams: send a goaway to try and make it
3189
2987
  // disconnect cleanly
@@ -3194,8 +2992,9 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
3194
2992
  send_goaway(t,
3195
2993
  grpc_error_set_int(
3196
2994
  GRPC_ERROR_CREATE_FROM_STATIC_STRING("Buffers full"),
3197
- GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM));
3198
- } else if (error == GRPC_ERROR_NONE &&
2995
+ GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM),
2996
+ /*immediate_disconnect_hint=*/true);
2997
+ } else if (GRPC_ERROR_IS_NONE(error) &&
3199
2998
  GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
3200
2999
  gpr_log(GPR_INFO,
3201
3000
  "HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR
@@ -3214,7 +3013,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
3214
3013
  grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
3215
3014
  size_t n = grpc_chttp2_stream_map_size(&t->stream_map);
3216
3015
  t->destructive_reclaimer_registered = false;
3217
- if (error == GRPC_ERROR_NONE && n > 0) {
3016
+ if (GRPC_ERROR_IS_NONE(error) && n > 0) {
3218
3017
  grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(
3219
3018
  grpc_chttp2_stream_map_rand(&t->stream_map));
3220
3019
  if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
@@ -3273,6 +3072,8 @@ const char* grpc_chttp2_initiate_write_reason_string(
3273
3072
  return "TRANSPORT_FLOW_CONTROL";
3274
3073
  case GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS:
3275
3074
  return "SEND_SETTINGS";
3075
+ case GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK:
3076
+ return "SETTINGS_ACK";
3276
3077
  case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING:
3277
3078
  return "FLOW_CONTROL_UNSTALLED_BY_SETTING";
3278
3079
  case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_UPDATE:
@@ -3300,6 +3101,7 @@ static grpc_endpoint* chttp2_get_endpoint(grpc_transport* t) {
3300
3101
  static const grpc_transport_vtable vtable = {sizeof(grpc_chttp2_stream),
3301
3102
  "chttp2",
3302
3103
  init_stream,
3104
+ nullptr,
3303
3105
  set_pollset,
3304
3106
  set_pollset_set,
3305
3107
  perform_stream_op,