grpc 1.30.2 → 1.31.0.pre1

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 (317) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +560 -619
  3. data/include/grpc/grpc_security_constants.h +3 -0
  4. data/include/grpc/impl/codegen/grpc_types.h +7 -5
  5. data/include/grpc/impl/codegen/port_platform.h +0 -32
  6. data/src/core/ext/filters/client_channel/backend_metric.cc +12 -9
  7. data/src/core/ext/filters/client_channel/client_channel.cc +406 -265
  8. data/src/core/ext/filters/client_channel/config_selector.cc +62 -0
  9. data/src/core/ext/filters/client_channel/config_selector.h +93 -0
  10. data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +24 -2
  11. data/src/core/ext/filters/client_channel/health/health_check_client.cc +2 -0
  12. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +6 -5
  13. data/src/core/ext/filters/client_channel/http_proxy.cc +6 -4
  14. data/src/core/ext/filters/client_channel/lb_policy.h +2 -0
  15. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +39 -23
  16. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +4 -6
  17. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc +376 -68
  18. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +4 -5
  19. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +5 -2
  20. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +6 -5
  21. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +8 -6
  22. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +9 -7
  23. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +7 -5
  24. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +33 -48
  25. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +6 -2
  26. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +21 -18
  27. data/src/core/ext/filters/client_channel/resolver_registry.cc +13 -14
  28. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +6 -7
  29. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +33 -28
  30. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +39 -20
  31. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +142 -0
  32. data/src/core/ext/filters/client_channel/subchannel.cc +1 -1
  33. data/src/core/ext/filters/client_channel/xds/xds_api.cc +327 -123
  34. data/src/core/ext/filters/client_channel/xds/xds_api.h +72 -7
  35. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +12 -23
  36. data/src/core/ext/filters/client_channel/xds/xds_client.cc +112 -33
  37. data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +10 -10
  38. data/src/core/ext/filters/http/client/http_client_filter.cc +5 -5
  39. data/src/core/ext/filters/http/http_filters_plugin.cc +2 -1
  40. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +74 -33
  41. data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +3 -1
  42. data/src/core/ext/filters/message_size/message_size_filter.cc +56 -80
  43. data/src/core/ext/filters/message_size/message_size_filter.h +6 -0
  44. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +383 -347
  45. data/src/core/ext/transport/chttp2/server/chttp2_server.h +6 -2
  46. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +1 -1
  47. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +7 -13
  48. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +7 -8
  49. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +19 -4
  50. data/src/core/ext/transport/chttp2/transport/flow_control.cc +22 -27
  51. data/src/core/ext/transport/chttp2/transport/flow_control.h +14 -16
  52. data/src/core/ext/transport/chttp2/transport/frame_data.cc +9 -12
  53. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +4 -6
  54. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -6
  55. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +12 -13
  56. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +6 -7
  57. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +9 -12
  58. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +25 -29
  59. data/src/core/ext/transport/chttp2/transport/hpack_table.cc +13 -17
  60. data/src/core/ext/transport/chttp2/transport/internal.h +13 -0
  61. data/src/core/ext/transport/chttp2/transport/parsing.cc +33 -43
  62. data/src/core/ext/transport/chttp2/transport/writing.cc +9 -14
  63. data/src/core/ext/transport/inproc/inproc_transport.cc +35 -15
  64. data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +0 -1
  65. data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +3 -4
  66. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +0 -1
  67. data/src/core/ext/upb-generated/envoy/api/v2/auth/common.upb.h +80 -69
  68. data/src/core/ext/upb-generated/envoy/api/v2/auth/secret.upb.h +24 -23
  69. data/src/core/ext/upb-generated/envoy/api/v2/auth/tls.upb.h +66 -56
  70. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +1 -2
  71. data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c +2 -2
  72. data/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.h +317 -311
  73. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h +42 -34
  74. data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h +7 -7
  75. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +79 -61
  76. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h +55 -49
  77. data/src/core/ext/upb-generated/envoy/api/v2/core/backoff.upb.h +9 -8
  78. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +1 -1
  79. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +163 -169
  80. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +51 -45
  81. data/src/core/ext/upb-generated/envoy/api/v2/core/event_service_config.upb.h +4 -5
  82. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h +107 -100
  83. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +137 -117
  84. data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h +9 -9
  85. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +105 -87
  86. data/src/core/ext/upb-generated/envoy/api/v2/core/socket_option.upb.h +12 -13
  87. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +1 -1
  88. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h +95 -101
  89. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +1 -2
  90. data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.c +1 -1
  91. data/src/core/ext/upb-generated/envoy/api/v2/endpoint.upb.h +49 -65
  92. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h +0 -1
  93. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint_components.upb.h +49 -42
  94. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h +70 -62
  95. data/src/core/ext/upb-generated/envoy/api/v2/lds.upb.h +1 -2
  96. data/src/core/ext/upb-generated/envoy/api/v2/listener.upb.h +81 -65
  97. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener.upb.h +0 -1
  98. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.c +1 -1
  99. data/src/core/ext/upb-generated/envoy/api/v2/listener/listener_components.upb.h +91 -80
  100. data/src/core/ext/upb-generated/envoy/api/v2/listener/udp_listener_config.upb.h +9 -10
  101. data/src/core/ext/upb-generated/envoy/api/v2/rds.upb.h +1 -2
  102. data/src/core/ext/upb-generated/envoy/api/v2/route.upb.h +36 -31
  103. data/src/core/ext/upb-generated/envoy/api/v2/route/route.upb.h +0 -1
  104. data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.c +7 -7
  105. data/src/core/ext/upb-generated/envoy/api/v2/route/route_components.upb.h +648 -696
  106. data/src/core/ext/upb-generated/envoy/api/v2/scoped_route.upb.h +16 -15
  107. data/src/core/ext/upb-generated/envoy/api/v2/srds.upb.h +1 -2
  108. data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.c +1 -1
  109. data/src/core/ext/upb-generated/envoy/config/filter/accesslog/v2/accesslog.upb.h +95 -88
  110. data/src/core/ext/upb-generated/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.upb.h +234 -199
  111. data/src/core/ext/upb-generated/envoy/config/listener/v2/api_listener.upb.h +5 -5
  112. data/src/core/ext/upb-generated/envoy/config/trace/v2/http_tracer.upb.h +13 -13
  113. data/src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h +1 -2
  114. data/src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h +20 -18
  115. data/src/core/ext/upb-generated/envoy/type/http.upb.h +0 -1
  116. data/src/core/ext/upb-generated/envoy/type/matcher/regex.upb.h +18 -17
  117. data/src/core/ext/upb-generated/envoy/type/matcher/string.upb.h +14 -14
  118. data/src/core/ext/upb-generated/envoy/type/metadata/v2/metadata.upb.h +23 -23
  119. data/src/core/ext/upb-generated/envoy/type/percent.upb.h +8 -9
  120. data/src/core/ext/upb-generated/envoy/type/range.upb.h +15 -16
  121. data/src/core/ext/upb-generated/envoy/type/semantic_version.upb.h +7 -8
  122. data/src/core/ext/upb-generated/envoy/type/tracing/v2/custom_tag.upb.h +36 -35
  123. data/src/core/ext/upb-generated/gogoproto/gogo.upb.h +0 -1
  124. data/src/core/ext/upb-generated/google/api/annotations.upb.h +0 -1
  125. data/src/core/ext/upb-generated/google/api/http.upb.h +29 -28
  126. data/src/core/ext/upb-generated/google/protobuf/any.upb.h +5 -6
  127. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +3 -3
  128. data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +412 -386
  129. data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +5 -6
  130. data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +1 -2
  131. data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +1 -1
  132. data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +33 -54
  133. data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +5 -6
  134. data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +27 -28
  135. data/src/core/ext/upb-generated/google/rpc/status.upb.h +8 -8
  136. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +1 -1
  137. data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +32 -45
  138. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +4 -4
  139. data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +157 -178
  140. data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +14 -13
  141. data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +6 -7
  142. data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +59 -56
  143. data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +11 -12
  144. data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +0 -1
  145. data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +5 -6
  146. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c +6 -6
  147. data/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h +41 -68
  148. data/src/core/ext/upb-generated/validate/validate.upb.h +536 -535
  149. data/src/core/lib/channel/channel_trace.cc +2 -6
  150. data/src/core/lib/channel/channelz.cc +5 -15
  151. data/src/core/lib/gpr/log_linux.cc +6 -8
  152. data/src/core/lib/gpr/log_posix.cc +6 -8
  153. data/src/core/lib/gpr/string.cc +10 -9
  154. data/src/core/lib/gpr/string.h +4 -2
  155. data/src/core/lib/gprpp/global_config_env.cc +8 -6
  156. data/src/core/lib/http/httpcli.cc +13 -10
  157. data/src/core/lib/http/httpcli_security_connector.cc +5 -5
  158. data/src/core/lib/iomgr/cfstream_handle.cc +1 -0
  159. data/src/core/lib/iomgr/endpoint_pair_posix.cc +10 -10
  160. data/src/core/lib/iomgr/error_cfstream.cc +9 -8
  161. data/src/core/lib/iomgr/ev_epoll1_linux.cc +5 -6
  162. data/src/core/lib/iomgr/ev_epollex_linux.cc +15 -21
  163. data/src/core/lib/iomgr/ev_poll_posix.cc +6 -5
  164. data/src/core/lib/iomgr/ev_posix.cc +2 -0
  165. data/src/core/lib/iomgr/iomgr.cc +10 -0
  166. data/src/core/lib/iomgr/iomgr.h +10 -0
  167. data/src/core/lib/iomgr/is_epollexclusive_available.cc +14 -0
  168. data/src/core/lib/iomgr/port.h +1 -21
  169. data/src/core/lib/iomgr/resolve_address_custom.cc +13 -18
  170. data/src/core/lib/iomgr/resolve_address_windows.cc +8 -8
  171. data/src/core/lib/iomgr/resource_quota.cc +34 -31
  172. data/src/core/lib/iomgr/sockaddr_utils.cc +7 -5
  173. data/src/core/lib/iomgr/sockaddr_utils.h +1 -1
  174. data/src/core/lib/iomgr/socket_utils_common_posix.cc +95 -55
  175. data/src/core/lib/iomgr/socket_windows.cc +4 -5
  176. data/src/core/lib/iomgr/tcp_client_cfstream.cc +9 -11
  177. data/src/core/lib/iomgr/tcp_client_custom.cc +6 -9
  178. data/src/core/lib/iomgr/tcp_client_posix.cc +27 -36
  179. data/src/core/lib/iomgr/tcp_client_windows.cc +9 -9
  180. data/src/core/lib/iomgr/tcp_custom.cc +1 -1
  181. data/src/core/lib/iomgr/tcp_custom.h +1 -1
  182. data/src/core/lib/iomgr/tcp_server.cc +3 -4
  183. data/src/core/lib/iomgr/tcp_server.h +7 -5
  184. data/src/core/lib/iomgr/tcp_server_custom.cc +6 -14
  185. data/src/core/lib/iomgr/tcp_server_posix.cc +34 -41
  186. data/src/core/lib/iomgr/tcp_server_utils_posix.h +3 -4
  187. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +5 -7
  188. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +4 -9
  189. data/src/core/lib/iomgr/tcp_server_windows.cc +16 -16
  190. data/src/core/lib/iomgr/timer_generic.cc +13 -12
  191. data/src/core/lib/iomgr/udp_server.cc +24 -23
  192. data/src/core/lib/iomgr/udp_server.h +5 -2
  193. data/src/core/lib/iomgr/unix_sockets_posix.cc +9 -14
  194. data/src/core/lib/iomgr/unix_sockets_posix.h +3 -1
  195. data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +5 -2
  196. data/src/core/lib/json/json_reader.cc +20 -21
  197. data/src/core/lib/security/credentials/credentials.h +5 -3
  198. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +8 -6
  199. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +12 -9
  200. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +7 -4
  201. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +19 -28
  202. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -6
  203. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +20 -0
  204. data/src/core/lib/security/credentials/ssl/ssl_credentials.h +10 -0
  205. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +10 -0
  206. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +10 -10
  207. data/src/core/lib/security/security_connector/security_connector.cc +2 -0
  208. data/src/core/lib/security/security_connector/security_connector.h +1 -1
  209. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +18 -11
  210. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +5 -0
  211. data/src/core/lib/security/security_connector/ssl_utils.cc +44 -23
  212. data/src/core/lib/security/security_connector/ssl_utils.h +6 -2
  213. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +27 -24
  214. data/src/core/lib/security/transport/client_auth_filter.cc +10 -9
  215. data/src/core/lib/security/util/json_util.cc +12 -13
  216. data/src/core/lib/slice/slice.cc +38 -1
  217. data/src/core/lib/slice/slice_internal.h +1 -0
  218. data/src/core/lib/surface/call.cc +40 -41
  219. data/src/core/lib/surface/completion_queue.cc +271 -14
  220. data/src/core/lib/surface/completion_queue.h +8 -0
  221. data/src/core/lib/surface/init.cc +2 -0
  222. data/src/core/lib/surface/server.cc +565 -632
  223. data/src/core/lib/surface/server.h +34 -12
  224. data/src/core/lib/surface/version.cc +2 -2
  225. data/src/core/lib/transport/transport.h +6 -0
  226. data/src/core/lib/uri/uri_parser.cc +8 -15
  227. data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
  228. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +23 -13
  229. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -0
  230. data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -0
  231. data/src/core/tsi/ssl_transport_security.cc +102 -11
  232. data/src/core/tsi/ssl_transport_security.h +14 -2
  233. data/src/core/tsi/transport_security_interface.h +5 -0
  234. data/src/ruby/ext/grpc/extconf.rb +5 -2
  235. data/src/ruby/ext/grpc/rb_call.c +3 -2
  236. data/src/ruby/ext/grpc/rb_call.h +4 -0
  237. data/src/ruby/ext/grpc/rb_call_credentials.c +54 -10
  238. data/src/ruby/lib/grpc/generic/interceptors.rb +1 -1
  239. data/src/ruby/lib/grpc/version.rb +1 -1
  240. data/third_party/boringssl-with-bazel/err_data.c +89 -83
  241. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +3 -3
  242. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_enum.c +3 -3
  243. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c +1 -1
  244. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +3 -3
  245. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +2 -2
  246. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +1 -1
  247. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +1 -1
  248. data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +1 -1
  249. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +1 -1
  250. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +1 -1
  251. data/third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c +1 -1
  252. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +1 -0
  253. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +12 -52
  254. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +0 -22
  255. data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +143 -0
  256. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/mode_wrappers.c +17 -1
  257. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +11 -1
  258. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +2 -1
  259. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +13 -11
  260. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-x86_64.c +24 -23
  261. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +20 -16
  262. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +2 -2
  263. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/util.c +3 -3
  264. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +62 -0
  265. data/third_party/boringssl-with-bazel/src/crypto/mem.c +29 -15
  266. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +7 -0
  267. data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +36 -5
  268. data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +0 -29
  269. data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +116 -363
  270. data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +7 -45
  271. data/third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c +4 -4
  272. data/third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c +8 -0
  273. data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +4 -4
  274. data/third_party/boringssl-with-bazel/src/crypto/x509/x509.c +0 -67
  275. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +13 -6
  276. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +10 -0
  277. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +41 -0
  278. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +4 -1
  279. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +28 -9
  280. data/third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c +25 -0
  281. data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +35 -13
  282. data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +0 -154
  283. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +28 -6
  284. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +5 -0
  285. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +74 -35
  286. data/third_party/boringssl-with-bazel/src/include/openssl/aes.h +16 -4
  287. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +22 -22
  288. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +1 -1
  289. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +69 -0
  290. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +33 -16
  291. data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +1 -10
  292. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +789 -715
  293. data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +3 -3
  294. data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +9 -2
  295. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +2 -2
  296. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +9 -0
  297. data/third_party/boringssl-with-bazel/src/ssl/internal.h +17 -14
  298. data/third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc +7 -7
  299. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +28 -0
  300. data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +4 -24
  301. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +5 -5
  302. data/third_party/boringssl-with-bazel/src/ssl/t1_enc.cc +45 -24
  303. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +31 -21
  304. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +12 -9
  305. data/third_party/upb/upb/decode.c +467 -504
  306. data/third_party/upb/upb/encode.c +163 -121
  307. data/third_party/upb/upb/msg.c +130 -64
  308. data/third_party/upb/upb/msg.h +418 -14
  309. data/third_party/upb/upb/port_def.inc +35 -6
  310. data/third_party/upb/upb/port_undef.inc +8 -1
  311. data/third_party/upb/upb/table.c +53 -75
  312. data/third_party/upb/upb/table.int.h +11 -43
  313. data/third_party/upb/upb/upb.c +148 -124
  314. data/third_party/upb/upb/upb.h +65 -147
  315. data/third_party/upb/upb/upb.hpp +86 -0
  316. metadata +40 -37
  317. data/third_party/upb/upb/generated_util.h +0 -105
@@ -146,14 +146,12 @@ const char* severity_string(ChannelTrace::Severity severity) {
146
146
 
147
147
  Json ChannelTrace::TraceEvent::RenderTraceEvent() const {
148
148
  char* description = grpc_slice_to_c_string(data_);
149
- char* ts_str = gpr_format_timespec(timestamp_);
150
149
  Json::Object object = {
151
150
  {"description", description},
152
151
  {"severity", severity_string(severity_)},
153
- {"timestamp", ts_str},
152
+ {"timestamp", gpr_format_timespec(timestamp_)},
154
153
  };
155
154
  gpr_free(description);
156
- gpr_free(ts_str);
157
155
  if (referenced_entity_ != nullptr) {
158
156
  const bool is_channel =
159
157
  (referenced_entity_->type() == BaseNode::EntityType::kTopLevelChannel ||
@@ -171,11 +169,9 @@ Json ChannelTrace::RenderJson() const {
171
169
  if (max_event_memory_ == 0) {
172
170
  return Json(); // JSON null
173
171
  }
174
- char* ts_str = gpr_format_timespec(time_created_);
175
172
  Json::Object object = {
176
- {"creationTimestamp", ts_str},
173
+ {"creationTimestamp", gpr_format_timespec(time_created_)},
177
174
  };
178
- gpr_free(ts_str);
179
175
  if (num_events_logged_ > 0) {
180
176
  object["numEventsLogged"] = std::to_string(num_events_logged_);
181
177
  }
@@ -156,9 +156,7 @@ void CallCountingHelper::PopulateCallCounts(Json::Object* object) {
156
156
  gpr_timespec ts = gpr_convert_clock_type(
157
157
  gpr_cycle_counter_to_time(data.last_call_started_cycle),
158
158
  GPR_CLOCK_REALTIME);
159
- char* ts_str = gpr_format_timespec(ts);
160
- (*object)["lastCallStartedTimestamp"] = ts_str;
161
- gpr_free(ts_str);
159
+ (*object)["lastCallStartedTimestamp"] = gpr_format_timespec(ts);
162
160
  }
163
161
  if (data.calls_succeeded != 0) {
164
162
  (*object)["callsSucceeded"] = std::to_string(data.calls_succeeded);
@@ -456,9 +454,7 @@ Json SocketNode::RenderJson() {
456
454
  ts = gpr_convert_clock_type(
457
455
  gpr_cycle_counter_to_time(last_local_stream_created_cycle),
458
456
  GPR_CLOCK_REALTIME);
459
- char* ts_str = gpr_format_timespec(ts);
460
- data["lastLocalStreamCreatedTimestamp"] = ts_str;
461
- gpr_free(ts_str);
457
+ data["lastLocalStreamCreatedTimestamp"] = gpr_format_timespec(ts);
462
458
  }
463
459
  gpr_cycle_counter last_remote_stream_created_cycle =
464
460
  last_remote_stream_created_cycle_.Load(MemoryOrder::RELAXED);
@@ -466,9 +462,7 @@ Json SocketNode::RenderJson() {
466
462
  ts = gpr_convert_clock_type(
467
463
  gpr_cycle_counter_to_time(last_remote_stream_created_cycle),
468
464
  GPR_CLOCK_REALTIME);
469
- char* ts_str = gpr_format_timespec(ts);
470
- data["lastRemoteStreamCreatedTimestamp"] = ts_str;
471
- gpr_free(ts_str);
465
+ data["lastRemoteStreamCreatedTimestamp"] = gpr_format_timespec(ts);
472
466
  }
473
467
  }
474
468
  int64_t streams_succeeded = streams_succeeded_.Load(MemoryOrder::RELAXED);
@@ -486,9 +480,7 @@ Json SocketNode::RenderJson() {
486
480
  gpr_cycle_counter_to_time(
487
481
  last_message_sent_cycle_.Load(MemoryOrder::RELAXED)),
488
482
  GPR_CLOCK_REALTIME);
489
- char* ts_str = gpr_format_timespec(ts);
490
- data["lastMessageSentTimestamp"] = ts_str;
491
- gpr_free(ts_str);
483
+ data["lastMessageSentTimestamp"] = gpr_format_timespec(ts);
492
484
  }
493
485
  int64_t messages_received = messages_received_.Load(MemoryOrder::RELAXED);
494
486
  if (messages_received != 0) {
@@ -497,9 +489,7 @@ Json SocketNode::RenderJson() {
497
489
  gpr_cycle_counter_to_time(
498
490
  last_message_received_cycle_.Load(MemoryOrder::RELAXED)),
499
491
  GPR_CLOCK_REALTIME);
500
- char* ts_str = gpr_format_timespec(ts);
501
- data["lastMessageReceivedTimestamp"] = ts_str;
502
- gpr_free(ts_str);
492
+ data["lastMessageReceivedTimestamp"] = gpr_format_timespec(ts);
503
493
  }
504
494
  int64_t keepalives_sent = keepalives_sent_.Load(MemoryOrder::RELAXED);
505
495
  if (keepalives_sent != 0) {
@@ -30,7 +30,6 @@
30
30
 
31
31
  #include <grpc/support/alloc.h>
32
32
  #include <grpc/support/log.h>
33
- #include <grpc/support/string_util.h>
34
33
  #include <grpc/support/time.h>
35
34
  #include <inttypes.h>
36
35
  #include <stdarg.h>
@@ -39,6 +38,8 @@
39
38
  #include <sys/syscall.h>
40
39
  #include <time.h>
41
40
  #include <unistd.h>
41
+ #include <string>
42
+ #include "absl/strings/str_format.h"
42
43
 
43
44
  static long sys_gettid(void) { return syscall(__NR_gettid); }
44
45
 
@@ -63,7 +64,6 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
63
64
 
64
65
  void gpr_default_log(gpr_log_func_args* args) {
65
66
  const char* final_slash;
66
- char* prefix;
67
67
  const char* display_file;
68
68
  char time_buffer[64];
69
69
  time_t timer;
@@ -86,12 +86,10 @@ void gpr_default_log(gpr_log_func_args* args) {
86
86
  strcpy(time_buffer, "error:strftime");
87
87
  }
88
88
 
89
- gpr_asprintf(&prefix, "%s%s.%09" PRId32 " %7ld %s:%d]",
90
- gpr_log_severity_string(args->severity), time_buffer,
91
- now.tv_nsec, tid, display_file, args->line);
92
-
93
- fprintf(stderr, "%-60s %s\n", prefix, args->message);
94
- gpr_free(prefix);
89
+ std::string prefix = absl::StrFormat(
90
+ "%s%s.%09" PRId32 " %7ld %s:%d]", gpr_log_severity_string(args->severity),
91
+ time_buffer, now.tv_nsec, tid, display_file, args->line);
92
+ fprintf(stderr, "%-60s %s\n", prefix.c_str(), args->message);
95
93
  }
96
94
 
97
95
  #endif /* GPR_LINUX_LOG */
@@ -22,7 +22,6 @@
22
22
 
23
23
  #include <grpc/support/alloc.h>
24
24
  #include <grpc/support/log.h>
25
- #include <grpc/support/string_util.h>
26
25
  #include <grpc/support/time.h>
27
26
  #include <inttypes.h>
28
27
  #include <pthread.h>
@@ -30,6 +29,8 @@
30
29
  #include <stdio.h>
31
30
  #include <string.h>
32
31
  #include <time.h>
32
+ #include <string>
33
+ #include "absl/strings/str_format.h"
33
34
 
34
35
  static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
35
36
 
@@ -83,13 +84,10 @@ void gpr_default_log(gpr_log_func_args* args) {
83
84
  strcpy(time_buffer, "error:strftime");
84
85
  }
85
86
 
86
- char* prefix;
87
- gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]",
88
- gpr_log_severity_string(args->severity), time_buffer,
89
- (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
90
-
91
- fprintf(stderr, "%-70s %s\n", prefix, args->message);
92
- gpr_free(prefix);
87
+ std::string prefix = absl::StrFormat(
88
+ "%s%s.%09d %7" PRIdPTR " %s:%d]", gpr_log_severity_string(args->severity),
89
+ time_buffer, (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
90
+ fprintf(stderr, "%-70s %s\n", prefix.c_str(), args->message);
93
91
  }
94
92
 
95
93
  #endif /* defined(GPR_POSIX_LOG) */
@@ -28,6 +28,8 @@
28
28
  #include <string.h>
29
29
  #include <time.h>
30
30
 
31
+ #include "absl/strings/str_cat.h"
32
+
31
33
  #include <grpc/support/alloc.h>
32
34
  #include <grpc/support/log.h>
33
35
  #include <grpc/support/string_util.h>
@@ -50,12 +52,7 @@ char* gpr_strdup(const char* src) {
50
52
  return dst;
51
53
  }
52
54
 
53
- struct dump_out {
54
- size_t capacity;
55
- size_t length;
56
- char* data;
57
- };
58
- char* gpr_format_timespec(gpr_timespec tm) {
55
+ std::string gpr_format_timespec(gpr_timespec tm) {
59
56
  char time_buffer[35];
60
57
  char ns_buffer[11]; // '.' + 9 digits of precision
61
58
  struct tm* tm_info = localtime((const time_t*)&tm.tv_sec);
@@ -76,11 +73,15 @@ char* gpr_format_timespec(gpr_timespec tm) {
76
73
  break;
77
74
  }
78
75
  }
79
- char* full_time_str;
80
- gpr_asprintf(&full_time_str, "%s%sZ", time_buffer, ns_buffer);
81
- return full_time_str;
76
+ return absl::StrCat(time_buffer, ns_buffer, "Z");
82
77
  }
83
78
 
79
+ struct dump_out {
80
+ size_t capacity;
81
+ size_t length;
82
+ char* data;
83
+ };
84
+
84
85
  static dump_out dump_out_create(void) {
85
86
  dump_out r = {0, 0, nullptr};
86
87
  return r;
@@ -26,6 +26,8 @@
26
26
  #include <stdbool.h>
27
27
  #include <stddef.h>
28
28
 
29
+ #include <string>
30
+
29
31
  /* String utility functions */
30
32
 
31
33
  /* Flags for gpr_dump function. */
@@ -88,13 +90,13 @@ char* gpr_strjoin_sep(const char** strs, size_t nstrs, const char* sep,
88
90
  void gpr_string_split(const char* input, const char* sep, char*** strs,
89
91
  size_t* nstrs);
90
92
 
91
- /* Returns an allocated string that represents tm according to RFC-3339, and,
93
+ /* Returns a string that represents tm according to RFC-3339, and,
92
94
  more specifically, follows:
93
95
  https://developers.google.com/protocol-buffers/docs/proto3#json
94
96
 
95
97
  Uses RFC 3339, where generated output will always be Z-normalized and uses
96
98
  0, 3, 6 or 9 fractional digits. */
97
- char* gpr_format_timespec(gpr_timespec);
99
+ std::string gpr_format_timespec(gpr_timespec);
98
100
 
99
101
  /** Case insensitive string comparison... return <0 if lower(a)<lower(b), ==0 if
100
102
  lower(a)==lower(b), >0 if lower(a)>lower(b) */
@@ -30,6 +30,10 @@
30
30
  #include <ctype.h>
31
31
  #include <string.h>
32
32
 
33
+ #include <string>
34
+
35
+ #include "absl/strings/str_format.h"
36
+
33
37
  namespace grpc_core {
34
38
 
35
39
  namespace {
@@ -42,12 +46,10 @@ GlobalConfigEnvErrorFunctionType g_global_config_env_error_func =
42
46
  DefaultGlobalConfigEnvErrorFunction;
43
47
 
44
48
  void LogParsingError(const char* name, const char* value) {
45
- char* error_message;
46
- gpr_asprintf(&error_message,
47
- "Illegal value '%s' specified for environment variable '%s'",
48
- value, name);
49
- (*g_global_config_env_error_func)(error_message);
50
- gpr_free(error_message);
49
+ std::string error_message = absl::StrFormat(
50
+ "Illegal value '%s' specified for environment variable '%s'", value,
51
+ name);
52
+ (*g_global_config_env_error_func)(error_message.c_str());
51
53
  }
52
54
 
53
55
  } // namespace
@@ -22,6 +22,10 @@
22
22
 
23
23
  #include <string.h>
24
24
 
25
+ #include <string>
26
+
27
+ #include "absl/strings/str_format.h"
28
+
25
29
  #include <grpc/support/alloc.h>
26
30
  #include <grpc/support/log.h>
27
31
  #include <grpc/support/string_util.h>
@@ -112,11 +116,11 @@ static void append_error(internal_request* req, grpc_error* error) {
112
116
  GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
113
117
  }
114
118
  grpc_resolved_address* addr = &req->addresses->addrs[req->next_address - 1];
115
- grpc_core::UniquePtr<char> addr_text(grpc_sockaddr_to_uri(addr));
119
+ std::string addr_text = grpc_sockaddr_to_uri(addr);
116
120
  req->overall_error = grpc_error_add_child(
117
121
  req->overall_error,
118
122
  grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
119
- grpc_slice_from_moved_string(std::move(addr_text))));
123
+ grpc_slice_from_cpp_string(std::move(addr_text))));
120
124
  }
121
125
 
122
126
  static void do_read(internal_request* req) {
@@ -266,15 +270,14 @@ void grpc_httpcli_get(grpc_httpcli_context* context,
266
270
  grpc_resource_quota* resource_quota,
267
271
  const grpc_httpcli_request* request, grpc_millis deadline,
268
272
  grpc_closure* on_done, grpc_httpcli_response* response) {
269
- char* name;
270
273
  if (g_get_override && g_get_override(request, deadline, on_done, response)) {
271
274
  return;
272
275
  }
273
- gpr_asprintf(&name, "HTTP:GET:%s:%s", request->host, request->http.path);
276
+ std::string name =
277
+ absl::StrFormat("HTTP:GET:%s:%s", request->host, request->http.path);
274
278
  internal_request_begin(context, pollent, resource_quota, request, deadline,
275
- on_done, response, name,
279
+ on_done, response, name.c_str(),
276
280
  grpc_httpcli_format_get_request(request));
277
- gpr_free(name);
278
281
  }
279
282
 
280
283
  void grpc_httpcli_post(grpc_httpcli_context* context,
@@ -284,16 +287,16 @@ void grpc_httpcli_post(grpc_httpcli_context* context,
284
287
  const char* body_bytes, size_t body_size,
285
288
  grpc_millis deadline, grpc_closure* on_done,
286
289
  grpc_httpcli_response* response) {
287
- char* name;
288
290
  if (g_post_override && g_post_override(request, body_bytes, body_size,
289
291
  deadline, on_done, response)) {
290
292
  return;
291
293
  }
292
- gpr_asprintf(&name, "HTTP:POST:%s:%s", request->host, request->http.path);
294
+ std::string name =
295
+ absl::StrFormat("HTTP:POST:%s:%s", request->host, request->http.path);
293
296
  internal_request_begin(
294
297
  context, pollent, resource_quota, request, deadline, on_done, response,
295
- name, grpc_httpcli_format_post_request(request, body_bytes, body_size));
296
- gpr_free(name);
298
+ name.c_str(),
299
+ grpc_httpcli_format_post_request(request, body_bytes, body_size));
297
300
  }
298
301
 
299
302
  void grpc_httpcli_set_override(grpc_httpcli_get_override get,
@@ -22,6 +22,7 @@
22
22
 
23
23
  #include <string.h>
24
24
 
25
+ #include "absl/strings/str_cat.h"
25
26
  #include "absl/strings/string_view.h"
26
27
 
27
28
  #include <grpc/support/alloc.h>
@@ -95,11 +96,10 @@ class grpc_httpcli_ssl_channel_security_connector final
95
96
  /* Check the peer name. */
96
97
  if (secure_peer_name_ != nullptr &&
97
98
  !tsi_ssl_peer_matches_name(&peer, secure_peer_name_)) {
98
- char* msg;
99
- gpr_asprintf(&msg, "Peer name %s is not in peer certificate",
100
- secure_peer_name_);
101
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
102
- gpr_free(msg);
99
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
100
+ absl::StrCat("Peer name ", secure_peer_name_,
101
+ " is not in peer certificate")
102
+ .c_str());
103
103
  }
104
104
  grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
105
105
  tsi_peer_destruct(&peer);
@@ -156,6 +156,7 @@ CFStreamHandle::~CFStreamHandle() {
156
156
  open_event_.DestroyEvent();
157
157
  read_event_.DestroyEvent();
158
158
  write_event_.DestroyEvent();
159
+ dispatch_release(dispatch_queue_);
159
160
  }
160
161
 
161
162
  void CFStreamHandle::NotifyOnOpen(grpc_closure* closure) {
@@ -32,9 +32,12 @@
32
32
  #include <sys/socket.h>
33
33
  #include <sys/types.h>
34
34
 
35
+ #include <string>
36
+
37
+ #include "absl/strings/str_cat.h"
38
+
35
39
  #include <grpc/support/alloc.h>
36
40
  #include <grpc/support/log.h>
37
- #include <grpc/support/string_util.h>
38
41
  #include "src/core/lib/gpr/string.h"
39
42
  #include "src/core/lib/iomgr/tcp_posix.h"
40
43
 
@@ -53,19 +56,16 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
53
56
  grpc_channel_args* args) {
54
57
  int sv[2];
55
58
  grpc_endpoint_pair p;
56
- char* final_name;
57
59
  create_sockets(sv);
58
60
 
59
61
  grpc_core::ExecCtx exec_ctx;
60
62
 
61
- gpr_asprintf(&final_name, "%s:client", name);
62
- p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name, false), args,
63
- "socketpair-server");
64
- gpr_free(final_name);
65
- gpr_asprintf(&final_name, "%s:server", name);
66
- p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name, false), args,
67
- "socketpair-client");
68
- gpr_free(final_name);
63
+ std::string final_name = absl::StrCat(name, ":client");
64
+ p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name.c_str(), false),
65
+ args, "socketpair-server");
66
+ final_name = absl::StrCat(name, ":server");
67
+ p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name.c_str(), false),
68
+ args, "socketpair-client");
69
69
 
70
70
  return p;
71
71
  }
@@ -19,10 +19,13 @@
19
19
  #include <grpc/support/port_platform.h>
20
20
 
21
21
  #ifdef GRPC_CFSTREAM
22
+ #include <string>
23
+
24
+ #include "absl/strings/str_format.h"
25
+
22
26
  #include <CoreFoundation/CoreFoundation.h>
23
27
 
24
28
  #include <grpc/support/alloc.h>
25
- #include <grpc/support/string_util.h>
26
29
 
27
30
  #include "src/core/lib/iomgr/error.h"
28
31
 
@@ -33,7 +36,6 @@ grpc_error* grpc_error_create_from_cferror(const char* file, int line,
33
36
  CFErrorRef error = static_cast<CFErrorRef>(arg);
34
37
  char buf_domain[MAX_ERROR_DESCRIPTION];
35
38
  char buf_desc[MAX_ERROR_DESCRIPTION];
36
- char* error_msg;
37
39
  CFErrorDomain domain = CFErrorGetDomain((error));
38
40
  CFIndex code = CFErrorGetCode((error));
39
41
  CFStringRef desc = CFErrorCopyDescription((error));
@@ -41,12 +43,11 @@ grpc_error* grpc_error_create_from_cferror(const char* file, int line,
41
43
  kCFStringEncodingUTF8);
42
44
  CFStringGetCString(desc, buf_desc, MAX_ERROR_DESCRIPTION,
43
45
  kCFStringEncodingUTF8);
44
- gpr_asprintf(&error_msg, "%s (error domain:%s, code:%ld, description:%s)",
45
- custom_desc, buf_domain, code, buf_desc);
46
+ std::string error_msg =
47
+ absl::StrFormat("%s (error domain:%s, code:%ld, description:%s)",
48
+ custom_desc, buf_domain, code, buf_desc);
46
49
  CFRelease(desc);
47
- grpc_error* return_error = grpc_error_create(
48
- file, line, grpc_slice_from_copied_string(error_msg), NULL, 0);
49
- gpr_free(error_msg);
50
- return return_error;
50
+ return grpc_error_create(
51
+ file, line, grpc_slice_from_copied_string(error_msg.c_str()), NULL, 0);
51
52
  }
52
53
  #endif /* GRPC_CFSTREAM */
@@ -38,14 +38,15 @@
38
38
  #include <sys/socket.h>
39
39
  #include <unistd.h>
40
40
 
41
+ #include <string>
41
42
  #include <vector>
42
43
 
44
+ #include "absl/strings/str_cat.h"
43
45
  #include "absl/strings/str_format.h"
44
46
  #include "absl/strings/str_join.h"
45
47
 
46
48
  #include <grpc/support/alloc.h>
47
49
  #include <grpc/support/cpu.h>
48
- #include <grpc/support/string_util.h>
49
50
 
50
51
  #include "src/core/lib/debug/stats.h"
51
52
  #include "src/core/lib/gpr/string.h"
@@ -351,16 +352,14 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
351
352
 
352
353
  new_fd->freelist_next = nullptr;
353
354
 
354
- char* fd_name;
355
- gpr_asprintf(&fd_name, "%s fd=%d", name, fd);
356
- grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name);
355
+ std::string fd_name = absl::StrCat(name, " fd=", fd);
356
+ grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name.c_str());
357
357
  fork_fd_list_add_grpc_fd(new_fd);
358
358
  #ifndef NDEBUG
359
359
  if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) {
360
- gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, new_fd, fd_name);
360
+ gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, new_fd, fd_name.c_str());
361
361
  }
362
362
  #endif
363
- gpr_free(fd_name);
364
363
 
365
364
  struct epoll_event ev;
366
365
  ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLOUT | EPOLLET);