grpc 1.38.0 → 1.40.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 (340) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +68 -21
  3. data/include/grpc/event_engine/endpoint_config.h +48 -0
  4. data/include/grpc/event_engine/event_engine.h +23 -29
  5. data/include/grpc/event_engine/port.h +2 -0
  6. data/include/grpc/event_engine/slice_allocator.h +21 -36
  7. data/include/grpc/grpc.h +9 -2
  8. data/include/grpc/grpc_security.h +32 -0
  9. data/include/grpc/grpc_security_constants.h +1 -0
  10. data/include/grpc/impl/codegen/grpc_types.h +33 -19
  11. data/include/grpc/impl/codegen/port_platform.h +41 -0
  12. data/src/core/ext/filters/client_channel/client_channel.cc +415 -249
  13. data/src/core/ext/filters/client_channel/client_channel.h +42 -18
  14. data/src/core/ext/filters/client_channel/config_selector.h +19 -6
  15. data/src/core/ext/filters/client_channel/health/health_check_client.cc +2 -0
  16. data/src/core/ext/filters/client_channel/health/health_check_client.h +3 -3
  17. data/src/core/ext/filters/client_channel/http_proxy.cc +16 -1
  18. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +7 -8
  19. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +12 -21
  20. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +3 -5
  21. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +734 -0
  22. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +10 -0
  23. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +8 -15
  24. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +3 -6
  25. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +18 -36
  26. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +14 -22
  27. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +2 -9
  28. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +68 -103
  29. data/src/core/ext/filters/client_channel/lb_policy.cc +1 -15
  30. data/src/core/ext/filters/client_channel/lb_policy.h +70 -46
  31. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -3
  32. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +31 -0
  33. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc +28 -0
  34. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -3
  35. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +7 -2
  36. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +116 -76
  37. data/src/core/ext/filters/client_channel/retry_filter.cc +967 -544
  38. data/src/core/ext/filters/client_channel/retry_service_config.cc +57 -28
  39. data/src/core/ext/filters/client_channel/retry_service_config.h +9 -3
  40. data/src/core/ext/filters/client_channel/service_config_call_data.h +45 -5
  41. data/src/core/ext/filters/client_idle/client_idle_filter.cc +1 -1
  42. data/src/core/ext/filters/http/client/http_client_filter.cc +5 -2
  43. data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +2 -1
  44. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +5 -1
  45. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +3 -2
  46. data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +1 -1
  47. data/src/core/{lib/event_engine/slice_allocator.cc → ext/transport/chttp2/transport/chttp2_slice_allocator.cc} +23 -16
  48. data/src/core/ext/transport/chttp2/transport/chttp2_slice_allocator.h +74 -0
  49. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +12 -10
  50. data/src/core/ext/transport/chttp2/transport/flow_control.h +1 -1
  51. data/src/core/ext/transport/chttp2/transport/frame_data.cc +4 -4
  52. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +8 -8
  53. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +5 -5
  54. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +639 -752
  55. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +190 -69
  56. data/src/core/ext/transport/chttp2/transport/internal.h +2 -1
  57. data/src/core/ext/transport/chttp2/transport/parsing.cc +72 -56
  58. data/src/core/ext/transport/chttp2/transport/varint.cc +6 -4
  59. data/src/core/ext/transport/inproc/inproc_transport.cc +42 -31
  60. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +56 -35
  61. data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +180 -76
  62. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +35 -27
  63. data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +97 -48
  64. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +45 -9
  65. data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +67 -7
  66. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +66 -9
  67. data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +227 -0
  68. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +46 -0
  69. data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +121 -0
  70. data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +1 -0
  71. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +35 -0
  72. data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +90 -0
  73. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +32 -24
  74. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +120 -73
  75. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +4 -2
  76. data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +15 -0
  77. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +48 -0
  78. data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +171 -0
  79. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +8 -6
  80. data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +27 -19
  81. data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +1 -0
  82. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +24 -7
  83. data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +57 -0
  84. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +29 -17
  85. data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +72 -0
  86. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +3 -2
  87. data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +4 -0
  88. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +6 -5
  89. data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +15 -11
  90. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +85 -43
  91. data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +274 -91
  92. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +11 -8
  93. data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +30 -13
  94. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +33 -5
  95. data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +115 -0
  96. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +60 -0
  97. data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +181 -0
  98. data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +1 -0
  99. data/src/core/ext/upb-generated/validate/validate.upb.c +82 -66
  100. data/src/core/ext/upb-generated/validate/validate.upb.h +220 -124
  101. data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +15 -7
  102. data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +53 -52
  103. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +318 -277
  104. data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +5 -0
  105. data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +437 -410
  106. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +198 -170
  107. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +10 -0
  108. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +9 -8
  109. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +219 -163
  110. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +15 -0
  111. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +59 -0
  112. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +40 -0
  113. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +29 -25
  114. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +52 -0
  115. data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +35 -0
  116. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +135 -125
  117. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +5 -0
  118. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +131 -123
  119. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +90 -0
  120. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +35 -0
  121. data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +32 -24
  122. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +69 -55
  123. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
  124. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +684 -664
  125. data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +5 -0
  126. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +13 -10
  127. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +13 -10
  128. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +441 -375
  129. data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +10 -0
  130. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +122 -114
  131. data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +1 -1
  132. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +112 -79
  133. data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +5 -0
  134. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +64 -0
  135. data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +50 -0
  136. data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +35 -32
  137. data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +4 -4
  138. data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +182 -160
  139. data/src/core/ext/xds/certificate_provider_store.h +1 -1
  140. data/src/core/ext/xds/xds_api.cc +582 -257
  141. data/src/core/ext/xds/xds_api.h +46 -8
  142. data/src/core/ext/xds/xds_bootstrap.cc +4 -1
  143. data/src/core/ext/xds/xds_client.cc +66 -43
  144. data/src/core/ext/xds/xds_client.h +0 -4
  145. data/src/core/ext/xds/xds_http_filters.cc +3 -2
  146. data/src/core/ext/xds/xds_http_filters.h +3 -0
  147. data/src/core/lib/address_utils/sockaddr_utils.cc +13 -0
  148. data/src/core/lib/address_utils/sockaddr_utils.h +10 -0
  149. data/src/core/lib/channel/call_tracer.h +85 -0
  150. data/src/core/lib/channel/channel_stack.h +1 -1
  151. data/src/core/lib/channel/channelz.h +3 -0
  152. data/src/core/lib/channel/context.h +3 -0
  153. data/src/core/lib/channel/status_util.h +4 -0
  154. data/src/core/lib/compression/stream_compression.h +1 -1
  155. data/src/core/lib/compression/stream_compression_gzip.h +1 -1
  156. data/src/core/lib/compression/stream_compression_identity.h +1 -1
  157. data/src/core/lib/debug/stats.h +1 -1
  158. data/src/core/lib/event_engine/endpoint_config.cc +46 -0
  159. data/src/core/lib/event_engine/endpoint_config_internal.h +42 -0
  160. data/src/core/lib/event_engine/event_engine.cc +50 -0
  161. data/src/core/lib/event_engine/sockaddr.cc +14 -12
  162. data/src/core/lib/event_engine/sockaddr.h +44 -0
  163. data/src/core/lib/gpr/murmur_hash.cc +4 -2
  164. data/src/core/lib/gpr/wrap_memcpy.cc +2 -1
  165. data/src/core/lib/gprpp/manual_constructor.h +1 -1
  166. data/src/core/lib/gprpp/orphanable.h +3 -3
  167. data/src/core/lib/gprpp/status_helper.h +3 -0
  168. data/src/core/lib/gprpp/sync.h +2 -30
  169. data/src/core/lib/iomgr/buffer_list.cc +1 -1
  170. data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +33 -0
  171. data/src/core/lib/iomgr/error.cc +5 -4
  172. data/src/core/lib/iomgr/error.h +1 -1
  173. data/src/core/lib/iomgr/ev_apple.h +1 -1
  174. data/src/core/lib/iomgr/event_engine/closure.cc +54 -0
  175. data/src/core/lib/iomgr/event_engine/closure.h +33 -0
  176. data/src/core/lib/iomgr/event_engine/endpoint.cc +192 -0
  177. data/src/core/lib/iomgr/event_engine/endpoint.h +53 -0
  178. data/src/core/lib/iomgr/event_engine/iomgr.cc +105 -0
  179. data/src/core/lib/iomgr/event_engine/iomgr.h +24 -0
  180. data/src/core/lib/iomgr/event_engine/pollset.cc +87 -0
  181. data/{include/grpc/event_engine/channel_args.h → src/core/lib/iomgr/event_engine/pollset.h} +7 -10
  182. data/src/core/lib/iomgr/event_engine/promise.h +51 -0
  183. data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +41 -0
  184. data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +35 -0
  185. data/src/core/lib/iomgr/event_engine/resolver.cc +110 -0
  186. data/src/core/lib/iomgr/event_engine/tcp.cc +263 -0
  187. data/src/core/lib/iomgr/event_engine/timer.cc +57 -0
  188. data/src/core/lib/iomgr/exec_ctx.cc +8 -0
  189. data/src/core/lib/iomgr/exec_ctx.h +3 -4
  190. data/src/core/lib/iomgr/executor/threadpool.cc +2 -3
  191. data/src/core/lib/iomgr/executor/threadpool.h +2 -2
  192. data/src/core/lib/iomgr/iomgr.cc +1 -1
  193. data/src/core/lib/iomgr/iomgr_posix.cc +2 -0
  194. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +40 -10
  195. data/src/core/lib/iomgr/pollset_custom.cc +2 -2
  196. data/src/core/lib/iomgr/pollset_custom.h +3 -1
  197. data/src/core/lib/iomgr/pollset_uv.cc +3 -1
  198. data/src/core/lib/iomgr/pollset_uv.h +5 -1
  199. data/src/core/lib/iomgr/port.h +7 -5
  200. data/src/core/lib/iomgr/python_util.h +1 -1
  201. data/src/core/lib/iomgr/resolve_address.cc +5 -1
  202. data/src/core/lib/iomgr/resolve_address.h +6 -0
  203. data/src/core/lib/iomgr/resource_quota.cc +2 -0
  204. data/src/core/lib/iomgr/sockaddr.h +1 -0
  205. data/src/core/lib/iomgr/socket_mutator.cc +15 -2
  206. data/src/core/lib/iomgr/socket_mutator.h +26 -2
  207. data/src/core/lib/iomgr/socket_utils_common_posix.cc +4 -4
  208. data/src/core/lib/iomgr/socket_utils_posix.h +2 -2
  209. data/src/core/lib/iomgr/tcp_client_posix.cc +7 -2
  210. data/src/core/lib/iomgr/tcp_client_windows.cc +2 -0
  211. data/src/core/lib/iomgr/tcp_posix.cc +42 -39
  212. data/src/core/lib/iomgr/tcp_posix.h +8 -0
  213. data/src/core/lib/iomgr/tcp_server_custom.cc +3 -4
  214. data/src/core/lib/iomgr/tcp_server_posix.cc +7 -0
  215. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +2 -1
  216. data/src/core/lib/iomgr/timer.h +6 -1
  217. data/src/core/lib/iomgr/timer_manager.cc +1 -1
  218. data/src/core/lib/json/json_reader.cc +1 -2
  219. data/src/core/lib/matchers/matchers.cc +8 -20
  220. data/src/core/lib/matchers/matchers.h +2 -1
  221. data/src/core/lib/security/authorization/authorization_engine.h +44 -0
  222. data/src/core/lib/security/authorization/authorization_policy_provider.h +32 -0
  223. data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +46 -0
  224. data/src/core/lib/security/authorization/evaluate_args.cc +209 -0
  225. data/src/core/lib/security/authorization/evaluate_args.h +91 -0
  226. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +3 -1
  227. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +49 -0
  228. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +7 -0
  229. data/src/core/lib/security/credentials/tls/tls_utils.cc +32 -0
  230. data/src/core/lib/security/credentials/tls/tls_utils.h +13 -0
  231. data/src/core/lib/security/security_connector/local/local_security_connector.cc +9 -6
  232. data/src/core/lib/security/security_connector/ssl_utils.cc +5 -0
  233. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +6 -18
  234. data/src/core/lib/security/transport/security_handshaker.cc +12 -4
  235. data/src/core/lib/security/transport/server_auth_filter.cc +0 -7
  236. data/src/core/lib/slice/slice.cc +12 -2
  237. data/src/core/lib/slice/slice_internal.h +1 -0
  238. data/src/core/lib/surface/call.cc +26 -7
  239. data/src/core/lib/surface/call.h +11 -0
  240. data/src/core/lib/surface/completion_queue.cc +22 -22
  241. data/src/core/lib/surface/completion_queue.h +1 -1
  242. data/src/core/lib/surface/completion_queue_factory.cc +1 -2
  243. data/src/core/lib/surface/init.cc +1 -3
  244. data/src/core/lib/surface/init.h +10 -1
  245. data/src/core/lib/surface/server.cc +3 -1
  246. data/src/core/lib/surface/server.h +3 -3
  247. data/src/core/lib/surface/version.cc +2 -4
  248. data/src/core/lib/transport/error_utils.cc +2 -2
  249. data/src/core/lib/transport/metadata_batch.cc +13 -2
  250. data/src/core/lib/transport/metadata_batch.h +7 -0
  251. data/src/core/lib/transport/transport.h +2 -0
  252. data/src/core/lib/transport/transport_op_string.cc +1 -1
  253. data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
  254. data/src/core/tsi/alts/crypt/gsec.h +2 -0
  255. data/src/ruby/ext/grpc/extconf.rb +2 -0
  256. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +6 -0
  257. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +10 -1
  258. data/src/ruby/lib/grpc/version.rb +1 -1
  259. data/third_party/boringssl-with-bazel/err_data.c +269 -263
  260. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +8 -6
  261. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c +4 -0
  262. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +1 -1
  263. data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +1 -1
  264. data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +9 -0
  265. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/prime.c +0 -4
  266. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digest.c +7 -0
  267. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/md32_common.h +87 -121
  268. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +20 -30
  269. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +19 -30
  270. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +1 -4
  271. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +0 -13
  272. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +26 -24
  273. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +10 -7
  274. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +28 -39
  275. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +48 -66
  276. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +4 -5
  277. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +362 -371
  278. data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c +4 -2
  279. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +2 -2
  280. data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c +1 -2
  281. data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +101 -11
  282. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c +3 -0
  283. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +2 -2
  284. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +3 -0
  285. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +1 -1
  286. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +2 -0
  287. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +14 -15
  288. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c +53 -73
  289. data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +31 -0
  290. data/third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c +3 -0
  291. data/third_party/boringssl-with-bazel/src/crypto/x509/x_all.c +3 -0
  292. data/third_party/boringssl-with-bazel/src/crypto/x509/x_req.c +5 -8
  293. data/third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c +5 -0
  294. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +3 -0
  295. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +7 -0
  296. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +1 -1
  297. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +5 -8
  298. data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +1 -1
  299. data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +66 -1
  300. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +40 -9
  301. data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +1 -0
  302. data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +1 -1
  303. data/third_party/boringssl-with-bazel/src/include/openssl/digest.h +6 -2
  304. data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +14 -0
  305. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +19 -11
  306. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +325 -0
  307. data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +23 -7
  308. data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +99 -63
  309. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +139 -109
  310. data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +12 -19
  311. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +48 -50
  312. data/third_party/boringssl-with-bazel/src/include/openssl/x509_vfy.h +451 -435
  313. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +0 -1
  314. data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +2 -2
  315. data/third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc +1 -1
  316. data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +773 -84
  317. data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +80 -47
  318. data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +24 -19
  319. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +189 -86
  320. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +45 -56
  321. data/third_party/boringssl-with-bazel/src/ssl/internal.h +272 -167
  322. data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +2 -2
  323. data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +2 -2
  324. data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +14 -19
  325. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +34 -102
  326. data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +2 -0
  327. data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +8 -31
  328. data/third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc +3 -0
  329. data/third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc +4 -3
  330. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +7 -3
  331. data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +576 -648
  332. data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +31 -3
  333. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +98 -39
  334. data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +141 -94
  335. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +58 -68
  336. data/third_party/xxhash/xxhash.h +77 -195
  337. metadata +81 -39
  338. data/src/core/lib/gpr/arena.h +0 -47
  339. data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +0 -267
  340. data/third_party/boringssl-with-bazel/src/crypto/x509/vpm_int.h +0 -71
@@ -0,0 +1,57 @@
1
+ // Copyright 2021 The gRPC Authors
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ #include <grpc/support/port_platform.h>
15
+
16
+ #ifdef GRPC_USE_EVENT_ENGINE
17
+ #include <grpc/event_engine/event_engine.h>
18
+
19
+ #include "src/core/lib/iomgr/error.h"
20
+ #include "src/core/lib/iomgr/event_engine/closure.h"
21
+ #include "src/core/lib/iomgr/event_engine/iomgr.h"
22
+ #include "src/core/lib/iomgr/timer.h"
23
+ #include "src/core/lib/surface/init.h"
24
+ #include "src/core/lib/transport/error_utils.h"
25
+
26
+ namespace {
27
+ using ::grpc_event_engine::experimental::EventEngine;
28
+ using ::grpc_event_engine::experimental::GrpcClosureToCallback;
29
+
30
+ void timer_init(grpc_timer* timer, grpc_millis deadline,
31
+ grpc_closure* closure) {
32
+ timer->ee_task_handle = grpc_iomgr_event_engine()->RunAt(
33
+ grpc_core::ToAbslTime(
34
+ grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME)),
35
+ GrpcClosureToCallback(closure, GRPC_ERROR_NONE), {});
36
+ }
37
+
38
+ void timer_cancel(grpc_timer* timer) {
39
+ auto handle = timer->ee_task_handle;
40
+ grpc_iomgr_event_engine()->TryCancel(handle);
41
+ }
42
+
43
+ /* Internal API */
44
+ grpc_timer_check_result timer_check(grpc_millis* /* next */) {
45
+ return GRPC_TIMERS_NOT_CHECKED;
46
+ }
47
+ void timer_list_init() {}
48
+ void timer_list_shutdown(void) {}
49
+ void timer_consume_kick(void) {}
50
+
51
+ } // namespace
52
+
53
+ grpc_timer_vtable grpc_event_engine_timer_vtable = {
54
+ timer_init, timer_cancel, timer_check,
55
+ timer_list_init, timer_list_shutdown, timer_consume_kick};
56
+
57
+ #endif // GRPC_USE_EVENT_ENGINE
@@ -20,11 +20,14 @@
20
20
 
21
21
  #include "src/core/lib/iomgr/exec_ctx.h"
22
22
 
23
+ #include <grpc/event_engine/event_engine.h>
23
24
  #include <grpc/support/log.h>
24
25
  #include <grpc/support/sync.h>
25
26
 
26
27
  #include "src/core/lib/gprpp/thd.h"
27
28
  #include "src/core/lib/iomgr/combiner.h"
29
+ #include "src/core/lib/iomgr/event_engine/closure.h"
30
+ #include "src/core/lib/iomgr/event_engine/iomgr.h"
28
31
  #include "src/core/lib/profiling/timers.h"
29
32
 
30
33
  static void exec_ctx_run(grpc_closure* closure, grpc_error_handle error) {
@@ -47,8 +50,13 @@ static void exec_ctx_run(grpc_closure* closure, grpc_error_handle error) {
47
50
  }
48
51
 
49
52
  static void exec_ctx_sched(grpc_closure* closure, grpc_error_handle error) {
53
+ #if defined(GRPC_USE_EVENT_ENGINE) && \
54
+ defined(GRPC_EVENT_ENGINE_REPLACE_EXEC_CTX)
55
+ grpc_iomgr_event_engine()->Run(GrpcClosureToCallback(closure, error), {});
56
+ #else
50
57
  grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(), closure,
51
58
  error);
59
+ #endif
52
60
  }
53
61
 
54
62
  static gpr_timespec g_start_time;
@@ -349,8 +349,7 @@ class ApplicationCallbackExecCtx {
349
349
  }
350
350
  }
351
351
 
352
- static void Enqueue(grpc_experimental_completion_queue_functor* functor,
353
- int is_success) {
352
+ static void Enqueue(grpc_completion_queue_functor* functor, int is_success) {
354
353
  functor->internal_success = is_success;
355
354
  functor->internal_next = nullptr;
356
355
 
@@ -375,8 +374,8 @@ class ApplicationCallbackExecCtx {
375
374
 
376
375
  private:
377
376
  uintptr_t flags_{0u};
378
- grpc_experimental_completion_queue_functor* head_{nullptr};
379
- grpc_experimental_completion_queue_functor* tail_{nullptr};
377
+ grpc_completion_queue_functor* head_{nullptr};
378
+ grpc_completion_queue_functor* tail_{nullptr};
380
379
  GPR_TLS_CLASS_DECL(callback_exec_ctx_);
381
380
  };
382
381
  } // namespace grpc_core
@@ -41,8 +41,7 @@ void ThreadPoolWorker::Run() {
41
41
  break;
42
42
  }
43
43
  // Runs closure
44
- auto* closure =
45
- static_cast<grpc_experimental_completion_queue_functor*>(elem);
44
+ auto* closure = static_cast<grpc_completion_queue_functor*>(elem);
46
45
  closure->functor_run(closure, closure->internal_success);
47
46
  }
48
47
  }
@@ -120,7 +119,7 @@ ThreadPool::~ThreadPool() {
120
119
  delete queue_;
121
120
  }
122
121
 
123
- void ThreadPool::Add(grpc_experimental_completion_queue_functor* closure) {
122
+ void ThreadPool::Add(grpc_completion_queue_functor* closure) {
124
123
  AssertHasNotBeenShutDown();
125
124
  queue_->Put(static_cast<void*>(closure));
126
125
  }
@@ -43,7 +43,7 @@ class ThreadPoolInterface {
43
43
  // current thread to be blocked (in case of unable to schedule).
44
44
  // Closure should contain a function pointer and arguments it will take, more
45
45
  // details for closure struct at /grpc/include/grpc/impl/codegen/grpc_types.h
46
- virtual void Add(grpc_experimental_completion_queue_functor* closure) = 0;
46
+ virtual void Add(grpc_completion_queue_functor* closure) = 0;
47
47
 
48
48
  // Returns the current number of pending closures
49
49
  virtual int num_pending_closures() const = 0;
@@ -120,7 +120,7 @@ class ThreadPool : public ThreadPoolInterface {
120
120
 
121
121
  // Adds given closure into pending queue immediately. Since closure queue has
122
122
  // infinite length, this routine will not block.
123
- void Add(grpc_experimental_completion_queue_functor* closure) override;
123
+ void Add(grpc_completion_queue_functor* closure) override;
124
124
 
125
125
  int num_pending_closures() const override;
126
126
  int pool_capacity() const override;
@@ -94,7 +94,6 @@ void grpc_iomgr_shutdown() {
94
94
  {
95
95
  grpc_timer_manager_shutdown();
96
96
  grpc_iomgr_platform_flush();
97
- grpc_core::Executor::ShutdownAll();
98
97
 
99
98
  gpr_mu_lock(&g_mu);
100
99
  g_shutdown = 1;
@@ -149,6 +148,7 @@ void grpc_iomgr_shutdown() {
149
148
  gpr_mu_unlock(&g_mu);
150
149
  grpc_timer_list_shutdown();
151
150
  grpc_core::ExecCtx::Get()->Flush();
151
+ grpc_core::Executor::ShutdownAll();
152
152
  }
153
153
 
154
154
  /* ensure all threads have left g_mu */
@@ -41,11 +41,13 @@ extern grpc_address_resolver_vtable grpc_posix_resolver_vtable;
41
41
  static void iomgr_platform_init(void) {
42
42
  grpc_wakeup_fd_global_init();
43
43
  grpc_event_engine_init();
44
+ grpc_tcp_posix_init();
44
45
  }
45
46
 
46
47
  static void iomgr_platform_flush(void) {}
47
48
 
48
49
  static void iomgr_platform_shutdown(void) {
50
+ grpc_tcp_posix_shutdown();
49
51
  grpc_event_engine_shutdown();
50
52
  grpc_wakeup_fd_global_destroy();
51
53
  }
@@ -84,7 +84,43 @@ static grpc_iomgr_platform_vtable apple_vtable = {
84
84
  apple_iomgr_platform_is_any_background_poller_thread,
85
85
  apple_iomgr_platform_add_closure_to_background_poller};
86
86
 
87
+ namespace {
88
+ struct CFStreamEnv {
89
+ bool enable_cfstream;
90
+ bool enable_cfstream_run_loop;
91
+ };
92
+
93
+ // Parses environment variables for CFStream specific settings
94
+ CFStreamEnv ParseEnvForCFStream() {
95
+ CFStreamEnv env;
96
+ char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
97
+ env.enable_cfstream =
98
+ enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
99
+ char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
100
+ // CFStream run-loop is disabled by default. The user has to enable it
101
+ // explicitly with environment variable.
102
+ env.enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
103
+ enable_cfstream_run_loop_str[0] == '1';
104
+ return env;
105
+ }
106
+
107
+ void MaybeInitializeTcpPosix(void) {
108
+ CFStreamEnv env = ParseEnvForCFStream();
109
+ if (!env.enable_cfstream || !env.enable_cfstream_run_loop) {
110
+ grpc_tcp_posix_init();
111
+ }
112
+ }
113
+
114
+ void MaybeShutdownTcpPosix(void) {
115
+ CFStreamEnv env = ParseEnvForCFStream();
116
+ if (!env.enable_cfstream || !env.enable_cfstream_run_loop) {
117
+ grpc_tcp_posix_shutdown();
118
+ }
119
+ }
120
+ } // namespace
121
+
87
122
  static void iomgr_platform_init(void) {
123
+ MaybeInitializeTcpPosix();
88
124
  grpc_wakeup_fd_global_init();
89
125
  grpc_event_engine_init();
90
126
  }
@@ -94,6 +130,7 @@ static void iomgr_platform_flush(void) {}
94
130
  static void iomgr_platform_shutdown(void) {
95
131
  grpc_event_engine_shutdown();
96
132
  grpc_wakeup_fd_global_destroy();
133
+ MaybeShutdownTcpPosix();
97
134
  }
98
135
 
99
136
  static void iomgr_platform_shutdown_background_closure(void) {
@@ -118,22 +155,15 @@ static grpc_iomgr_platform_vtable vtable = {
118
155
  iomgr_platform_add_closure_to_background_poller};
119
156
 
120
157
  void grpc_set_default_iomgr_platform() {
121
- char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
122
- bool enable_cfstream =
123
- enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
124
- char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
125
- // CFStream run-loop is disabled by default. The user has to enable it
126
- // explicitly with environment variable.
127
- bool enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
128
- enable_cfstream_run_loop_str[0] == '1';
129
- if (!enable_cfstream) {
158
+ CFStreamEnv env = ParseEnvForCFStream();
159
+ if (!env.enable_cfstream) {
130
160
  // Use POSIX sockets for both client and server
131
161
  grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable);
132
162
  grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
133
163
  grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
134
164
  grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
135
165
  grpc_set_iomgr_platform_vtable(&vtable);
136
- } else if (enable_cfstream && !enable_cfstream_run_loop) {
166
+ } else if (env.enable_cfstream && !env.enable_cfstream_run_loop) {
137
167
  // Use CFStream with dispatch queue for client; use POSIX sockets for server
138
168
  grpc_set_tcp_client_impl(&grpc_cfstream_client_vtable);
139
169
  grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
@@ -77,14 +77,14 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
77
77
  // control back to the application
78
78
  grpc_core::ExecCtx* curr = grpc_core::ExecCtx::Get();
79
79
  grpc_core::ExecCtx::Set(nullptr);
80
- poller_vtable->poll(static_cast<size_t>(timeout));
80
+ grpc_error* err = poller_vtable->poll(static_cast<size_t>(timeout));
81
81
  grpc_core::ExecCtx::Set(curr);
82
82
  grpc_core::ExecCtx::Get()->InvalidateNow();
83
83
  if (grpc_core::ExecCtx::Get()->HasWork()) {
84
84
  grpc_core::ExecCtx::Get()->Flush();
85
85
  }
86
86
  gpr_mu_lock(&pollset->mu);
87
- return GRPC_ERROR_NONE;
87
+ return err;
88
88
  }
89
89
 
90
90
  static grpc_error_handle pollset_kick(
@@ -21,11 +21,13 @@
21
21
 
22
22
  #include <grpc/support/port_platform.h>
23
23
 
24
+ #include "src/core/lib/iomgr/error.h"
25
+
24
26
  #include <stddef.h>
25
27
 
26
28
  typedef struct grpc_custom_poller_vtable {
27
29
  void (*init)();
28
- void (*poll)(size_t timeout_ms);
30
+ grpc_error* (*poll)(size_t timeout_ms);
29
31
  void (*kick)();
30
32
  void (*shutdown)();
31
33
  } grpc_custom_poller_vtable;
@@ -24,6 +24,7 @@
24
24
 
25
25
  #include <grpc/support/alloc.h>
26
26
  #include <grpc/support/log.h>
27
+ #include "src/core/lib/iomgr/error.h"
27
28
  #include "src/core/lib/iomgr/pollset_custom.h"
28
29
 
29
30
  #include <uv.h>
@@ -54,7 +55,7 @@ static void empty_timer_cb(uv_timer_t* handle) {}
54
55
 
55
56
  static void kick_timer_cb(uv_timer_t* handle) { g_kicked = false; }
56
57
 
57
- static void run_loop(size_t timeout) {
58
+ static grpc_error* run_loop(size_t timeout) {
58
59
  if (grpc_pollset_work_run_loop) {
59
60
  if (timeout == 0) {
60
61
  uv_run(uv_default_loop(), UV_RUN_NOWAIT);
@@ -64,6 +65,7 @@ static void run_loop(size_t timeout) {
64
65
  uv_timer_stop(&g_handle->poll_timer);
65
66
  }
66
67
  }
68
+ return GRPC_ERROR_NONE;
67
69
  }
68
70
 
69
71
  static void kick() {
@@ -19,11 +19,15 @@
19
19
  #ifndef GRPC_CORE_LIB_IOMGR_POLLSET_UV_H
20
20
  #define GRPC_CORE_LIB_IOMGR_POLLSET_UV_H
21
21
 
22
+ #include <grpc/support/port_platform.h>
23
+
24
+ #include "src/core/lib/iomgr/error.h"
25
+
22
26
  extern int grpc_pollset_work_run_loop;
23
27
 
24
28
  typedef struct grpc_custom_poller_vtable {
25
29
  void (*init)(void);
26
- void (*run_loop)(int blocking);
30
+ grpc_error* (*run_loop)(int blocking);
27
31
  } grpc_custom_poller_vtable;
28
32
 
29
33
  void grpc_custom_pollset_global_init(grpc_custom_poller_vtable* vtable);
@@ -15,12 +15,11 @@
15
15
  * limitations under the License.
16
16
  *
17
17
  */
18
-
19
- #include <grpc/support/port_platform.h>
20
-
21
18
  #ifndef GRPC_CORE_LIB_IOMGR_PORT_H
22
19
  #define GRPC_CORE_LIB_IOMGR_PORT_H
23
20
 
21
+ #include <grpc/support/port_platform.h>
22
+
24
23
  #ifdef GRPC_UV
25
24
  #ifndef GRPC_CUSTOM_SOCKET
26
25
  #define GRPC_CUSTOM_SOCKET
@@ -33,6 +32,8 @@
33
32
  #endif
34
33
  #if defined(GRPC_CUSTOM_SOCKET)
35
34
  // Do Nothing
35
+ #elif defined(GRPC_USE_EVENT_ENGINE)
36
+ // Do Nothing
36
37
  #elif defined(GPR_WINDOWS)
37
38
  #define GRPC_WINSOCK_SOCKET 1
38
39
  #define GRPC_WINDOWS_SOCKETUTILS 1
@@ -189,10 +190,11 @@
189
190
  #endif
190
191
 
191
192
  #if defined(GRPC_POSIX_SOCKET) + defined(GRPC_WINSOCK_SOCKET) + \
192
- defined(GRPC_CUSTOM_SOCKET) + defined(GRPC_CFSTREAM) != \
193
+ defined(GRPC_CUSTOM_SOCKET) + defined(GRPC_CFSTREAM) + \
194
+ defined(GRPC_USE_EVENT_ENGINE) != \
193
195
  1
194
196
  #error \
195
- "Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CUSTOM_SOCKET, GRPC_CFSTREAM"
197
+ "Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CUSTOM_SOCKET, GRPC_CFSTREAM, GRPC_USE_EVENT_ENGINE"
196
198
  #endif
197
199
 
198
200
  #ifdef GRPC_POSIX_SOCKET
@@ -43,4 +43,4 @@ inline int grpc_slice_buffer_length(grpc_slice_buffer* buffer, int i) {
43
43
  return GRPC_SLICE_LENGTH(buffer->slices[i]);
44
44
  }
45
45
 
46
- #endif
46
+ #endif // GRPC_CORE_LIB_IOMGR_PYTHON_UTIL_H
@@ -15,12 +15,16 @@
15
15
  * limitations under the License.
16
16
  *
17
17
  */
18
-
19
18
  #include <grpc/support/port_platform.h>
20
19
 
20
+ #include <grpc/event_engine/event_engine.h>
21
21
  #include <grpc/support/alloc.h>
22
22
  #include "src/core/lib/iomgr/resolve_address.h"
23
23
 
24
+ namespace grpc_core {
25
+ const char* kDefaultSecurePort = "https";
26
+ } // namespace grpc_core
27
+
24
28
  grpc_address_resolver_vtable* grpc_resolve_address_impl;
25
29
 
26
30
  void grpc_set_resolver_impl(grpc_address_resolver_vtable* vtable) {
@@ -49,6 +49,12 @@ struct grpc_resolved_addresses {
49
49
  size_t naddrs;
50
50
  grpc_resolved_address* addrs;
51
51
  };
52
+
53
+ namespace grpc_core {
54
+ extern const char* kDefaultSecurePort;
55
+ constexpr int kDefaultSecurePortInt = 443;
56
+ } // namespace grpc_core
57
+
52
58
  typedef struct grpc_address_resolver_vtable {
53
59
  void (*resolve_address)(const char* addr, const char* default_port,
54
60
  grpc_pollset_set* interested_parties,
@@ -805,6 +805,8 @@ grpc_resource_user* grpc_resource_user_create(
805
805
  for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
806
806
  resource_user->links[i].next = resource_user->links[i].prev = nullptr;
807
807
  }
808
+ // TODO(hork): the RU should own a copy of the name. See Craig's comments on
809
+ // the EventEngine gRFC for justification.
808
810
  if (name != nullptr) {
809
811
  resource_user->name = name;
810
812
  } else {
@@ -25,6 +25,7 @@
25
25
 
26
26
  #include <grpc/support/port_platform.h>
27
27
 
28
+ #include "src/core/lib/event_engine/sockaddr.h"
28
29
  #include "src/core/lib/iomgr/sockaddr_custom.h"
29
30
  #include "src/core/lib/iomgr/sockaddr_posix.h"
30
31
  #include "src/core/lib/iomgr/sockaddr_windows.h"
@@ -21,6 +21,7 @@
21
21
  #include "src/core/lib/iomgr/socket_mutator.h"
22
22
 
23
23
  #include <grpc/impl/codegen/grpc_types.h>
24
+ #include <grpc/support/log.h>
24
25
  #include <grpc/support/sync.h>
25
26
 
26
27
  #include "src/core/lib/channel/channel_args.h"
@@ -37,8 +38,20 @@ grpc_socket_mutator* grpc_socket_mutator_ref(grpc_socket_mutator* mutator) {
37
38
  return mutator;
38
39
  }
39
40
 
40
- bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd) {
41
- return mutator->vtable->mutate_fd(fd, mutator);
41
+ bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd,
42
+ grpc_fd_usage usage) {
43
+ if (mutator->vtable->mutate_fd_2 != nullptr) {
44
+ grpc_mutate_socket_info info{fd, usage};
45
+ return mutator->vtable->mutate_fd_2(&info, mutator);
46
+ }
47
+ switch (usage) {
48
+ case GRPC_FD_SERVER_CONNECTION_USAGE:
49
+ return true;
50
+ case GRPC_FD_CLIENT_CONNECTION_USAGE:
51
+ case GRPC_FD_SERVER_LISTENER_USAGE:
52
+ return mutator->vtable->mutate_fd(fd, mutator);
53
+ }
54
+ GPR_UNREACHABLE_CODE(return false);
42
55
  }
43
56
 
44
57
  int grpc_socket_mutator_compare(grpc_socket_mutator* a,