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
@@ -31,7 +31,7 @@
31
31
  *
32
32
  */
33
33
 
34
- #include "src/core/ext/client_channel/subchannel.h"
34
+ #include "src/core/ext/filters/client_channel/subchannel.h"
35
35
 
36
36
  #include <limits.h>
37
37
  #include <string.h>
@@ -40,12 +40,11 @@
40
40
  #include <grpc/support/avl.h>
41
41
  #include <grpc/support/string_util.h>
42
42
 
43
- #include "src/core/ext/client_channel/client_channel.h"
44
- #include "src/core/ext/client_channel/initial_connect_string.h"
45
- #include "src/core/ext/client_channel/parse_address.h"
46
- #include "src/core/ext/client_channel/proxy_mapper_registry.h"
47
- #include "src/core/ext/client_channel/subchannel_index.h"
48
- #include "src/core/ext/client_channel/uri_parser.h"
43
+ #include "src/core/ext/filters/client_channel/client_channel.h"
44
+ #include "src/core/ext/filters/client_channel/parse_address.h"
45
+ #include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
46
+ #include "src/core/ext/filters/client_channel/subchannel_index.h"
47
+ #include "src/core/ext/filters/client_channel/uri_parser.h"
49
48
  #include "src/core/lib/channel/channel_args.h"
50
49
  #include "src/core/lib/channel/connected_channel.h"
51
50
  #include "src/core/lib/iomgr/sockaddr_utils.h"
@@ -103,9 +102,6 @@ struct grpc_subchannel {
103
102
 
104
103
  grpc_subchannel_key *key;
105
104
 
106
- /** initial string to send to peer */
107
- grpc_slice initial_connect_string;
108
-
109
105
  /** set during connection */
110
106
  grpc_connect_out_args connecting_result;
111
107
 
@@ -148,6 +144,7 @@ struct grpc_subchannel {
148
144
 
149
145
  struct grpc_subchannel_call {
150
146
  grpc_connected_subchannel *connection;
147
+ grpc_closure *schedule_closure_after_destroy;
151
148
  };
152
149
 
153
150
  #define SUBCHANNEL_CALL_TO_CALL_STACK(call) ((grpc_call_stack *)((call) + 1))
@@ -214,7 +211,6 @@ static void subchannel_destroy(grpc_exec_ctx *exec_ctx, void *arg,
214
211
  grpc_subchannel *c = arg;
215
212
  gpr_free((void *)c->filters);
216
213
  grpc_channel_args_destroy(exec_ctx, c->args);
217
- grpc_slice_unref_internal(exec_ctx, c->initial_connect_string);
218
214
  grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker);
219
215
  grpc_connector_unref(exec_ctx, c->connector);
220
216
  grpc_pollset_set_destroy(exec_ctx, c->pollset_set);
@@ -273,8 +269,9 @@ static void disconnect(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
273
269
  gpr_mu_lock(&c->mu);
274
270
  GPR_ASSERT(!c->disconnected);
275
271
  c->disconnected = true;
276
- grpc_connector_shutdown(exec_ctx, c->connector,
277
- GRPC_ERROR_CREATE("Subchannel disconnected"));
272
+ grpc_connector_shutdown(
273
+ exec_ctx, c->connector,
274
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Subchannel disconnected"));
278
275
  con = GET_CONNECTED_SUBCHANNEL(c, no_barrier);
279
276
  if (con != NULL) {
280
277
  GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, con, "connection");
@@ -332,7 +329,6 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
332
329
  c->pollset_set = grpc_pollset_set_create();
333
330
  grpc_resolved_address *addr = gpr_malloc(sizeof(*addr));
334
331
  grpc_get_subchannel_address_arg(exec_ctx, args->args, addr);
335
- grpc_set_initial_connect_string(&addr, &c->initial_connect_string);
336
332
  grpc_resolved_address *new_address = NULL;
337
333
  grpc_channel_args *new_args = NULL;
338
334
  if (grpc_proxy_mappers_map_address(exec_ctx, addr, args->args, &new_address,
@@ -340,17 +336,15 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
340
336
  GPR_ASSERT(new_address != NULL);
341
337
  gpr_free(addr);
342
338
  addr = new_address;
343
- if (new_args != NULL) c->args = new_args;
344
- }
345
- if (c->args == NULL) {
346
- static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS};
347
- grpc_arg new_arg = grpc_create_subchannel_address_arg(addr);
348
- c->args = grpc_channel_args_copy_and_add_and_remove(
349
- args->args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &new_arg,
350
- 1);
351
- gpr_free(new_arg.value.string);
352
339
  }
340
+ static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS};
341
+ grpc_arg new_arg = grpc_create_subchannel_address_arg(addr);
353
342
  gpr_free(addr);
343
+ c->args = grpc_channel_args_copy_and_add_and_remove(
344
+ new_args != NULL ? new_args : args->args, keys_to_remove,
345
+ GPR_ARRAY_SIZE(keys_to_remove), &new_arg, 1);
346
+ gpr_free(new_arg.value.string);
347
+ if (new_args != NULL) grpc_channel_args_destroy(exec_ctx, new_args);
354
348
  c->root_external_state_watcher.next = c->root_external_state_watcher.prev =
355
349
  &c->root_external_state_watcher;
356
350
  grpc_closure_init(&c->connected, subchannel_connected, c,
@@ -366,7 +360,6 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
366
360
  for (size_t i = 0; i < c->args->num_args; i++) {
367
361
  if (0 == strcmp(c->args->args[i].key,
368
362
  "grpc.testing.fixed_reconnect_backoff_ms")) {
369
- GPR_ASSERT(c->args->args[i].type == GRPC_ARG_INTEGER);
370
363
  fixed_reconnect_backoff = true;
371
364
  initial_backoff_ms = min_backoff_ms = max_backoff_ms =
372
365
  grpc_channel_arg_get_integer(
@@ -405,7 +398,6 @@ static void continue_connect_locked(grpc_exec_ctx *exec_ctx,
405
398
  args.interested_parties = c->pollset_set;
406
399
  args.deadline = c->next_attempt;
407
400
  args.channel_args = c->args;
408
- args.initial_connect_string = c->initial_connect_string;
409
401
 
410
402
  grpc_connectivity_state_set(exec_ctx, &c->state_tracker,
411
403
  GRPC_CHANNEL_CONNECTING, GRPC_ERROR_NONE,
@@ -445,7 +437,8 @@ static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
445
437
  gpr_mu_lock(&c->mu);
446
438
  c->have_alarm = false;
447
439
  if (c->disconnected) {
448
- error = GRPC_ERROR_CREATE_REFERENCING("Disconnected", &error, 1);
440
+ error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Disconnected",
441
+ &error, 1);
449
442
  } else {
450
443
  GRPC_ERROR_REF(error);
451
444
  }
@@ -696,9 +689,9 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
696
689
  } else {
697
690
  grpc_connectivity_state_set(
698
691
  exec_ctx, &c->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE,
699
- grpc_error_set_int(
700
- GRPC_ERROR_CREATE_REFERENCING("Connect Failed", &error, 1),
701
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE),
692
+ grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
693
+ "Connect Failed", &error, 1),
694
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE),
702
695
  "connect_failed");
703
696
 
704
697
  const char *errmsg = grpc_error_string(error);
@@ -719,13 +712,22 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
719
712
  static void subchannel_call_destroy(grpc_exec_ctx *exec_ctx, void *call,
720
713
  grpc_error *error) {
721
714
  grpc_subchannel_call *c = call;
715
+ GPR_ASSERT(c->schedule_closure_after_destroy != NULL);
722
716
  GPR_TIMER_BEGIN("grpc_subchannel_call_unref.destroy", 0);
723
717
  grpc_connected_subchannel *connection = c->connection;
724
- grpc_call_stack_destroy(exec_ctx, SUBCHANNEL_CALL_TO_CALL_STACK(c), NULL, c);
718
+ grpc_call_stack_destroy(exec_ctx, SUBCHANNEL_CALL_TO_CALL_STACK(c), NULL,
719
+ c->schedule_closure_after_destroy);
725
720
  GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, connection, "subchannel_call");
726
721
  GPR_TIMER_END("grpc_subchannel_call_unref.destroy", 0);
727
722
  }
728
723
 
724
+ void grpc_subchannel_call_set_cleanup_closure(grpc_subchannel_call *call,
725
+ grpc_closure *closure) {
726
+ GPR_ASSERT(call->schedule_closure_after_destroy == NULL);
727
+ GPR_ASSERT(closure != NULL);
728
+ call->schedule_closure_after_destroy = closure;
729
+ }
730
+
729
731
  void grpc_subchannel_call_ref(
730
732
  grpc_subchannel_call *c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) {
731
733
  GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(c), REF_REASON);
@@ -746,11 +748,11 @@ char *grpc_subchannel_call_get_peer(grpc_exec_ctx *exec_ctx,
746
748
 
747
749
  void grpc_subchannel_call_process_op(grpc_exec_ctx *exec_ctx,
748
750
  grpc_subchannel_call *call,
749
- grpc_transport_stream_op *op) {
751
+ grpc_transport_stream_op_batch *op) {
750
752
  GPR_TIMER_BEGIN("grpc_subchannel_call_process_op", 0);
751
753
  grpc_call_stack *call_stack = SUBCHANNEL_CALL_TO_CALL_STACK(call);
752
754
  grpc_call_element *top_elem = grpc_call_stack_element(call_stack, 0);
753
- top_elem->filter->start_transport_stream_op(exec_ctx, top_elem, op);
755
+ top_elem->filter->start_transport_stream_op_batch(exec_ctx, top_elem, op);
754
756
  GPR_TIMER_END("grpc_subchannel_call_process_op", 0);
755
757
  }
756
758
 
@@ -761,24 +763,28 @@ grpc_connected_subchannel *grpc_subchannel_get_connected_subchannel(
761
763
 
762
764
  grpc_error *grpc_connected_subchannel_create_call(
763
765
  grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *con,
764
- grpc_polling_entity *pollent, grpc_slice path, gpr_timespec start_time,
765
- gpr_timespec deadline, grpc_subchannel_call **call) {
766
+ const grpc_connected_subchannel_call_args *args,
767
+ grpc_subchannel_call **call) {
766
768
  grpc_channel_stack *chanstk = CHANNEL_STACK_FROM_CONNECTION(con);
767
- *call = gpr_zalloc(sizeof(grpc_subchannel_call) + chanstk->call_stack_size);
769
+ *call = gpr_arena_alloc(
770
+ args->arena, sizeof(grpc_subchannel_call) + chanstk->call_stack_size);
768
771
  grpc_call_stack *callstk = SUBCHANNEL_CALL_TO_CALL_STACK(*call);
769
- (*call)->connection = con; // Ref is added below.
770
- grpc_error *error =
771
- grpc_call_stack_init(exec_ctx, chanstk, 1, subchannel_call_destroy, *call,
772
- NULL, NULL, path, start_time, deadline, callstk);
772
+ (*call)->connection = GRPC_CONNECTED_SUBCHANNEL_REF(con, "subchannel_call");
773
+ const grpc_call_element_args call_args = {.call_stack = callstk,
774
+ .server_transport_data = NULL,
775
+ .context = NULL,
776
+ .path = args->path,
777
+ .start_time = args->start_time,
778
+ .deadline = args->deadline,
779
+ .arena = args->arena};
780
+ grpc_error *error = grpc_call_stack_init(
781
+ exec_ctx, chanstk, 1, subchannel_call_destroy, *call, &call_args);
773
782
  if (error != GRPC_ERROR_NONE) {
774
783
  const char *error_string = grpc_error_string(error);
775
784
  gpr_log(GPR_ERROR, "error: %s", error_string);
776
-
777
- gpr_free(*call);
778
785
  return error;
779
786
  }
780
- GRPC_CONNECTED_SUBCHANNEL_REF(con, "subchannel_call");
781
- grpc_call_stack_set_pollset_or_pollset_set(exec_ctx, callstk, pollent);
787
+ grpc_call_stack_set_pollset_or_pollset_set(exec_ctx, callstk, args->pollent);
782
788
  return GRPC_ERROR_NONE;
783
789
  }
784
790
 
@@ -31,12 +31,13 @@
31
31
  *
32
32
  */
33
33
 
34
- #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H
35
- #define GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H
34
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
35
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
36
36
 
37
- #include "src/core/ext/client_channel/connector.h"
37
+ #include "src/core/ext/filters/client_channel/connector.h"
38
38
  #include "src/core/lib/channel/channel_stack.h"
39
39
  #include "src/core/lib/iomgr/polling_entity.h"
40
+ #include "src/core/lib/support/arena.h"
40
41
  #include "src/core/lib/transport/connectivity_state.h"
41
42
  #include "src/core/lib/transport/metadata.h"
42
43
 
@@ -112,10 +113,18 @@ void grpc_subchannel_call_unref(grpc_exec_ctx *exec_ctx,
112
113
  GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
113
114
 
114
115
  /** construct a subchannel call */
116
+ typedef struct {
117
+ grpc_polling_entity *pollent;
118
+ grpc_slice path;
119
+ gpr_timespec start_time;
120
+ gpr_timespec deadline;
121
+ gpr_arena *arena;
122
+ } grpc_connected_subchannel_call_args;
123
+
115
124
  grpc_error *grpc_connected_subchannel_create_call(
116
125
  grpc_exec_ctx *exec_ctx, grpc_connected_subchannel *connected_subchannel,
117
- grpc_polling_entity *pollent, grpc_slice path, gpr_timespec start_time,
118
- gpr_timespec deadline, grpc_subchannel_call **subchannel_call);
126
+ const grpc_connected_subchannel_call_args *args,
127
+ grpc_subchannel_call **subchannel_call);
119
128
 
120
129
  /** process a transport level op */
121
130
  void grpc_connected_subchannel_process_transport_op(
@@ -148,12 +157,17 @@ grpc_connected_subchannel *grpc_subchannel_get_connected_subchannel(
148
157
  /** continue processing a transport op */
149
158
  void grpc_subchannel_call_process_op(grpc_exec_ctx *exec_ctx,
150
159
  grpc_subchannel_call *subchannel_call,
151
- grpc_transport_stream_op *op);
160
+ grpc_transport_stream_op_batch *op);
152
161
 
153
162
  /** continue querying for peer */
154
163
  char *grpc_subchannel_call_get_peer(grpc_exec_ctx *exec_ctx,
155
164
  grpc_subchannel_call *subchannel_call);
156
165
 
166
+ /** Must be called once per call. Sets the 'then_schedule_closure' argument for
167
+ call stack destruction. */
168
+ void grpc_subchannel_call_set_cleanup_closure(
169
+ grpc_subchannel_call *subchannel_call, grpc_closure *closure);
170
+
157
171
  grpc_call_stack *grpc_subchannel_call_get_call_stack(
158
172
  grpc_subchannel_call *subchannel_call);
159
173
 
@@ -186,4 +200,4 @@ const char *grpc_get_subchannel_address_uri_arg(const grpc_channel_args *args);
186
200
  /// Caller is responsible for freeing the string.
187
201
  grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address *addr);
188
202
 
189
- #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H */
203
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H */
@@ -31,7 +31,7 @@
31
31
  //
32
32
  //
33
33
 
34
- #include "src/core/ext/client_channel/subchannel_index.h"
34
+ #include "src/core/ext/filters/client_channel/subchannel_index.h"
35
35
 
36
36
  #include <stdbool.h>
37
37
  #include <string.h>
@@ -31,11 +31,11 @@
31
31
  *
32
32
  */
33
33
 
34
- #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H
35
- #define GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H
34
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H
35
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H
36
36
 
37
- #include "src/core/ext/client_channel/connector.h"
38
- #include "src/core/ext/client_channel/subchannel.h"
37
+ #include "src/core/ext/filters/client_channel/connector.h"
38
+ #include "src/core/ext/filters/client_channel/subchannel.h"
39
39
 
40
40
  /** \file Provides an index of active subchannels so that they can be
41
41
  shared amongst channels */
@@ -74,4 +74,4 @@ void grpc_subchannel_index_init(void);
74
74
  /** Shutdown the subchannel index (global) */
75
75
  void grpc_subchannel_index_shutdown(void);
76
76
 
77
- #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */
77
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */
@@ -31,7 +31,7 @@
31
31
  *
32
32
  */
33
33
 
34
- #include "src/core/ext/client_channel/uri_parser.h"
34
+ #include "src/core/ext/filters/client_channel/uri_parser.h"
35
35
 
36
36
  #include <string.h>
37
37
 
@@ -31,8 +31,8 @@
31
31
  *
32
32
  */
33
33
 
34
- #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H
35
- #define GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H
34
+ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H
35
+ #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H
36
36
 
37
37
  #include <stddef.h>
38
38
  #include "src/core/lib/iomgr/exec_ctx.h"
@@ -62,4 +62,4 @@ const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key);
62
62
  /** destroy a uri */
63
63
  void grpc_uri_destroy(grpc_uri *uri);
64
64
 
65
- #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H */
65
+ #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */
@@ -31,6 +31,8 @@
31
31
  *
32
32
  */
33
33
 
34
+ #include <grpc/support/port_platform.h>
35
+
34
36
  #include <limits.h>
35
37
  #include <string.h>
36
38
 
@@ -38,8 +40,8 @@
38
40
  #include <grpc/support/alloc.h>
39
41
  #include <grpc/support/sync.h>
40
42
 
41
- #include "src/core/ext/load_reporting/load_reporting.h"
42
- #include "src/core/ext/load_reporting/load_reporting_filter.h"
43
+ #include "src/core/ext/filters/load_reporting/load_reporting.h"
44
+ #include "src/core/ext/filters/load_reporting/load_reporting_filter.h"
43
45
  #include "src/core/lib/channel/channel_stack_builder.h"
44
46
  #include "src/core/lib/slice/slice_internal.h"
45
47
  #include "src/core/lib/surface/call.h"
@@ -31,8 +31,8 @@
31
31
  *
32
32
  */
33
33
 
34
- #ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H
35
- #define GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H
34
+ #ifndef GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_LOAD_REPORTING_H
35
+ #define GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_LOAD_REPORTING_H
36
36
 
37
37
  #include <grpc/impl/codegen/grpc_types.h>
38
38
 
@@ -70,4 +70,4 @@ typedef struct grpc_load_reporting_call_data {
70
70
  /** Return a \a grpc_arg enabling load reporting */
71
71
  grpc_arg grpc_load_reporting_enable_arg();
72
72
 
73
- #endif /* GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H */
73
+ #endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_LOAD_REPORTING_H */
@@ -39,8 +39,8 @@
39
39
  #include <grpc/support/string_util.h>
40
40
  #include <grpc/support/sync.h>
41
41
 
42
- #include "src/core/ext/load_reporting/load_reporting.h"
43
- #include "src/core/ext/load_reporting/load_reporting_filter.h"
42
+ #include "src/core/ext/filters/load_reporting/load_reporting.h"
43
+ #include "src/core/ext/filters/load_reporting/load_reporting_filter.h"
44
44
  #include "src/core/lib/channel/channel_args.h"
45
45
  #include "src/core/lib/profiling/timers.h"
46
46
  #include "src/core/lib/slice/slice_internal.h"
@@ -78,8 +78,8 @@ static void on_initial_md_ready(grpc_exec_ctx *exec_ctx, void *user_data,
78
78
  GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.path->md));
79
79
  calld->have_service_method = true;
80
80
  } else {
81
- err =
82
- grpc_error_add_child(err, GRPC_ERROR_CREATE("Missing :path header"));
81
+ err = grpc_error_add_child(
82
+ err, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing :path header"));
83
83
  }
84
84
  if (calld->recv_initial_metadata->idx.named.lb_token != NULL) {
85
85
  calld->initial_md_string = grpc_slice_ref_internal(
@@ -123,7 +123,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
123
123
  /* Destructor for call_data */
124
124
  static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
125
125
  const grpc_call_final_info *final_info,
126
- void *ignored) {
126
+ grpc_closure *ignored) {
127
127
  call_data *calld = elem->call_data;
128
128
 
129
129
  /* TODO(dgq): do something with the data
@@ -183,25 +183,28 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
183
183
  */
184
184
  }
185
185
 
186
- static void lr_start_transport_stream_op(grpc_exec_ctx *exec_ctx,
187
- grpc_call_element *elem,
188
- grpc_transport_stream_op *op) {
189
- GPR_TIMER_BEGIN("lr_start_transport_stream_op", 0);
186
+ static void lr_start_transport_stream_op_batch(
187
+ grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
188
+ grpc_transport_stream_op_batch *op) {
189
+ GPR_TIMER_BEGIN("lr_start_transport_stream_op_batch", 0);
190
190
  call_data *calld = elem->call_data;
191
191
 
192
192
  if (op->recv_initial_metadata) {
193
- calld->recv_initial_metadata = op->recv_initial_metadata;
193
+ calld->recv_initial_metadata =
194
+ op->payload->recv_initial_metadata.recv_initial_metadata;
194
195
  /* substitute our callback for the higher callback */
195
- calld->ops_recv_initial_metadata_ready = op->recv_initial_metadata_ready;
196
- op->recv_initial_metadata_ready = &calld->on_initial_md_ready;
196
+ calld->ops_recv_initial_metadata_ready =
197
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready;
198
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready =
199
+ &calld->on_initial_md_ready;
197
200
  }
198
201
  grpc_call_next_op(exec_ctx, elem, op);
199
202
 
200
- GPR_TIMER_END("lr_start_transport_stream_op", 0);
203
+ GPR_TIMER_END("lr_start_transport_stream_op_batch", 0);
201
204
  }
202
205
 
203
206
  const grpc_channel_filter grpc_load_reporting_filter = {
204
- lr_start_transport_stream_op,
207
+ lr_start_transport_stream_op_batch,
205
208
  grpc_channel_next_op,
206
209
  sizeof(call_data),
207
210
  init_call_elem,
@@ -31,12 +31,12 @@
31
31
  *
32
32
  */
33
33
 
34
- #ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H
35
- #define GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H
34
+ #ifndef GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_LOAD_REPORTING_FILTER_H
35
+ #define GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_LOAD_REPORTING_FILTER_H
36
36
 
37
- #include "src/core/ext/load_reporting/load_reporting.h"
37
+ #include "src/core/ext/filters/load_reporting/load_reporting.h"
38
38
  #include "src/core/lib/channel/channel_stack.h"
39
39
 
40
40
  extern const grpc_channel_filter grpc_load_reporting_filter;
41
41
 
42
- #endif /* GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H */
42
+ #endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_LOAD_REPORTING_FILTER_H */