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
@@ -39,6 +39,7 @@
39
39
  #include <grpc/support/port_platform.h>
40
40
 
41
41
  #include "src/core/lib/iomgr/error.h"
42
+ #include "src/core/lib/slice/slice_internal.h"
42
43
  #include "src/core/lib/slice/slice_string_helpers.h"
43
44
 
44
45
  static grpc_error *conforms_to(grpc_slice slice, const uint8_t *legal_bits,
@@ -52,9 +53,10 @@ static grpc_error *conforms_to(grpc_slice slice, const uint8_t *legal_bits,
52
53
  if ((legal_bits[byte] & (1 << bit)) == 0) {
53
54
  char *dump = grpc_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
54
55
  grpc_error *error = grpc_error_set_str(
55
- grpc_error_set_int(GRPC_ERROR_CREATE(err_desc), GRPC_ERROR_INT_OFFSET,
56
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_desc),
57
+ GRPC_ERROR_INT_OFFSET,
56
58
  p - GRPC_SLICE_START_PTR(slice)),
57
- GRPC_ERROR_STR_RAW_BYTES, dump);
59
+ GRPC_ERROR_STR_RAW_BYTES, grpc_slice_from_copied_string(dump));
58
60
  gpr_free(dump);
59
61
  return error;
60
62
  }
@@ -74,10 +76,12 @@ grpc_error *grpc_validate_header_key_is_legal(grpc_slice slice) {
74
76
  0x80, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
75
77
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
76
78
  if (GRPC_SLICE_LENGTH(slice) == 0) {
77
- return GRPC_ERROR_CREATE("Metadata keys cannot be zero length");
79
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
80
+ "Metadata keys cannot be zero length");
78
81
  }
79
82
  if (GRPC_SLICE_START_PTR(slice)[0] == ':') {
80
- return GRPC_ERROR_CREATE("Metadata keys cannot start with :");
83
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
84
+ "Metadata keys cannot start with :");
81
85
  }
82
86
  return conforms_to(slice, legal_header_bits, "Illegal header key");
83
87
  }
@@ -36,6 +36,6 @@
36
36
 
37
37
  #include <grpc/grpc.h>
38
38
 
39
- const char *grpc_version_string(void) { return "3.0.0-dev"; }
39
+ const char *grpc_version_string(void) { return "3.0.0"; }
40
40
 
41
- const char *grpc_g_stands_for(void) { return "green"; }
41
+ const char *grpc_g_stands_for(void) { return "gentle"; }
@@ -73,4 +73,4 @@ void grpc_bdp_estimator_start_ping(grpc_bdp_estimator *estimator);
73
73
  // Completes a previously started ping
74
74
  void grpc_bdp_estimator_complete_ping(grpc_bdp_estimator *estimator);
75
75
 
76
- #endif
76
+ #endif /* GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H */
@@ -79,7 +79,8 @@ void grpc_connectivity_state_destroy(grpc_exec_ctx *exec_ctx,
79
79
  *w->current = GRPC_CHANNEL_SHUTDOWN;
80
80
  error = GRPC_ERROR_NONE;
81
81
  } else {
82
- error = GRPC_ERROR_CREATE("Shutdown connectivity owner");
82
+ error =
83
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Shutdown connectivity owner");
83
84
  }
84
85
  grpc_closure_sched(exec_ctx, w->notify, error);
85
86
  gpr_free(w);
@@ -44,18 +44,18 @@ static grpc_error *recursively_find_error_with_field(grpc_error *error,
44
44
  }
45
45
  if (grpc_error_is_special(error)) return NULL;
46
46
  // Otherwise, search through its children.
47
- intptr_t key = 0;
48
- while (true) {
49
- grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++);
50
- if (child_error == NULL) break;
51
- grpc_error *result = recursively_find_error_with_field(child_error, which);
52
- if (result != NULL) return result;
47
+ uint8_t slot = error->first_err;
48
+ while (slot != UINT8_MAX) {
49
+ grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot);
50
+ grpc_error *result = recursively_find_error_with_field(lerr->err, which);
51
+ if (result) return result;
52
+ slot = lerr->next;
53
53
  }
54
54
  return NULL;
55
55
  }
56
56
 
57
57
  void grpc_error_get_status(grpc_error *error, gpr_timespec deadline,
58
- grpc_status_code *code, const char **msg,
58
+ grpc_status_code *code, grpc_slice *slice,
59
59
  grpc_http2_error_code *http_error) {
60
60
  // Start with the parent error and recurse through the tree of children
61
61
  // until we find the first one that has a status code.
@@ -97,11 +97,11 @@ void grpc_error_get_status(grpc_error *error, gpr_timespec deadline,
97
97
 
98
98
  // If the error has a status message, use it. Otherwise, fall back to
99
99
  // the error description.
100
- if (msg != NULL) {
101
- *msg = grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE);
102
- if (*msg == NULL && error != GRPC_ERROR_NONE) {
103
- *msg = grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION);
104
- if (*msg == NULL) *msg = "unknown error"; // Just in case.
100
+ if (slice != NULL) {
101
+ if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE, slice)) {
102
+ if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION, slice)) {
103
+ *slice = grpc_slice_from_static_string("unknown error");
104
+ }
105
105
  }
106
106
  }
107
107
 
@@ -112,13 +112,13 @@ bool grpc_error_has_clear_grpc_status(grpc_error *error) {
112
112
  if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, NULL)) {
113
113
  return true;
114
114
  }
115
- intptr_t key = 0;
116
- while (true) {
117
- grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++);
118
- if (child_error == NULL) break;
119
- if (grpc_error_has_clear_grpc_status(child_error)) {
115
+ uint8_t slot = error->first_err;
116
+ while (slot != UINT8_MAX) {
117
+ grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot);
118
+ if (grpc_error_has_clear_grpc_status(lerr->err)) {
120
119
  return true;
121
120
  }
121
+ slot = lerr->next;
122
122
  }
123
123
  return false;
124
124
  }
@@ -44,7 +44,7 @@
44
44
  /// attributes (code, msg, http_status) are unneeded, they can be passed as
45
45
  /// NULL.
46
46
  void grpc_error_get_status(grpc_error *error, gpr_timespec deadline,
47
- grpc_status_code *code, const char **msg,
47
+ grpc_status_code *code, grpc_slice *slice,
48
48
  grpc_http2_error_code *http_status);
49
49
 
50
50
  /// A utility function to check whether there is a clear status code that
@@ -101,12 +101,10 @@ void grpc_metadata_batch_destroy(grpc_exec_ctx *exec_ctx,
101
101
  }
102
102
 
103
103
  grpc_error *grpc_attach_md_to_error(grpc_error *src, grpc_mdelem md) {
104
- char *k = grpc_slice_to_c_string(GRPC_MDKEY(md));
105
- char *v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
106
104
  grpc_error *out = grpc_error_set_str(
107
- grpc_error_set_str(src, GRPC_ERROR_STR_KEY, k), GRPC_ERROR_STR_VALUE, v);
108
- gpr_free(k);
109
- gpr_free(v);
105
+ grpc_error_set_str(src, GRPC_ERROR_STR_KEY,
106
+ grpc_slice_ref_internal(GRPC_MDKEY(md))),
107
+ GRPC_ERROR_STR_VALUE, grpc_slice_ref_internal(GRPC_MDVALUE(md)));
110
108
  return out;
111
109
  }
112
110
 
@@ -126,7 +124,8 @@ static grpc_error *maybe_link_callout(grpc_metadata_batch *batch,
126
124
  return GRPC_ERROR_NONE;
127
125
  }
128
126
  return grpc_attach_md_to_error(
129
- GRPC_ERROR_CREATE("Unallowed duplicate metadata"), storage->md);
127
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"),
128
+ storage->md);
130
129
  }
131
130
 
132
131
  static void maybe_unlink_callout(grpc_metadata_batch *batch,
@@ -302,7 +301,7 @@ static void add_error(grpc_error **composite, grpc_error *error,
302
301
  const char *composite_error_string) {
303
302
  if (error == GRPC_ERROR_NONE) return;
304
303
  if (*composite == GRPC_ERROR_NONE) {
305
- *composite = GRPC_ERROR_CREATE(composite_error_string);
304
+ *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(composite_error_string);
306
305
  }
307
306
  *composite = grpc_error_add_child(*composite, error);
308
307
  }
@@ -49,6 +49,7 @@ void grpc_pid_controller_reset(grpc_pid_controller *pid_controller) {
49
49
 
50
50
  double grpc_pid_controller_update(grpc_pid_controller *pid_controller,
51
51
  double error, double dt) {
52
+ if (dt == 0) return pid_controller->last_control_value;
52
53
  /* integrate error using the trapezoid rule */
53
54
  pid_controller->error_integral +=
54
55
  dt * (pid_controller->last_error + error) * 0.5;
@@ -93,6 +93,18 @@ void grpc_service_config_destroy(grpc_service_config* service_config) {
93
93
  gpr_free(service_config);
94
94
  }
95
95
 
96
+ void grpc_service_config_parse_global_params(
97
+ const grpc_service_config* service_config,
98
+ void (*process_json)(const grpc_json* json, void* arg), void* arg) {
99
+ const grpc_json* json = service_config->json_tree;
100
+ if (json->type != GRPC_JSON_OBJECT || json->key != NULL) return;
101
+ for (grpc_json* field = json->child; field != NULL; field = field->next) {
102
+ if (field->key == NULL) return;
103
+ if (strcmp(field->key, "methodConfig") == 0) continue;
104
+ process_json(field, arg);
105
+ }
106
+ }
107
+
96
108
  const char* grpc_service_config_get_lb_policy_name(
97
109
  const grpc_service_config* service_config) {
98
110
  const grpc_json* json = service_config->json_tree;
@@ -42,6 +42,12 @@ typedef struct grpc_service_config grpc_service_config;
42
42
  grpc_service_config* grpc_service_config_create(const char* json_string);
43
43
  void grpc_service_config_destroy(grpc_service_config* service_config);
44
44
 
45
+ /// Invokes \a process_json() for each global parameter in the service
46
+ /// config. \a arg is passed as the second argument to \a process_json().
47
+ void grpc_service_config_parse_global_params(
48
+ const grpc_service_config* service_config,
49
+ void (*process_json)(const grpc_json* json, void* arg), void* arg);
50
+
45
51
  /// Gets the LB policy name from \a service_config.
46
52
  /// Returns NULL if no LB policy name was specified.
47
53
  /// Caller does NOT take ownership.
@@ -162,15 +162,15 @@ void grpc_transport_destroy(grpc_exec_ctx *exec_ctx,
162
162
  int grpc_transport_init_stream(grpc_exec_ctx *exec_ctx,
163
163
  grpc_transport *transport, grpc_stream *stream,
164
164
  grpc_stream_refcount *refcount,
165
- const void *server_data) {
165
+ const void *server_data, gpr_arena *arena) {
166
166
  return transport->vtable->init_stream(exec_ctx, transport, stream, refcount,
167
- server_data);
167
+ server_data, arena);
168
168
  }
169
169
 
170
170
  void grpc_transport_perform_stream_op(grpc_exec_ctx *exec_ctx,
171
171
  grpc_transport *transport,
172
172
  grpc_stream *stream,
173
- grpc_transport_stream_op *op) {
173
+ grpc_transport_stream_op_batch *op) {
174
174
  transport->vtable->perform_stream_op(exec_ctx, transport, stream, op);
175
175
  }
176
176
 
@@ -197,9 +197,10 @@ void grpc_transport_set_pops(grpc_exec_ctx *exec_ctx, grpc_transport *transport,
197
197
 
198
198
  void grpc_transport_destroy_stream(grpc_exec_ctx *exec_ctx,
199
199
  grpc_transport *transport,
200
- grpc_stream *stream, void *and_free_memory) {
200
+ grpc_stream *stream,
201
+ grpc_closure *then_schedule_closure) {
201
202
  transport->vtable->destroy_stream(exec_ctx, transport, stream,
202
- and_free_memory);
203
+ then_schedule_closure);
203
204
  }
204
205
 
205
206
  char *grpc_transport_get_peer(grpc_exec_ctx *exec_ctx,
@@ -212,14 +213,23 @@ grpc_endpoint *grpc_transport_get_endpoint(grpc_exec_ctx *exec_ctx,
212
213
  return transport->vtable->get_endpoint(exec_ctx, transport);
213
214
  }
214
215
 
215
- void grpc_transport_stream_op_finish_with_failure(grpc_exec_ctx *exec_ctx,
216
- grpc_transport_stream_op *op,
217
- grpc_error *error) {
218
- grpc_closure_sched(exec_ctx, op->recv_message_ready, GRPC_ERROR_REF(error));
219
- grpc_closure_sched(exec_ctx, op->recv_initial_metadata_ready,
220
- GRPC_ERROR_REF(error));
216
+ void grpc_transport_stream_op_batch_finish_with_failure(
217
+ grpc_exec_ctx *exec_ctx, grpc_transport_stream_op_batch *op,
218
+ grpc_error *error) {
219
+ if (op->recv_message) {
220
+ grpc_closure_sched(exec_ctx, op->payload->recv_message.recv_message_ready,
221
+ GRPC_ERROR_REF(error));
222
+ }
223
+ if (op->recv_initial_metadata) {
224
+ grpc_closure_sched(
225
+ exec_ctx,
226
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready,
227
+ GRPC_ERROR_REF(error));
228
+ }
221
229
  grpc_closure_sched(exec_ctx, op->on_complete, error);
222
- GRPC_ERROR_UNREF(op->cancel_error);
230
+ if (op->cancel_stream) {
231
+ GRPC_ERROR_UNREF(op->payload->cancel_stream.cancel_error);
232
+ }
223
233
  }
224
234
 
225
235
  typedef struct {
@@ -248,23 +258,25 @@ grpc_transport_op *grpc_make_transport_op(grpc_closure *on_complete) {
248
258
  typedef struct {
249
259
  grpc_closure outer_on_complete;
250
260
  grpc_closure *inner_on_complete;
251
- grpc_transport_stream_op op;
261
+ grpc_transport_stream_op_batch op;
262
+ grpc_transport_stream_op_batch_payload payload;
252
263
  } made_transport_stream_op;
253
264
 
254
265
  static void destroy_made_transport_stream_op(grpc_exec_ctx *exec_ctx, void *arg,
255
266
  grpc_error *error) {
256
267
  made_transport_stream_op *op = arg;
257
- grpc_closure_sched(exec_ctx, op->inner_on_complete, GRPC_ERROR_REF(error));
268
+ grpc_closure *c = op->inner_on_complete;
258
269
  gpr_free(op);
270
+ grpc_closure_run(exec_ctx, c, GRPC_ERROR_REF(error));
259
271
  }
260
272
 
261
- grpc_transport_stream_op *grpc_make_transport_stream_op(
273
+ grpc_transport_stream_op_batch *grpc_make_transport_stream_op(
262
274
  grpc_closure *on_complete) {
263
- made_transport_stream_op *op = gpr_malloc(sizeof(*op));
275
+ made_transport_stream_op *op = gpr_zalloc(sizeof(*op));
276
+ op->op.payload = &op->payload;
264
277
  grpc_closure_init(&op->outer_on_complete, destroy_made_transport_stream_op,
265
278
  op, grpc_schedule_on_exec_ctx);
266
279
  op->inner_on_complete = on_complete;
267
- memset(&op->op, 0, sizeof(op->op));
268
280
  op->op.on_complete = &op->outer_on_complete;
269
281
  return &op->op;
270
282
  }
@@ -41,6 +41,7 @@
41
41
  #include "src/core/lib/iomgr/polling_entity.h"
42
42
  #include "src/core/lib/iomgr/pollset.h"
43
43
  #include "src/core/lib/iomgr/pollset_set.h"
44
+ #include "src/core/lib/support/arena.h"
44
45
  #include "src/core/lib/transport/byte_stream.h"
45
46
  #include "src/core/lib/transport/metadata_batch.h"
46
47
 
@@ -108,55 +109,98 @@ void grpc_transport_move_stats(grpc_transport_stream_stats *from,
108
109
  grpc_transport_stream_stats *to);
109
110
 
110
111
  typedef struct {
112
+ void *extra_arg;
111
113
  grpc_closure closure;
112
- void *args[2];
113
- } grpc_transport_private_op_data;
114
+ } grpc_handler_private_op_data;
115
+
116
+ typedef struct grpc_transport_stream_op_batch_payload
117
+ grpc_transport_stream_op_batch_payload;
114
118
 
115
119
  /* Transport stream op: a set of operations to perform on a transport
116
120
  against a single stream */
117
- typedef struct grpc_transport_stream_op {
121
+ typedef struct grpc_transport_stream_op_batch {
118
122
  /** Should be enqueued when all requested operations (excluding recv_message
119
123
  and recv_initial_metadata which have their own closures) in a given batch
120
124
  have been completed. */
121
125
  grpc_closure *on_complete;
122
126
 
127
+ /** Values for the stream op (fields set are determined by flags above) */
128
+ grpc_transport_stream_op_batch_payload *payload;
129
+
123
130
  /** Is the completion of this op covered by a poller (if false: the op should
124
131
  complete independently of some pollset being polled) */
125
- bool covered_by_poller;
132
+ bool covered_by_poller : 1;
126
133
 
127
- /** Send initial metadata to the peer, from the provided metadata batch.
128
- idempotent_request MUST be set if this is non-null */
129
- grpc_metadata_batch *send_initial_metadata;
130
- /** Iff send_initial_metadata != NULL, flags associated with
131
- send_initial_metadata: a bitfield of GRPC_INITIAL_METADATA_xxx */
132
- uint32_t send_initial_metadata_flags;
134
+ /** Send initial metadata to the peer, from the provided metadata batch. */
135
+ bool send_initial_metadata : 1;
133
136
 
134
137
  /** Send trailing metadata to the peer, from the provided metadata batch. */
135
- grpc_metadata_batch *send_trailing_metadata;
138
+ bool send_trailing_metadata : 1;
136
139
 
137
140
  /** Send message data to the peer, from the provided byte stream. */
138
- grpc_byte_stream *send_message;
141
+ bool send_message : 1;
139
142
 
140
143
  /** Receive initial metadata from the stream, into provided metadata batch. */
141
- grpc_metadata_batch *recv_initial_metadata;
142
- bool *recv_idempotent_request;
143
- bool *recv_cacheable_request;
144
- /** Should be enqueued when initial metadata is ready to be processed. */
145
- grpc_closure *recv_initial_metadata_ready;
144
+ bool recv_initial_metadata : 1;
146
145
 
147
146
  /** Receive message data from the stream, into provided byte stream. */
148
- grpc_byte_stream **recv_message;
149
- /** Should be enqueued when one message is ready to be processed. */
150
- grpc_closure *recv_message_ready;
147
+ bool recv_message : 1;
151
148
 
152
149
  /** Receive trailing metadata from the stream, into provided metadata batch.
153
150
  */
154
- grpc_metadata_batch *recv_trailing_metadata;
151
+ bool recv_trailing_metadata : 1;
155
152
 
156
153
  /** Collect any stats into provided buffer, zero internal stat counters */
157
- grpc_transport_stream_stats *collect_stats;
154
+ bool collect_stats : 1;
155
+
156
+ /** Cancel this stream with the provided error */
157
+ bool cancel_stream : 1;
158
+
159
+ /***************************************************************************
160
+ * remaining fields are initialized and used at the discretion of the
161
+ * current handler of the op */
158
162
 
159
- /** If != GRPC_ERROR_NONE, forcefully close this stream.
163
+ grpc_handler_private_op_data handler_private;
164
+ } grpc_transport_stream_op_batch;
165
+
166
+ struct grpc_transport_stream_op_batch_payload {
167
+ struct {
168
+ grpc_metadata_batch *send_initial_metadata;
169
+ /** Iff send_initial_metadata != NULL, flags associated with
170
+ send_initial_metadata: a bitfield of GRPC_INITIAL_METADATA_xxx */
171
+ uint32_t send_initial_metadata_flags;
172
+ } send_initial_metadata;
173
+
174
+ struct {
175
+ grpc_metadata_batch *send_trailing_metadata;
176
+ } send_trailing_metadata;
177
+
178
+ struct {
179
+ grpc_byte_stream *send_message;
180
+ } send_message;
181
+
182
+ struct {
183
+ grpc_metadata_batch *recv_initial_metadata;
184
+ uint32_t *recv_flags;
185
+ /** Should be enqueued when initial metadata is ready to be processed. */
186
+ grpc_closure *recv_initial_metadata_ready;
187
+ } recv_initial_metadata;
188
+
189
+ struct {
190
+ grpc_byte_stream **recv_message;
191
+ /** Should be enqueued when one message is ready to be processed. */
192
+ grpc_closure *recv_message_ready;
193
+ } recv_message;
194
+
195
+ struct {
196
+ grpc_metadata_batch *recv_trailing_metadata;
197
+ } recv_trailing_metadata;
198
+
199
+ struct {
200
+ grpc_transport_stream_stats *collect_stats;
201
+ } collect_stats;
202
+
203
+ /** Forcefully close this stream.
160
204
  The HTTP2 semantics should be:
161
205
  - server side: if cancel_error has GRPC_ERROR_INT_GRPC_STATUS, and
162
206
  trailing metadata has not been sent, send trailing metadata with status
@@ -166,17 +210,13 @@ typedef struct grpc_transport_stream_op {
166
210
  convert to a HTTP2 error code using
167
211
  grpc_chttp2_grpc_status_to_http2_error. Send a RST_STREAM with this
168
212
  error. */
169
- grpc_error *cancel_error;
213
+ struct {
214
+ grpc_error *cancel_error;
215
+ } cancel_stream;
170
216
 
171
217
  /* Indexes correspond to grpc_context_index enum values */
172
218
  grpc_call_context_element *context;
173
-
174
- /***************************************************************************
175
- * remaining fields are initialized and used at the discretion of the
176
- * current handler of the op */
177
-
178
- grpc_transport_private_op_data handler_private;
179
- } grpc_transport_stream_op;
219
+ };
180
220
 
181
221
  /** Transport op: a set of operations to perform on a transport as a whole */
182
222
  typedef struct grpc_transport_op {
@@ -209,7 +249,7 @@ typedef struct grpc_transport_op {
209
249
  * remaining fields are initialized and used at the discretion of the
210
250
  * transport implementation */
211
251
 
212
- grpc_transport_private_op_data transport_private;
252
+ grpc_handler_private_op_data handler_private;
213
253
  } grpc_transport_op;
214
254
 
215
255
  /* Returns the amount of memory required to store a grpc_stream for this
@@ -229,7 +269,7 @@ size_t grpc_transport_stream_size(grpc_transport *transport);
229
269
  int grpc_transport_init_stream(grpc_exec_ctx *exec_ctx,
230
270
  grpc_transport *transport, grpc_stream *stream,
231
271
  grpc_stream_refcount *refcount,
232
- const void *server_data);
272
+ const void *server_data, gpr_arena *arena);
233
273
 
234
274
  void grpc_transport_set_pops(grpc_exec_ctx *exec_ctx, grpc_transport *transport,
235
275
  grpc_stream *stream, grpc_polling_entity *pollent);
@@ -246,13 +286,14 @@ void grpc_transport_set_pops(grpc_exec_ctx *exec_ctx, grpc_transport *transport,
246
286
  caller, but any child memory must be cleaned up) */
247
287
  void grpc_transport_destroy_stream(grpc_exec_ctx *exec_ctx,
248
288
  grpc_transport *transport,
249
- grpc_stream *stream, void *and_free_memory);
289
+ grpc_stream *stream,
290
+ grpc_closure *then_schedule_closure);
250
291
 
251
- void grpc_transport_stream_op_finish_with_failure(grpc_exec_ctx *exec_ctx,
252
- grpc_transport_stream_op *op,
253
- grpc_error *error);
292
+ void grpc_transport_stream_op_batch_finish_with_failure(
293
+ grpc_exec_ctx *exec_ctx, grpc_transport_stream_op_batch *op,
294
+ grpc_error *error);
254
295
 
255
- char *grpc_transport_stream_op_string(grpc_transport_stream_op *op);
296
+ char *grpc_transport_stream_op_batch_string(grpc_transport_stream_op_batch *op);
256
297
  char *grpc_transport_op_string(grpc_transport_op *op);
257
298
 
258
299
  /* Send a batch of operations on a transport
@@ -263,11 +304,12 @@ char *grpc_transport_op_string(grpc_transport_op *op);
263
304
  transport - the transport on which to initiate the stream
264
305
  stream - the stream on which to send the operations. This must be
265
306
  non-NULL and previously initialized by the same transport.
266
- op - a grpc_transport_stream_op specifying the op to perform */
307
+ op - a grpc_transport_stream_op_batch specifying the op to perform
308
+ */
267
309
  void grpc_transport_perform_stream_op(grpc_exec_ctx *exec_ctx,
268
310
  grpc_transport *transport,
269
311
  grpc_stream *stream,
270
- grpc_transport_stream_op *op);
312
+ grpc_transport_stream_op_batch *op);
271
313
 
272
314
  void grpc_transport_perform_op(grpc_exec_ctx *exec_ctx,
273
315
  grpc_transport *transport,
@@ -299,9 +341,10 @@ grpc_endpoint *grpc_transport_get_endpoint(grpc_exec_ctx *exec_ctx,
299
341
  /* Allocate a grpc_transport_op, and preconfigure the on_consumed closure to
300
342
  \a on_consumed and then delete the returned transport op */
301
343
  grpc_transport_op *grpc_make_transport_op(grpc_closure *on_consumed);
302
- /* Allocate a grpc_transport_stream_op, and preconfigure the on_consumed closure
344
+ /* Allocate a grpc_transport_stream_op_batch, and preconfigure the on_consumed
345
+ closure
303
346
  to \a on_consumed and then delete the returned transport op */
304
- grpc_transport_stream_op *grpc_make_transport_stream_op(
347
+ grpc_transport_stream_op_batch *grpc_make_transport_stream_op(
305
348
  grpc_closure *on_consumed);
306
349
 
307
350
  #ifdef __cplusplus