grpc 1.2.5 → 1.3.4

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 (327) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1434 -399
  3. data/etc/roots.pem +34 -150
  4. data/include/grpc/grpc.h +71 -0
  5. data/include/grpc/impl/codegen/atm.h +5 -0
  6. data/include/grpc/impl/codegen/atm_gcc_atomic.h +6 -0
  7. data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
  8. data/include/grpc/impl/codegen/atm_windows.h +11 -0
  9. data/include/grpc/impl/codegen/grpc_types.h +54 -13
  10. data/include/grpc/impl/codegen/port_platform.h +15 -1
  11. data/include/grpc/support/alloc.h +2 -1
  12. data/include/grpc/support/sync.h +4 -0
  13. data/include/grpc/support/tls.h +1 -1
  14. data/src/core/ext/census/gen/trace_context.pb.h +1 -1
  15. data/src/core/ext/census/grpc_filter.c +14 -10
  16. data/src/core/ext/census/grpc_plugin.c +3 -1
  17. data/src/core/ext/census/trace_label.h +1 -1
  18. data/src/core/ext/census/trace_propagation.h +1 -1
  19. data/src/core/ext/census/trace_status.h +1 -1
  20. data/src/core/ext/census/trace_string.h +1 -1
  21. data/src/core/ext/census/tracing.h +1 -1
  22. data/src/core/ext/{client_channel → filters/client_channel}/channel_connectivity.c +56 -27
  23. data/src/core/ext/{client_channel → filters/client_channel}/client_channel.c +407 -202
  24. data/src/core/ext/{client_channel → filters/client_channel}/client_channel.h +10 -6
  25. data/src/core/ext/{client_channel → filters/client_channel}/client_channel_factory.c +1 -1
  26. data/src/core/ext/{client_channel → filters/client_channel}/client_channel_factory.h +4 -4
  27. data/src/core/ext/{client_channel → filters/client_channel}/client_channel_plugin.c +12 -7
  28. data/src/core/ext/{client_channel → filters/client_channel}/connector.c +1 -1
  29. data/src/core/ext/{client_channel → filters/client_channel}/connector.h +3 -5
  30. data/src/core/ext/{client_channel → filters/client_channel}/http_connect_handshaker.c +6 -6
  31. data/src/core/ext/{client_channel → filters/client_channel}/http_connect_handshaker.h +3 -3
  32. data/src/core/ext/{client_channel → filters/client_channel}/http_proxy.c +4 -4
  33. data/src/core/ext/{client_channel → filters/client_channel}/http_proxy.h +3 -3
  34. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy.c +1 -1
  35. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy.h +4 -4
  36. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb.c +22 -20
  37. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb.h +4 -4
  38. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb_channel.h +5 -4
  39. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb_channel_secure.c +2 -2
  40. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/load_balancer_api.c +1 -1
  41. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/load_balancer_api.h +6 -5
  42. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +1 -1
  43. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +0 -0
  44. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/pick_first/pick_first.c +20 -15
  45. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/round_robin/round_robin.c +21 -16
  46. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_factory.c +1 -1
  47. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_factory.h +5 -5
  48. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_registry.c +1 -1
  49. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_registry.h +4 -4
  50. data/src/core/ext/{client_channel → filters/client_channel}/parse_address.c +1 -1
  51. data/src/core/ext/{client_channel → filters/client_channel}/parse_address.h +4 -4
  52. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper.c +1 -1
  53. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper.h +3 -3
  54. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper_registry.c +10 -4
  55. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper_registry.h +4 -4
  56. data/src/core/ext/{client_channel → filters/client_channel}/resolver.c +1 -1
  57. data/src/core/ext/{client_channel → filters/client_channel}/resolver.h +4 -4
  58. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c +350 -0
  59. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +66 -0
  60. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c +319 -0
  61. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +289 -0
  62. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +64 -0
  63. data/src/core/ext/{resolver → filters/client_channel/resolver}/dns/native/dns_resolver.c +21 -5
  64. data/src/core/ext/{resolver → filters/client_channel/resolver}/sockaddr/sockaddr_resolver.c +3 -3
  65. data/src/core/ext/{client_channel → filters/client_channel}/resolver_factory.c +1 -1
  66. data/src/core/ext/{client_channel → filters/client_channel}/resolver_factory.h +6 -6
  67. data/src/core/ext/{client_channel → filters/client_channel}/resolver_registry.c +1 -2
  68. data/src/core/ext/{client_channel → filters/client_channel}/resolver_registry.h +4 -4
  69. data/src/core/ext/filters/client_channel/retry_throttle.c +210 -0
  70. data/src/core/ext/filters/client_channel/retry_throttle.h +65 -0
  71. data/src/core/ext/{client_channel → filters/client_channel}/subchannel.c +49 -43
  72. data/src/core/ext/{client_channel → filters/client_channel}/subchannel.h +21 -7
  73. data/src/core/ext/{client_channel → filters/client_channel}/subchannel_index.c +1 -1
  74. data/src/core/ext/{client_channel → filters/client_channel}/subchannel_index.h +5 -5
  75. data/src/core/ext/{client_channel → filters/client_channel}/uri_parser.c +1 -1
  76. data/src/core/ext/{client_channel → filters/client_channel}/uri_parser.h +3 -3
  77. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting.c +4 -2
  78. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting.h +3 -3
  79. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting_filter.c +17 -14
  80. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting_filter.h +4 -4
  81. data/src/core/ext/filters/max_age/max_age_filter.c +439 -0
  82. data/src/core/ext/filters/max_age/max_age_filter.h +39 -0
  83. data/src/core/ext/transport/chttp2/client/chttp2_connector.c +6 -41
  84. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +1 -1
  85. data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +2 -2
  86. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +3 -3
  87. data/src/core/ext/transport/chttp2/server/chttp2_server.c +2 -2
  88. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +2 -5
  89. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +2 -2
  90. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +449 -204
  91. data/src/core/ext/transport/chttp2/transport/frame_data.c +10 -7
  92. data/src/core/ext/transport/chttp2/transport/frame_goaway.c +3 -2
  93. data/src/core/ext/transport/chttp2/transport/frame_ping.c +37 -7
  94. data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
  95. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +4 -3
  96. data/src/core/ext/transport/chttp2/transport/frame_settings.c +18 -38
  97. data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -29
  98. data/src/core/ext/transport/chttp2/transport/frame_window_update.c +2 -2
  99. data/src/core/ext/transport/chttp2/transport/hpack_encoder.c +64 -37
  100. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +11 -4
  101. data/src/core/ext/transport/chttp2/transport/hpack_parser.c +60 -39
  102. data/src/core/ext/transport/chttp2/transport/hpack_table.c +2 -2
  103. data/src/core/ext/transport/chttp2/transport/http2_settings.c +75 -0
  104. data/src/core/ext/transport/chttp2/transport/http2_settings.h +74 -0
  105. data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +22 -43
  106. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +8 -10
  107. data/src/core/ext/transport/chttp2/transport/internal.h +24 -2
  108. data/src/core/ext/transport/chttp2/transport/parsing.c +33 -15
  109. data/src/core/ext/transport/chttp2/transport/writing.c +56 -10
  110. data/src/core/lib/channel/channel_args.c +7 -0
  111. data/src/core/lib/channel/channel_args.h +2 -0
  112. data/src/core/lib/channel/channel_stack.c +20 -27
  113. data/src/core/lib/channel/channel_stack.h +18 -16
  114. data/src/core/lib/channel/compress_filter.c +20 -18
  115. data/src/core/lib/channel/connected_channel.c +9 -8
  116. data/src/core/lib/channel/deadline_filter.c +28 -24
  117. data/src/core/lib/channel/deadline_filter.h +3 -3
  118. data/src/core/lib/channel/handshaker.c +3 -2
  119. data/src/core/lib/channel/http_client_filter.c +119 -61
  120. data/src/core/lib/channel/http_server_filter.c +124 -69
  121. data/src/core/lib/channel/message_size_filter.c +23 -19
  122. data/src/core/lib/http/httpcli.c +8 -6
  123. data/src/core/lib/http/httpcli_security_connector.c +5 -5
  124. data/src/core/lib/http/parser.c +57 -31
  125. data/src/core/lib/iomgr/closure.c +15 -0
  126. data/src/core/lib/iomgr/closure.h +4 -0
  127. data/src/core/lib/iomgr/combiner.c +8 -0
  128. data/src/core/lib/iomgr/endpoint_pair.h +2 -3
  129. data/src/core/lib/iomgr/endpoint_pair_posix.c +10 -7
  130. data/src/core/lib/iomgr/endpoint_pair_uv.c +2 -3
  131. data/src/core/lib/iomgr/endpoint_pair_windows.c +9 -6
  132. data/src/core/lib/iomgr/error.c +360 -177
  133. data/src/core/lib/iomgr/error.h +31 -33
  134. data/src/core/lib/iomgr/error_internal.h +30 -9
  135. data/src/core/lib/iomgr/ev_epoll_linux.c +25 -239
  136. data/src/core/lib/iomgr/ev_poll_posix.c +11 -7
  137. data/src/core/lib/iomgr/ev_posix.c +6 -0
  138. data/src/core/lib/iomgr/ev_posix.h +3 -0
  139. data/src/core/lib/iomgr/exec_ctx.c +6 -0
  140. data/src/core/lib/iomgr/executor.c +8 -2
  141. data/src/core/lib/iomgr/load_file.c +6 -3
  142. data/src/core/lib/iomgr/lockfree_event.c +238 -0
  143. data/src/core/{ext/client_channel/initial_connect_string.h → lib/iomgr/lockfree_event.h} +17 -13
  144. data/src/core/lib/iomgr/pollset.h +4 -0
  145. data/src/core/lib/iomgr/pollset_windows.c +2 -2
  146. data/src/core/lib/iomgr/port.h +9 -0
  147. data/src/core/lib/iomgr/resolve_address_posix.c +15 -9
  148. data/src/core/lib/iomgr/resolve_address_uv.c +8 -6
  149. data/src/core/lib/iomgr/resolve_address_windows.c +2 -2
  150. data/src/core/lib/iomgr/resource_quota.c +19 -4
  151. data/src/core/lib/iomgr/resource_quota.h +2 -0
  152. data/src/core/lib/iomgr/sockaddr_utils.c +3 -1
  153. data/src/core/lib/iomgr/socket_factory_posix.c +110 -0
  154. data/src/core/lib/iomgr/socket_factory_posix.h +90 -0
  155. data/src/core/lib/iomgr/socket_utils_common_posix.c +25 -9
  156. data/src/core/lib/iomgr/socket_utils_posix.h +7 -0
  157. data/src/core/lib/iomgr/tcp_client.h +0 -4
  158. data/src/core/lib/iomgr/tcp_client_posix.c +15 -31
  159. data/src/core/lib/iomgr/tcp_client_uv.c +10 -6
  160. data/src/core/lib/iomgr/tcp_client_windows.c +9 -19
  161. data/src/core/lib/iomgr/tcp_posix.c +111 -22
  162. data/src/core/lib/iomgr/tcp_posix.h +3 -4
  163. data/src/core/lib/iomgr/tcp_server_posix.c +39 -417
  164. data/src/core/lib/iomgr/tcp_server_utils_posix.h +135 -0
  165. data/src/core/lib/iomgr/tcp_server_utils_posix_common.c +221 -0
  166. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c +196 -0
  167. data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c +49 -0
  168. data/src/core/lib/iomgr/tcp_server_uv.c +43 -16
  169. data/src/core/lib/iomgr/tcp_server_windows.c +10 -22
  170. data/src/core/lib/iomgr/tcp_uv.c +16 -13
  171. data/src/core/lib/iomgr/tcp_windows.c +24 -12
  172. data/src/core/lib/iomgr/tcp_windows.h +2 -2
  173. data/src/core/lib/iomgr/timer.h +3 -0
  174. data/src/core/lib/iomgr/timer_generic.c +257 -72
  175. data/src/core/lib/iomgr/timer_generic.h +1 -1
  176. data/src/core/lib/iomgr/timer_heap.c +8 -8
  177. data/src/core/lib/iomgr/udp_server.c +54 -24
  178. data/src/core/lib/iomgr/udp_server.h +7 -7
  179. data/src/core/lib/iomgr/unix_sockets_posix.c +1 -1
  180. data/src/core/lib/iomgr/unix_sockets_posix_noop.c +2 -1
  181. data/src/core/lib/iomgr/wakeup_fd_posix.h +1 -1
  182. data/src/core/lib/profiling/basic_timers.c +1 -1
  183. data/src/core/lib/security/credentials/credentials.h +1 -1
  184. data/src/core/lib/security/credentials/google_default/google_default_credentials.c +10 -9
  185. data/src/core/lib/security/credentials/jwt/json_token.c +1 -1
  186. data/src/core/lib/security/credentials/jwt/jwt_verifier.c +2 -2
  187. data/src/core/lib/security/transport/client_auth_filter.c +33 -26
  188. data/src/core/lib/security/transport/secure_endpoint.c +8 -5
  189. data/src/core/lib/security/transport/security_connector.c +37 -37
  190. data/src/core/lib/security/transport/security_connector.h +1 -1
  191. data/src/core/lib/security/transport/security_handshaker.c +15 -12
  192. data/src/core/lib/security/transport/server_auth_filter.c +20 -18
  193. data/src/core/lib/security/transport/tsi_error.c +5 -3
  194. data/src/core/lib/security/transport/tsi_error.h +1 -1
  195. data/src/core/lib/{security/util → slice}/b64.c +21 -6
  196. data/src/core/lib/{security/util → slice}/b64.h +16 -4
  197. data/src/core/lib/slice/slice.c +4 -2
  198. data/src/core/lib/slice/slice_buffer.c +16 -14
  199. data/src/core/lib/support/arena.c +98 -0
  200. data/src/core/{ext/client_channel/initial_connect_string.c → lib/support/arena.h} +17 -15
  201. data/src/core/{ext/client_channel/default_initial_connect_string.c → lib/support/atm.c} +14 -5
  202. data/src/core/lib/support/cpu_linux.c +5 -0
  203. data/src/core/lib/support/sync.c +4 -0
  204. data/src/core/lib/support/time.c +4 -10
  205. data/src/core/lib/support/wrap_memcpy.c +3 -1
  206. data/src/core/lib/surface/call.c +252 -221
  207. data/src/core/lib/surface/channel.c +72 -21
  208. data/src/core/lib/surface/channel.h +8 -0
  209. data/src/core/lib/surface/completion_queue.c +2 -3
  210. data/src/core/lib/surface/completion_queue_factory.c +77 -0
  211. data/src/core/lib/surface/completion_queue_factory.h +51 -0
  212. data/src/core/lib/surface/init_secure.c +3 -1
  213. data/src/core/lib/surface/lame_client.c +18 -14
  214. data/src/core/lib/surface/server.c +43 -41
  215. data/src/core/lib/surface/validate_metadata.c +8 -4
  216. data/src/core/lib/surface/version.c +2 -2
  217. data/src/core/lib/transport/bdp_estimator.h +1 -1
  218. data/src/core/lib/transport/connectivity_state.c +2 -1
  219. data/src/core/lib/transport/error_utils.c +17 -17
  220. data/src/core/lib/transport/error_utils.h +1 -1
  221. data/src/core/lib/transport/metadata_batch.c +6 -7
  222. data/src/core/lib/transport/pid_controller.c +1 -0
  223. data/src/core/lib/transport/service_config.c +12 -0
  224. data/src/core/lib/transport/service_config.h +6 -0
  225. data/src/core/lib/transport/transport.c +29 -17
  226. data/src/core/lib/transport/transport.h +85 -42
  227. data/src/core/lib/transport/transport_impl.h +5 -3
  228. data/src/core/lib/transport/transport_op_string.c +20 -14
  229. data/src/core/plugin_registry/grpc_plugin_registry.c +8 -0
  230. data/src/core/{lib/tsi → tsi}/fake_transport_security.c +2 -2
  231. data/src/core/{lib/tsi → tsi}/fake_transport_security.h +4 -4
  232. data/src/core/{lib/tsi → tsi}/ssl_transport_security.c +40 -79
  233. data/src/core/{lib/tsi → tsi}/ssl_transport_security.h +44 -21
  234. data/src/core/{lib/tsi → tsi}/ssl_types.h +3 -3
  235. data/src/core/{lib/tsi → tsi}/transport_security.c +2 -2
  236. data/src/core/{lib/tsi → tsi}/transport_security.h +4 -4
  237. data/src/core/{lib/tsi → tsi}/transport_security_interface.h +3 -3
  238. data/src/ruby/ext/grpc/extconf.rb +1 -0
  239. data/src/ruby/ext/grpc/rb_call_credentials.c +2 -2
  240. data/src/ruby/ext/grpc/rb_channel.c +520 -93
  241. data/src/ruby/ext/grpc/rb_channel.h +2 -0
  242. data/src/ruby/ext/grpc/rb_channel_credentials.c +3 -0
  243. data/src/ruby/ext/grpc/rb_compression_options.c +5 -2
  244. data/src/ruby/ext/grpc/rb_event_thread.c +6 -6
  245. data/src/ruby/ext/grpc/rb_grpc.c +29 -7
  246. data/src/ruby/ext/grpc/rb_grpc.h +2 -0
  247. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +10 -0
  248. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +15 -0
  249. data/src/ruby/ext/grpc/rb_server.c +5 -3
  250. data/src/ruby/lib/grpc/version.rb +1 -1
  251. data/src/ruby/spec/channel_connection_spec.rb +173 -0
  252. data/src/ruby/spec/channel_spec.rb +29 -0
  253. data/src/ruby/spec/generic/rpc_server_pool_spec.rb +27 -17
  254. data/third_party/cares/ares_build.h +264 -0
  255. data/third_party/cares/cares/ares.h +636 -0
  256. data/third_party/cares/cares/ares__close_sockets.c +61 -0
  257. data/third_party/cares/cares/ares__get_hostent.c +261 -0
  258. data/third_party/cares/cares/ares__read_line.c +73 -0
  259. data/third_party/cares/cares/ares__timeval.c +111 -0
  260. data/third_party/cares/cares/ares_cancel.c +63 -0
  261. data/third_party/cares/cares/ares_create_query.c +202 -0
  262. data/third_party/cares/cares/ares_data.c +221 -0
  263. data/third_party/cares/cares/ares_data.h +72 -0
  264. data/third_party/cares/cares/ares_destroy.c +108 -0
  265. data/third_party/cares/cares/ares_dns.h +103 -0
  266. data/third_party/cares/cares/ares_expand_name.c +205 -0
  267. data/third_party/cares/cares/ares_expand_string.c +70 -0
  268. data/third_party/cares/cares/ares_fds.c +59 -0
  269. data/third_party/cares/cares/ares_free_hostent.c +41 -0
  270. data/third_party/cares/cares/ares_free_string.c +25 -0
  271. data/third_party/cares/cares/ares_getenv.c +30 -0
  272. data/third_party/cares/cares/ares_getenv.h +26 -0
  273. data/third_party/cares/cares/ares_gethostbyaddr.c +294 -0
  274. data/third_party/cares/cares/ares_gethostbyname.c +518 -0
  275. data/third_party/cares/cares/ares_getnameinfo.c +422 -0
  276. data/third_party/cares/cares/ares_getopt.c +122 -0
  277. data/third_party/cares/cares/ares_getopt.h +53 -0
  278. data/third_party/cares/cares/ares_getsock.c +66 -0
  279. data/third_party/cares/cares/ares_inet_net_pton.h +25 -0
  280. data/third_party/cares/cares/ares_init.c +2146 -0
  281. data/third_party/cares/cares/ares_iphlpapi.h +221 -0
  282. data/third_party/cares/cares/ares_ipv6.h +78 -0
  283. data/third_party/cares/cares/ares_library_init.c +167 -0
  284. data/third_party/cares/cares/ares_library_init.h +42 -0
  285. data/third_party/cares/cares/ares_llist.c +63 -0
  286. data/third_party/cares/cares/ares_llist.h +39 -0
  287. data/third_party/cares/cares/ares_mkquery.c +24 -0
  288. data/third_party/cares/cares/ares_nowarn.c +260 -0
  289. data/third_party/cares/cares/ares_nowarn.h +61 -0
  290. data/third_party/cares/cares/ares_options.c +402 -0
  291. data/third_party/cares/cares/ares_parse_a_reply.c +264 -0
  292. data/third_party/cares/cares/ares_parse_aaaa_reply.c +264 -0
  293. data/third_party/cares/cares/ares_parse_mx_reply.c +170 -0
  294. data/third_party/cares/cares/ares_parse_naptr_reply.c +188 -0
  295. data/third_party/cares/cares/ares_parse_ns_reply.c +183 -0
  296. data/third_party/cares/cares/ares_parse_ptr_reply.c +219 -0
  297. data/third_party/cares/cares/ares_parse_soa_reply.c +133 -0
  298. data/third_party/cares/cares/ares_parse_srv_reply.c +179 -0
  299. data/third_party/cares/cares/ares_parse_txt_reply.c +220 -0
  300. data/third_party/cares/cares/ares_platform.c +11035 -0
  301. data/third_party/cares/cares/ares_platform.h +43 -0
  302. data/third_party/cares/cares/ares_private.h +363 -0
  303. data/third_party/cares/cares/ares_process.c +1359 -0
  304. data/third_party/cares/cares/ares_query.c +186 -0
  305. data/third_party/cares/cares/ares_rules.h +125 -0
  306. data/third_party/cares/cares/ares_search.c +316 -0
  307. data/third_party/cares/cares/ares_send.c +131 -0
  308. data/third_party/cares/cares/ares_setup.h +217 -0
  309. data/third_party/cares/cares/ares_strcasecmp.c +66 -0
  310. data/third_party/cares/cares/ares_strcasecmp.h +30 -0
  311. data/third_party/cares/cares/ares_strdup.c +49 -0
  312. data/third_party/cares/cares/ares_strdup.h +24 -0
  313. data/third_party/cares/cares/ares_strerror.c +56 -0
  314. data/third_party/cares/cares/ares_timeout.c +88 -0
  315. data/third_party/cares/cares/ares_version.c +11 -0
  316. data/third_party/cares/cares/ares_version.h +24 -0
  317. data/third_party/cares/cares/ares_writev.c +79 -0
  318. data/third_party/cares/cares/bitncmp.c +59 -0
  319. data/third_party/cares/cares/bitncmp.h +26 -0
  320. data/third_party/cares/cares/config-win32.h +377 -0
  321. data/third_party/cares/cares/inet_net_pton.c +450 -0
  322. data/third_party/cares/cares/inet_ntop.c +208 -0
  323. data/third_party/cares/cares/setup_once.h +554 -0
  324. data/third_party/cares/cares/windows_port.c +22 -0
  325. data/third_party/cares/config_darwin/ares_config.h +523 -0
  326. data/third_party/cares/config_linux/ares_config.h +524 -0
  327. metadata +164 -68
@@ -37,6 +37,7 @@
37
37
  #include <grpc/support/log.h>
38
38
  #include <string.h>
39
39
  #include "src/core/lib/profiling/timers.h"
40
+ #include "src/core/lib/slice/b64.h"
40
41
  #include "src/core/lib/slice/percent_encoding.h"
41
42
  #include "src/core/lib/slice/slice_internal.h"
42
43
  #include "src/core/lib/slice/slice_string_helpers.h"
@@ -51,17 +52,16 @@ typedef struct call_data {
51
52
  grpc_linked_mdelem status;
52
53
  grpc_linked_mdelem content_type;
53
54
 
54
- /* did this request come with payload-bin */
55
- bool seen_payload_bin;
55
+ /* did this request come with path query containing request payload */
56
+ bool seen_path_with_query;
56
57
  /* flag to ensure payload_bin is delivered only once */
57
58
  bool payload_bin_delivered;
58
59
 
59
60
  grpc_metadata_batch *recv_initial_metadata;
60
- bool *recv_idempotent_request;
61
- bool *recv_cacheable_request;
61
+ uint32_t *recv_initial_metadata_flags;
62
62
  /** Closure to call when finished with the hs_on_recv hook */
63
63
  grpc_closure *on_done_recv;
64
- /** Closure to call when we retrieve read message from the payload-bin header
64
+ /** Closure to call when we retrieve read message from the path URI
65
65
  */
66
66
  grpc_closure *recv_message_ready;
67
67
  grpc_closure *on_complete;
@@ -101,7 +101,7 @@ static void add_error(const char *error_name, grpc_error **cumulative,
101
101
  grpc_error *new) {
102
102
  if (new == GRPC_ERROR_NONE) return;
103
103
  if (*cumulative == GRPC_ERROR_NONE) {
104
- *cumulative = GRPC_ERROR_CREATE(error_name);
104
+ *cumulative = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_name);
105
105
  }
106
106
  *cumulative = grpc_error_add_child(*cumulative, new);
107
107
  }
@@ -115,37 +115,49 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
115
115
 
116
116
  if (b->idx.named.method != NULL) {
117
117
  if (grpc_mdelem_eq(b->idx.named.method->md, GRPC_MDELEM_METHOD_POST)) {
118
- *calld->recv_idempotent_request = false;
119
- *calld->recv_cacheable_request = false;
118
+ *calld->recv_initial_metadata_flags &=
119
+ ~(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST |
120
+ GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
120
121
  } else if (grpc_mdelem_eq(b->idx.named.method->md,
121
122
  GRPC_MDELEM_METHOD_PUT)) {
122
- *calld->recv_idempotent_request = true;
123
+ *calld->recv_initial_metadata_flags &=
124
+ ~GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
125
+ *calld->recv_initial_metadata_flags |=
126
+ GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
123
127
  } else if (grpc_mdelem_eq(b->idx.named.method->md,
124
128
  GRPC_MDELEM_METHOD_GET)) {
125
- *calld->recv_cacheable_request = true;
129
+ *calld->recv_initial_metadata_flags |=
130
+ GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
131
+ *calld->recv_initial_metadata_flags &=
132
+ ~GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
126
133
  } else {
127
134
  add_error(error_name, &error,
128
- grpc_attach_md_to_error(GRPC_ERROR_CREATE("Bad header"),
129
- b->idx.named.method->md));
135
+ grpc_attach_md_to_error(
136
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
137
+ b->idx.named.method->md));
130
138
  }
131
139
  grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.method);
132
140
  } else {
133
- add_error(error_name, &error,
134
- grpc_error_set_str(GRPC_ERROR_CREATE("Missing header"),
135
- GRPC_ERROR_STR_KEY, ":method"));
141
+ add_error(
142
+ error_name, &error,
143
+ grpc_error_set_str(
144
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
145
+ GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":method")));
136
146
  }
137
147
 
138
148
  if (b->idx.named.te != NULL) {
139
149
  if (!grpc_mdelem_eq(b->idx.named.te->md, GRPC_MDELEM_TE_TRAILERS)) {
140
150
  add_error(error_name, &error,
141
- grpc_attach_md_to_error(GRPC_ERROR_CREATE("Bad header"),
142
- b->idx.named.te->md));
151
+ grpc_attach_md_to_error(
152
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
153
+ b->idx.named.te->md));
143
154
  }
144
155
  grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.te);
145
156
  } else {
146
157
  add_error(error_name, &error,
147
- grpc_error_set_str(GRPC_ERROR_CREATE("Missing header"),
148
- GRPC_ERROR_STR_KEY, "te"));
158
+ grpc_error_set_str(
159
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
160
+ GRPC_ERROR_STR_KEY, grpc_slice_from_static_string("te")));
149
161
  }
150
162
 
151
163
  if (b->idx.named.scheme != NULL) {
@@ -153,14 +165,17 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
153
165
  !grpc_mdelem_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTPS) &&
154
166
  !grpc_mdelem_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_GRPC)) {
155
167
  add_error(error_name, &error,
156
- grpc_attach_md_to_error(GRPC_ERROR_CREATE("Bad header"),
157
- b->idx.named.scheme->md));
168
+ grpc_attach_md_to_error(
169
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
170
+ b->idx.named.scheme->md));
158
171
  }
159
172
  grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.scheme);
160
173
  } else {
161
- add_error(error_name, &error,
162
- grpc_error_set_str(GRPC_ERROR_CREATE("Missing header"),
163
- GRPC_ERROR_STR_KEY, ":scheme"));
174
+ add_error(
175
+ error_name, &error,
176
+ grpc_error_set_str(
177
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
178
+ GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":scheme")));
164
179
  }
165
180
 
166
181
  if (b->idx.named.content_type != NULL) {
@@ -194,8 +209,47 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
194
209
 
195
210
  if (b->idx.named.path == NULL) {
196
211
  add_error(error_name, &error,
197
- grpc_error_set_str(GRPC_ERROR_CREATE("Missing header"),
198
- GRPC_ERROR_STR_KEY, ":path"));
212
+ grpc_error_set_str(
213
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
214
+ GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":path")));
215
+ } else if (*calld->recv_initial_metadata_flags &
216
+ GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) {
217
+ /* We have a cacheable request made with GET verb. The path contains the
218
+ * query parameter which is base64 encoded request payload. */
219
+ const char k_query_separator = '?';
220
+ grpc_slice path_slice = GRPC_MDVALUE(b->idx.named.path->md);
221
+ uint8_t *path_ptr = (uint8_t *)GRPC_SLICE_START_PTR(path_slice);
222
+ size_t path_length = GRPC_SLICE_LENGTH(path_slice);
223
+ /* offset of the character '?' */
224
+ size_t offset = 0;
225
+ for (offset = 0; offset < path_length && *path_ptr != k_query_separator;
226
+ path_ptr++, offset++)
227
+ ;
228
+ if (offset < path_length) {
229
+ grpc_slice query_slice =
230
+ grpc_slice_sub(path_slice, offset + 1, path_length);
231
+
232
+ /* substitute path metadata with just the path (not query) */
233
+ grpc_mdelem mdelem_path_without_query = grpc_mdelem_from_slices(
234
+ exec_ctx, GRPC_MDSTR_PATH, grpc_slice_sub(path_slice, 0, offset));
235
+
236
+ grpc_metadata_batch_substitute(exec_ctx, b, b->idx.named.path,
237
+ mdelem_path_without_query);
238
+
239
+ /* decode payload from query and add to the slice buffer to be returned */
240
+ const int k_url_safe = 1;
241
+ grpc_slice_buffer_add(
242
+ &calld->read_slice_buffer,
243
+ grpc_base64_decode(exec_ctx,
244
+ (const char *)GRPC_SLICE_START_PTR(query_slice),
245
+ k_url_safe));
246
+ grpc_slice_buffer_stream_init(&calld->read_stream,
247
+ &calld->read_slice_buffer, 0);
248
+ calld->seen_path_with_query = true;
249
+ grpc_slice_unref_internal(exec_ctx, query_slice);
250
+ } else {
251
+ gpr_log(GPR_ERROR, "GET request without QUERY");
252
+ }
199
253
  }
200
254
 
201
255
  if (b->idx.named.host != NULL && b->idx.named.authority == NULL) {
@@ -212,19 +266,11 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
212
266
  }
213
267
 
214
268
  if (b->idx.named.authority == NULL) {
215
- add_error(error_name, &error,
216
- grpc_error_set_str(GRPC_ERROR_CREATE("Missing header"),
217
- GRPC_ERROR_STR_KEY, ":authority"));
218
- }
219
-
220
- if (b->idx.named.grpc_payload_bin != NULL) {
221
- calld->seen_payload_bin = true;
222
- grpc_slice_buffer_add(&calld->read_slice_buffer,
223
- grpc_slice_ref_internal(
224
- GRPC_MDVALUE(b->idx.named.grpc_payload_bin->md)));
225
- grpc_slice_buffer_stream_init(&calld->read_stream,
226
- &calld->read_slice_buffer, 0);
227
- grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.grpc_payload_bin);
269
+ add_error(
270
+ error_name, &error,
271
+ grpc_error_set_str(
272
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
273
+ GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":authority")));
228
274
  }
229
275
 
230
276
  return error;
@@ -247,8 +293,8 @@ static void hs_on_complete(grpc_exec_ctx *exec_ctx, void *user_data,
247
293
  grpc_error *err) {
248
294
  grpc_call_element *elem = user_data;
249
295
  call_data *calld = elem->call_data;
250
- /* Call recv_message_ready if we got the payload via the header field */
251
- if (calld->seen_payload_bin && calld->recv_message_ready != NULL) {
296
+ /* Call recv_message_ready if we got the payload via the path field */
297
+ if (calld->seen_path_with_query && calld->recv_message_ready != NULL) {
252
298
  *calld->pp_recv_message = calld->payload_bin_delivered
253
299
  ? NULL
254
300
  : (grpc_byte_stream *)&calld->read_stream;
@@ -263,7 +309,7 @@ static void hs_recv_message_ready(grpc_exec_ctx *exec_ctx, void *user_data,
263
309
  grpc_error *err) {
264
310
  grpc_call_element *elem = user_data;
265
311
  call_data *calld = elem->call_data;
266
- if (calld->seen_payload_bin) {
312
+ if (calld->seen_path_with_query) {
267
313
  /* do nothing. This is probably a GET request, and payload will be returned
268
314
  in hs_on_complete callback. */
269
315
  } else {
@@ -272,45 +318,53 @@ static void hs_recv_message_ready(grpc_exec_ctx *exec_ctx, void *user_data,
272
318
  }
273
319
 
274
320
  static void hs_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
275
- grpc_transport_stream_op *op) {
321
+ grpc_transport_stream_op_batch *op) {
276
322
  /* grab pointers to our data from the call element */
277
323
  call_data *calld = elem->call_data;
278
324
 
279
- if (op->send_initial_metadata != NULL) {
325
+ if (op->send_initial_metadata) {
280
326
  grpc_error *error = GRPC_ERROR_NONE;
281
327
  static const char *error_name = "Failed sending initial metadata";
282
- add_error(error_name, &error, grpc_metadata_batch_add_head(
283
- exec_ctx, op->send_initial_metadata,
284
- &calld->status, GRPC_MDELEM_STATUS_200));
285
- add_error(error_name, &error,
286
- grpc_metadata_batch_add_tail(
287
- exec_ctx, op->send_initial_metadata, &calld->content_type,
288
- GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC));
328
+ add_error(
329
+ error_name, &error,
330
+ grpc_metadata_batch_add_head(
331
+ exec_ctx, op->payload->send_initial_metadata.send_initial_metadata,
332
+ &calld->status, GRPC_MDELEM_STATUS_200));
333
+ add_error(
334
+ error_name, &error,
335
+ grpc_metadata_batch_add_tail(
336
+ exec_ctx, op->payload->send_initial_metadata.send_initial_metadata,
337
+ &calld->content_type,
338
+ GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC));
289
339
  add_error(error_name, &error,
290
- server_filter_outgoing_metadata(exec_ctx, elem,
291
- op->send_initial_metadata));
340
+ server_filter_outgoing_metadata(
341
+ exec_ctx, elem,
342
+ op->payload->send_initial_metadata.send_initial_metadata));
292
343
  if (error != GRPC_ERROR_NONE) {
293
- grpc_transport_stream_op_finish_with_failure(exec_ctx, op, error);
344
+ grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error);
294
345
  return;
295
346
  }
296
347
  }
297
348
 
298
349
  if (op->recv_initial_metadata) {
299
350
  /* substitute our callback for the higher callback */
300
- GPR_ASSERT(op->recv_idempotent_request != NULL);
301
- GPR_ASSERT(op->recv_cacheable_request != NULL);
302
- calld->recv_initial_metadata = op->recv_initial_metadata;
303
- calld->recv_idempotent_request = op->recv_idempotent_request;
304
- calld->recv_cacheable_request = op->recv_cacheable_request;
305
- calld->on_done_recv = op->recv_initial_metadata_ready;
306
- op->recv_initial_metadata_ready = &calld->hs_on_recv;
351
+ GPR_ASSERT(op->payload->recv_initial_metadata.recv_flags != NULL);
352
+ calld->recv_initial_metadata =
353
+ op->payload->recv_initial_metadata.recv_initial_metadata;
354
+ calld->recv_initial_metadata_flags =
355
+ op->payload->recv_initial_metadata.recv_flags;
356
+ calld->on_done_recv =
357
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready;
358
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready =
359
+ &calld->hs_on_recv;
307
360
  }
308
361
 
309
362
  if (op->recv_message) {
310
- calld->recv_message_ready = op->recv_message_ready;
311
- calld->pp_recv_message = op->recv_message;
312
- if (op->recv_message_ready) {
313
- op->recv_message_ready = &calld->hs_recv_message_ready;
363
+ calld->recv_message_ready = op->payload->recv_message.recv_message_ready;
364
+ calld->pp_recv_message = op->payload->recv_message.recv_message;
365
+ if (op->payload->recv_message.recv_message_ready) {
366
+ op->payload->recv_message.recv_message_ready =
367
+ &calld->hs_recv_message_ready;
314
368
  }
315
369
  if (op->on_complete) {
316
370
  calld->on_complete = op->on_complete;
@@ -320,9 +374,10 @@ static void hs_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
320
374
 
321
375
  if (op->send_trailing_metadata) {
322
376
  grpc_error *error = server_filter_outgoing_metadata(
323
- exec_ctx, elem, op->send_trailing_metadata);
377
+ exec_ctx, elem,
378
+ op->payload->send_trailing_metadata.send_trailing_metadata);
324
379
  if (error != GRPC_ERROR_NONE) {
325
- grpc_transport_stream_op_finish_with_failure(exec_ctx, op, error);
380
+ grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error);
326
381
  return;
327
382
  }
328
383
  }
@@ -330,7 +385,7 @@ static void hs_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
330
385
 
331
386
  static void hs_start_transport_op(grpc_exec_ctx *exec_ctx,
332
387
  grpc_call_element *elem,
333
- grpc_transport_stream_op *op) {
388
+ grpc_transport_stream_op_batch *op) {
334
389
  GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
335
390
  GPR_TIMER_BEGIN("hs_start_transport_op", 0);
336
391
  hs_mutate_op(exec_ctx, elem, op);
@@ -358,7 +413,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
358
413
  /* Destructor for call_data */
359
414
  static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
360
415
  const grpc_call_final_info *final_info,
361
- void *ignored) {
416
+ grpc_closure *ignored) {
362
417
  call_data *calld = elem->call_data;
363
418
  grpc_slice_buffer_destroy_internal(exec_ctx, &calld->read_slice_buffer);
364
419
  }
@@ -121,8 +121,8 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
121
121
  "Received message larger than max (%u vs. %d)",
122
122
  (*calld->recv_message)->length, calld->max_recv_size);
123
123
  grpc_error* new_error = grpc_error_set_int(
124
- GRPC_ERROR_CREATE(message_string), GRPC_ERROR_INT_GRPC_STATUS,
125
- GRPC_STATUS_INVALID_ARGUMENT);
124
+ GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string),
125
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
126
126
  if (error == GRPC_ERROR_NONE) {
127
127
  error = new_error;
128
128
  } else {
@@ -132,32 +132,36 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
132
132
  gpr_free(message_string);
133
133
  }
134
134
  // Invoke the next callback.
135
- grpc_closure_sched(exec_ctx, calld->next_recv_message_ready, error);
135
+ grpc_closure_run(exec_ctx, calld->next_recv_message_ready, error);
136
136
  }
137
137
 
138
138
  // Start transport stream op.
139
- static void start_transport_stream_op(grpc_exec_ctx* exec_ctx,
140
- grpc_call_element* elem,
141
- grpc_transport_stream_op* op) {
139
+ static void start_transport_stream_op_batch(
140
+ grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
141
+ grpc_transport_stream_op_batch* op) {
142
142
  call_data* calld = elem->call_data;
143
143
  // Check max send message size.
144
- if (op->send_message != NULL && calld->max_send_size >= 0 &&
145
- op->send_message->length > (size_t)calld->max_send_size) {
144
+ if (op->send_message && calld->max_send_size >= 0 &&
145
+ op->payload->send_message.send_message->length >
146
+ (size_t)calld->max_send_size) {
146
147
  char* message_string;
147
148
  gpr_asprintf(&message_string, "Sent message larger than max (%u vs. %d)",
148
- op->send_message->length, calld->max_send_size);
149
- grpc_transport_stream_op_finish_with_failure(
150
- exec_ctx, op, grpc_error_set_int(GRPC_ERROR_CREATE(message_string),
151
- GRPC_ERROR_INT_GRPC_STATUS,
152
- GRPC_STATUS_INVALID_ARGUMENT));
149
+ op->payload->send_message.send_message->length,
150
+ calld->max_send_size);
151
+ grpc_transport_stream_op_batch_finish_with_failure(
152
+ exec_ctx, op,
153
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string),
154
+ GRPC_ERROR_INT_GRPC_STATUS,
155
+ GRPC_STATUS_RESOURCE_EXHAUSTED));
153
156
  gpr_free(message_string);
154
157
  return;
155
158
  }
156
159
  // Inject callback for receiving a message.
157
- if (op->recv_message_ready != NULL) {
158
- calld->next_recv_message_ready = op->recv_message_ready;
159
- calld->recv_message = op->recv_message;
160
- op->recv_message_ready = &calld->recv_message_ready;
160
+ if (op->recv_message) {
161
+ calld->next_recv_message_ready =
162
+ op->payload->recv_message.recv_message_ready;
163
+ calld->recv_message = op->payload->recv_message.recv_message;
164
+ op->payload->recv_message.recv_message_ready = &calld->recv_message_ready;
161
165
  }
162
166
  // Chain to the next filter.
163
167
  grpc_call_next_op(exec_ctx, elem, op);
@@ -200,7 +204,7 @@ static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
200
204
  // Destructor for call_data.
201
205
  static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
202
206
  const grpc_call_final_info* final_info,
203
- void* ignored) {}
207
+ grpc_closure* ignored) {}
204
208
 
205
209
  // Constructor for channel_data.
206
210
  static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
@@ -252,7 +256,7 @@ static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
252
256
  }
253
257
 
254
258
  const grpc_channel_filter grpc_message_size_filter = {
255
- start_transport_stream_op,
259
+ start_transport_stream_op_batch,
256
260
  grpc_channel_next_op,
257
261
  sizeof(call_data),
258
262
  init_call_elem,
@@ -126,13 +126,15 @@ static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
126
126
 
127
127
  static void append_error(internal_request *req, grpc_error *error) {
128
128
  if (req->overall_error == GRPC_ERROR_NONE) {
129
- req->overall_error = GRPC_ERROR_CREATE("Failed HTTP/1 client request");
129
+ req->overall_error =
130
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
130
131
  }
131
132
  grpc_resolved_address *addr = &req->addresses->addrs[req->next_address - 1];
132
133
  char *addr_text = grpc_sockaddr_to_uri(addr);
133
134
  req->overall_error = grpc_error_add_child(
134
135
  req->overall_error,
135
- grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS, addr_text));
136
+ grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
137
+ grpc_slice_from_copied_string(addr_text)));
136
138
  gpr_free(addr_text);
137
139
  }
138
140
 
@@ -190,8 +192,8 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
190
192
  internal_request *req = arg;
191
193
 
192
194
  if (!ep) {
193
- next_address(exec_ctx, req,
194
- GRPC_ERROR_CREATE("Unexplained handshake failure"));
195
+ next_address(exec_ctx, req, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
196
+ "Unexplained handshake failure"));
195
197
  return;
196
198
  }
197
199
 
@@ -221,8 +223,8 @@ static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req,
221
223
  }
222
224
  if (req->next_address == req->addresses->naddrs) {
223
225
  finish(exec_ctx, req,
224
- GRPC_ERROR_CREATE_REFERENCING("Failed HTTP requests to all targets",
225
- &req->overall_error, 1));
226
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
227
+ "Failed HTTP requests to all targets", &req->overall_error, 1));
226
228
  return;
227
229
  }
228
230
  addr = &req->addresses->addrs[req->next_address++];
@@ -43,11 +43,11 @@
43
43
  #include "src/core/lib/security/transport/security_handshaker.h"
44
44
  #include "src/core/lib/slice/slice_internal.h"
45
45
  #include "src/core/lib/support/string.h"
46
- #include "src/core/lib/tsi/ssl_transport_security.h"
46
+ #include "src/core/tsi/ssl_transport_security.h"
47
47
 
48
48
  typedef struct {
49
49
  grpc_channel_security_connector base;
50
- tsi_ssl_handshaker_factory *handshaker_factory;
50
+ tsi_ssl_client_handshaker_factory *handshaker_factory;
51
51
  char *secure_peer_name;
52
52
  } grpc_httpcli_ssl_channel_security_connector;
53
53
 
@@ -56,7 +56,7 @@ static void httpcli_ssl_destroy(grpc_exec_ctx *exec_ctx,
56
56
  grpc_httpcli_ssl_channel_security_connector *c =
57
57
  (grpc_httpcli_ssl_channel_security_connector *)sc;
58
58
  if (c->handshaker_factory != NULL) {
59
- tsi_ssl_handshaker_factory_destroy(c->handshaker_factory);
59
+ tsi_ssl_client_handshaker_factory_destroy(c->handshaker_factory);
60
60
  }
61
61
  if (c->secure_peer_name != NULL) gpr_free(c->secure_peer_name);
62
62
  gpr_free(sc);
@@ -69,7 +69,7 @@ static void httpcli_ssl_add_handshakers(grpc_exec_ctx *exec_ctx,
69
69
  (grpc_httpcli_ssl_channel_security_connector *)sc;
70
70
  tsi_handshaker *handshaker = NULL;
71
71
  if (c->handshaker_factory != NULL) {
72
- tsi_result result = tsi_ssl_handshaker_factory_create_handshaker(
72
+ tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
73
73
  c->handshaker_factory, c->secure_peer_name, &handshaker);
74
74
  if (result != TSI_OK) {
75
75
  gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
@@ -95,7 +95,7 @@ static void httpcli_ssl_check_peer(grpc_exec_ctx *exec_ctx,
95
95
  char *msg;
96
96
  gpr_asprintf(&msg, "Peer name %s is not in peer certificate",
97
97
  c->secure_peer_name);
98
- error = GRPC_ERROR_CREATE(msg);
98
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
99
99
  gpr_free(msg);
100
100
  }
101
101
  grpc_closure_sched(exec_ctx, on_peer_checked, error);