grpc 1.1.2 → 1.2.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (255) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1257 -404
  3. data/etc/roots.pem +189 -102
  4. data/include/grpc/census.h +7 -7
  5. data/include/grpc/compression.h +4 -4
  6. data/include/grpc/grpc.h +13 -7
  7. data/include/grpc/impl/codegen/atm_gcc_atomic.h +26 -9
  8. data/include/grpc/impl/codegen/grpc_types.h +39 -30
  9. data/include/grpc/impl/codegen/slice.h +24 -6
  10. data/include/grpc/impl/codegen/sync.h +8 -0
  11. data/include/grpc/load_reporting.h +63 -0
  12. data/include/grpc/slice.h +37 -1
  13. data/include/grpc/slice_buffer.h +7 -0
  14. data/include/grpc/support/alloc.h +3 -0
  15. data/include/grpc/support/useful.h +3 -0
  16. data/src/core/ext/census/gen/census.pb.h +1 -1
  17. data/src/core/ext/census/gen/trace_context.pb.c +9 -36
  18. data/src/core/ext/census/gen/trace_context.pb.h +20 -26
  19. data/src/core/ext/census/grpc_filter.c +3 -5
  20. data/src/core/ext/census/trace_context.c +1 -1
  21. data/src/core/ext/census/trace_context.h +3 -0
  22. data/src/core/ext/census/trace_label.h +61 -0
  23. data/src/core/ext/census/trace_propagation.h +63 -0
  24. data/src/core/ext/census/trace_status.h +45 -0
  25. data/src/core/ext/census/trace_string.h +50 -0
  26. data/src/core/ext/census/tracing.c +31 -11
  27. data/src/core/ext/census/tracing.h +124 -0
  28. data/src/core/ext/client_channel/client_channel.c +456 -368
  29. data/src/core/ext/client_channel/client_channel.h +4 -0
  30. data/src/core/ext/client_channel/client_channel_plugin.c +6 -1
  31. data/src/core/ext/client_channel/connector.c +3 -3
  32. data/src/core/ext/client_channel/connector.h +4 -3
  33. data/src/core/ext/client_channel/http_connect_handshaker.c +62 -72
  34. data/src/core/ext/client_channel/http_connect_handshaker.h +7 -10
  35. data/src/core/ext/client_channel/http_proxy.c +125 -0
  36. data/src/core/ext/client_channel/http_proxy.h +39 -0
  37. data/src/core/ext/client_channel/lb_policy.c +56 -35
  38. data/src/core/ext/client_channel/lb_policy.h +46 -39
  39. data/src/core/ext/client_channel/lb_policy_factory.h +1 -0
  40. data/src/core/ext/client_channel/parse_address.c +32 -6
  41. data/src/core/ext/client_channel/proxy_mapper.c +63 -0
  42. data/src/core/ext/client_channel/proxy_mapper.h +89 -0
  43. data/src/core/ext/client_channel/proxy_mapper_registry.c +133 -0
  44. data/src/core/ext/client_channel/proxy_mapper_registry.h +59 -0
  45. data/src/core/ext/client_channel/resolver.c +16 -9
  46. data/src/core/ext/client_channel/resolver.h +23 -12
  47. data/src/core/ext/client_channel/resolver_factory.h +1 -0
  48. data/src/core/ext/client_channel/resolver_registry.c +15 -11
  49. data/src/core/ext/client_channel/resolver_registry.h +5 -3
  50. data/src/core/ext/client_channel/subchannel.c +44 -27
  51. data/src/core/ext/client_channel/subchannel.h +6 -2
  52. data/src/core/ext/client_channel/uri_parser.c +26 -14
  53. data/src/core/ext/client_channel/uri_parser.h +3 -1
  54. data/src/core/ext/lb_policy/grpclb/grpclb.c +220 -209
  55. data/src/core/ext/lb_policy/grpclb/grpclb_channel.h +56 -0
  56. data/src/core/ext/lb_policy/grpclb/grpclb_channel_secure.c +107 -0
  57. data/src/core/ext/lb_policy/grpclb/load_balancer_api.c +3 -6
  58. data/src/core/ext/lb_policy/pick_first/pick_first.c +71 -116
  59. data/src/core/ext/lb_policy/round_robin/round_robin.c +52 -67
  60. data/src/core/ext/load_reporting/load_reporting.c +20 -0
  61. data/src/core/ext/load_reporting/load_reporting.h +1 -16
  62. data/src/core/ext/load_reporting/load_reporting_filter.c +28 -54
  63. data/src/core/ext/resolver/dns/native/dns_resolver.c +31 -45
  64. data/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +20 -29
  65. data/src/core/ext/transport/chttp2/client/chttp2_connector.c +11 -8
  66. data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +11 -2
  67. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +143 -46
  68. data/src/core/ext/transport/chttp2/server/chttp2_server.c +12 -50
  69. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +1 -1
  70. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +1 -1
  71. data/src/core/ext/transport/chttp2/transport/bin_decoder.c +7 -7
  72. data/src/core/ext/transport/chttp2/transport/bin_encoder.c +1 -2
  73. data/src/core/ext/transport/chttp2/transport/bin_encoder.h +1 -2
  74. data/src/core/ext/transport/chttp2/transport/chttp2_plugin.c +0 -3
  75. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +606 -374
  76. data/src/core/ext/transport/chttp2/transport/frame_ping.c +17 -5
  77. data/src/core/ext/transport/chttp2/transport/frame_ping.h +2 -2
  78. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +9 -13
  79. data/src/core/ext/transport/chttp2/transport/frame_settings.c +12 -11
  80. data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -1
  81. data/src/core/ext/transport/chttp2/transport/frame_window_update.c +5 -6
  82. data/src/core/ext/transport/chttp2/transport/hpack_encoder.c +100 -53
  83. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -2
  84. data/src/core/ext/transport/chttp2/transport/hpack_parser.c +126 -70
  85. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +13 -7
  86. data/src/core/ext/transport/chttp2/transport/hpack_table.c +22 -19
  87. data/src/core/ext/transport/chttp2/transport/hpack_table.h +6 -6
  88. data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +23 -11
  89. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +6 -2
  90. data/src/core/ext/transport/chttp2/transport/internal.h +169 -42
  91. data/src/core/ext/transport/chttp2/transport/parsing.c +98 -41
  92. data/src/core/ext/transport/chttp2/transport/stream_lists.c +29 -14
  93. data/src/core/ext/transport/chttp2/transport/writing.c +137 -15
  94. data/src/core/lib/channel/channel_stack.c +14 -44
  95. data/src/core/lib/channel/channel_stack.h +10 -17
  96. data/src/core/lib/channel/channel_stack_builder.c +2 -3
  97. data/src/core/lib/channel/compress_filter.c +54 -46
  98. data/src/core/lib/channel/connected_channel.c +4 -4
  99. data/src/core/lib/channel/connected_channel.h +5 -0
  100. data/src/core/lib/channel/context.h +3 -0
  101. data/src/core/lib/channel/deadline_filter.c +61 -61
  102. data/src/core/lib/channel/deadline_filter.h +8 -5
  103. data/src/core/lib/channel/handshaker.c +47 -7
  104. data/src/core/lib/channel/handshaker.h +21 -3
  105. data/src/core/lib/channel/http_client_filter.c +149 -99
  106. data/src/core/lib/channel/http_server_filter.c +163 -147
  107. data/src/core/lib/channel/message_size_filter.c +15 -10
  108. data/src/core/lib/compression/algorithm_metadata.h +4 -4
  109. data/src/core/lib/compression/compression.c +17 -23
  110. data/src/core/lib/http/httpcli.c +3 -2
  111. data/src/core/lib/http/httpcli.h +2 -1
  112. data/src/core/lib/http/httpcli_security_connector.c +2 -3
  113. data/src/core/lib/http/parser.c +2 -2
  114. data/src/core/lib/iomgr/closure.c +6 -3
  115. data/src/core/lib/iomgr/closure.h +4 -2
  116. data/src/core/lib/iomgr/combiner.c +35 -5
  117. data/src/core/lib/iomgr/combiner.h +21 -2
  118. data/src/core/lib/iomgr/endpoint.c +3 -2
  119. data/src/core/lib/iomgr/endpoint.h +3 -2
  120. data/src/core/lib/iomgr/error.c +60 -94
  121. data/src/core/lib/iomgr/error.h +7 -10
  122. data/src/core/lib/iomgr/error_internal.h +54 -0
  123. data/src/core/lib/iomgr/ev_epoll_linux.c +253 -109
  124. data/src/core/lib/iomgr/ev_poll_posix.c +61 -29
  125. data/src/core/lib/iomgr/ev_posix.c +7 -8
  126. data/src/core/lib/iomgr/ev_posix.h +4 -4
  127. data/src/core/lib/iomgr/exec_ctx.c +11 -6
  128. data/src/core/lib/iomgr/exec_ctx.h +11 -14
  129. data/src/core/lib/iomgr/executor.c +2 -2
  130. data/src/core/lib/iomgr/load_file.c +1 -1
  131. data/src/core/lib/iomgr/network_status_tracker.c +5 -81
  132. data/src/core/lib/iomgr/pollset.h +1 -3
  133. data/src/core/lib/iomgr/pollset_set.h +2 -1
  134. data/src/core/lib/iomgr/pollset_set_uv.c +2 -1
  135. data/src/core/lib/iomgr/pollset_set_windows.c +2 -1
  136. data/src/core/lib/iomgr/pollset_uv.c +25 -11
  137. data/src/core/lib/iomgr/pollset_windows.c +0 -11
  138. data/src/core/lib/iomgr/resolve_address_uv.c +50 -2
  139. data/src/core/lib/iomgr/resource_quota.c +41 -11
  140. data/src/core/lib/iomgr/resource_quota.h +6 -0
  141. data/src/core/lib/iomgr/sockaddr_utils.c +33 -17
  142. data/src/core/lib/iomgr/sockaddr_utils.h +4 -0
  143. data/src/core/lib/iomgr/tcp_client_posix.c +2 -3
  144. data/src/core/lib/iomgr/tcp_client_uv.c +1 -3
  145. data/src/core/lib/iomgr/tcp_client_windows.c +21 -6
  146. data/src/core/lib/iomgr/tcp_posix.c +4 -5
  147. data/src/core/lib/iomgr/tcp_server_posix.c +269 -94
  148. data/src/core/lib/iomgr/tcp_server_windows.c +1 -1
  149. data/src/core/lib/iomgr/tcp_uv.c +11 -5
  150. data/src/core/lib/iomgr/tcp_windows.c +20 -7
  151. data/src/core/lib/iomgr/timer_generic.c +15 -22
  152. data/src/core/lib/iomgr/timer_generic.h +1 -1
  153. data/src/core/lib/iomgr/timer_uv.c +10 -6
  154. data/src/core/lib/iomgr/timer_uv.h +1 -1
  155. data/src/core/lib/iomgr/udp_server.c +45 -6
  156. data/src/core/lib/iomgr/udp_server.h +7 -1
  157. data/src/core/lib/iomgr/unix_sockets_posix.c +11 -1
  158. data/src/core/lib/json/json.c +1 -2
  159. data/src/core/lib/profiling/basic_timers.c +17 -3
  160. data/src/core/lib/security/context/security_context.c +3 -10
  161. data/src/core/lib/security/credentials/composite/composite_credentials.c +4 -8
  162. data/src/core/lib/security/credentials/credentials.c +48 -2
  163. data/src/core/lib/security/credentials/credentials.h +13 -0
  164. data/src/core/lib/security/credentials/credentials_metadata.c +1 -2
  165. data/src/core/lib/security/credentials/fake/fake_credentials.c +6 -8
  166. data/src/core/lib/security/credentials/fake/fake_credentials.h +15 -0
  167. data/src/core/lib/security/credentials/google_default/google_default_credentials.c +3 -3
  168. data/src/core/lib/security/credentials/iam/iam_credentials.c +1 -2
  169. data/src/core/lib/security/credentials/jwt/jwt_credentials.c +1 -2
  170. data/src/core/lib/security/credentials/jwt/jwt_verifier.c +5 -8
  171. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +2 -1
  172. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +3 -5
  173. data/src/core/lib/security/credentials/plugin/plugin_credentials.c +15 -13
  174. data/src/core/lib/security/credentials/ssl/ssl_credentials.c +2 -4
  175. data/src/core/lib/security/transport/client_auth_filter.c +72 -47
  176. data/src/core/lib/security/transport/lb_targets_info.c +70 -0
  177. data/src/core/lib/security/transport/lb_targets_info.h +47 -0
  178. data/src/core/lib/security/transport/secure_endpoint.c +3 -3
  179. data/src/core/lib/security/transport/security_connector.c +125 -28
  180. data/src/core/lib/security/transport/security_connector.h +4 -3
  181. data/src/core/lib/security/transport/security_handshaker.c +13 -9
  182. data/src/core/lib/security/transport/server_auth_filter.c +31 -40
  183. data/src/core/lib/security/util/b64.c +1 -1
  184. data/src/core/lib/slice/slice.c +110 -20
  185. data/src/core/lib/slice/slice_buffer.c +92 -39
  186. data/src/core/lib/{transport/mdstr_hash_table.c → slice/slice_hash_table.c} +40 -33
  187. data/src/core/lib/{transport/mdstr_hash_table.h → slice/slice_hash_table.h} +21 -21
  188. data/src/core/lib/slice/slice_intern.c +346 -0
  189. data/src/core/lib/slice/slice_internal.h +15 -0
  190. data/src/core/lib/slice/slice_string_helpers.c +5 -0
  191. data/src/core/lib/slice/slice_string_helpers.h +5 -0
  192. data/src/core/lib/support/alloc.c +26 -1
  193. data/src/core/lib/support/cmdline.c +2 -4
  194. data/src/core/lib/support/cpu_posix.c +2 -7
  195. data/src/core/lib/support/histogram.c +1 -2
  196. data/src/core/lib/support/log_posix.c +8 -4
  197. data/src/core/lib/support/spinlock.h +52 -0
  198. data/src/core/lib/support/subprocess_posix.c +1 -2
  199. data/src/core/lib/support/sync.c +7 -1
  200. data/src/core/lib/support/sync_posix.c +9 -0
  201. data/src/core/lib/support/time_windows.c +7 -1
  202. data/src/core/lib/surface/call.c +647 -629
  203. data/src/core/lib/surface/call.h +4 -1
  204. data/src/core/lib/surface/call_details.c +8 -2
  205. data/src/core/lib/surface/call_log_batch.c +17 -6
  206. data/src/core/lib/surface/channel.c +49 -59
  207. data/src/core/lib/surface/channel.h +5 -6
  208. data/src/core/lib/surface/completion_queue.c +16 -45
  209. data/src/core/lib/surface/completion_queue.h +0 -3
  210. data/src/core/lib/surface/init.c +6 -2
  211. data/src/core/lib/surface/init_secure.c +1 -1
  212. data/src/core/lib/surface/lame_client.c +14 -4
  213. data/src/core/lib/surface/server.c +79 -82
  214. data/src/core/lib/surface/validate_metadata.c +46 -15
  215. data/src/core/lib/surface/validate_metadata.h +43 -0
  216. data/src/core/lib/surface/version.c +2 -2
  217. data/src/core/lib/transport/bdp_estimator.c +104 -0
  218. data/src/core/lib/transport/bdp_estimator.h +76 -0
  219. data/src/core/lib/transport/connectivity_state.c +33 -13
  220. data/src/core/lib/transport/connectivity_state.h +15 -5
  221. data/src/core/lib/transport/error_utils.c +124 -0
  222. data/src/core/lib/transport/error_utils.h +56 -0
  223. data/src/core/{ext/transport/chttp2 → lib}/transport/http2_errors.h +18 -18
  224. data/src/core/lib/transport/metadata.c +259 -503
  225. data/src/core/lib/transport/metadata.h +69 -68
  226. data/src/core/lib/transport/metadata_batch.c +183 -63
  227. data/src/core/lib/transport/metadata_batch.h +50 -26
  228. data/src/core/lib/transport/pid_controller.c +28 -8
  229. data/src/core/lib/transport/pid_controller.h +15 -2
  230. data/src/core/lib/transport/service_config.c +21 -18
  231. data/src/core/lib/transport/service_config.h +5 -5
  232. data/src/core/lib/transport/static_metadata.c +753 -112
  233. data/src/core/lib/transport/static_metadata.h +403 -264
  234. data/src/core/{ext/transport/chttp2 → lib}/transport/status_conversion.c +18 -20
  235. data/src/core/{ext/transport/chttp2 → lib}/transport/status_conversion.h +9 -10
  236. data/src/core/lib/transport/timeout_encoding.c +11 -9
  237. data/src/core/lib/transport/timeout_encoding.h +3 -1
  238. data/src/core/lib/transport/transport.c +47 -87
  239. data/src/core/lib/transport/transport.h +20 -25
  240. data/src/core/lib/transport/transport_op_string.c +7 -19
  241. data/src/core/lib/tsi/fake_transport_security.c +2 -4
  242. data/src/core/lib/tsi/ssl_transport_security.c +7 -16
  243. data/src/core/lib/tsi/transport_security.c +2 -4
  244. data/src/ruby/ext/grpc/extconf.rb +4 -1
  245. data/src/ruby/ext/grpc/rb_byte_buffer.c +7 -0
  246. data/src/ruby/ext/grpc/rb_byte_buffer.h +3 -0
  247. data/src/ruby/ext/grpc/rb_call.c +47 -46
  248. data/src/ruby/ext/grpc/rb_channel.c +21 -6
  249. data/src/ruby/ext/grpc/rb_compression_options.c +9 -6
  250. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +36 -2
  251. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +59 -8
  252. data/src/ruby/ext/grpc/rb_server.c +6 -4
  253. data/src/ruby/lib/grpc/generic/client_stub.rb +1 -1
  254. data/src/ruby/lib/grpc/version.rb +1 -1
  255. metadata +33 -9
@@ -502,8 +502,7 @@ static const tsi_handshaker_vtable handshaker_vtable = {
502
502
  };
503
503
 
504
504
  tsi_handshaker *tsi_create_fake_handshaker(int is_client) {
505
- tsi_fake_handshaker *impl = gpr_malloc(sizeof(*impl));
506
- memset(impl, 0, sizeof(*impl));
505
+ tsi_fake_handshaker *impl = gpr_zalloc(sizeof(*impl));
507
506
  impl->base.vtable = &handshaker_vtable;
508
507
  impl->is_client = is_client;
509
508
  impl->result = TSI_HANDSHAKE_IN_PROGRESS;
@@ -519,8 +518,7 @@ tsi_handshaker *tsi_create_fake_handshaker(int is_client) {
519
518
 
520
519
  tsi_frame_protector *tsi_create_fake_protector(
521
520
  size_t *max_protected_frame_size) {
522
- tsi_fake_frame_protector *impl = gpr_malloc(sizeof(*impl));
523
- memset(impl, 0, sizeof(*impl));
521
+ tsi_fake_frame_protector *impl = gpr_zalloc(sizeof(*impl));
524
522
  impl->max_frame_size = (max_protected_frame_size == NULL)
525
523
  ? TSI_FAKE_DEFAULT_FRAME_SIZE
526
524
  : *max_protected_frame_size;
@@ -976,9 +976,7 @@ static tsi_result ssl_handshaker_extract_peer(tsi_handshaker *self,
976
976
  if (alpn_selected != NULL) {
977
977
  size_t i;
978
978
  tsi_peer_property *new_properties =
979
- gpr_malloc(sizeof(*new_properties) * (peer->property_count + 1));
980
- memset(new_properties, 0,
981
- sizeof(*new_properties) * (peer->property_count + 1));
979
+ gpr_zalloc(sizeof(*new_properties) * (peer->property_count + 1));
982
980
  for (i = 0; i < peer->property_count; i++) {
983
981
  new_properties[i] = peer->properties[i];
984
982
  }
@@ -1002,8 +1000,7 @@ static tsi_result ssl_handshaker_create_frame_protector(
1002
1000
  size_t actual_max_output_protected_frame_size =
1003
1001
  TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND;
1004
1002
  tsi_ssl_handshaker *impl = (tsi_ssl_handshaker *)self;
1005
- tsi_ssl_frame_protector *protector_impl = gpr_malloc(sizeof(*protector_impl));
1006
- memset(protector_impl, 0, sizeof(*protector_impl));
1003
+ tsi_ssl_frame_protector *protector_impl = gpr_zalloc(sizeof(*protector_impl));
1007
1004
 
1008
1005
  if (max_output_protected_frame_size != NULL) {
1009
1006
  if (*max_output_protected_frame_size >
@@ -1119,8 +1116,7 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX *ctx, int is_client,
1119
1116
  SSL_set_accept_state(ssl);
1120
1117
  }
1121
1118
 
1122
- impl = gpr_malloc(sizeof(*impl));
1123
- memset(impl, 0, sizeof(*impl));
1119
+ impl = gpr_zalloc(sizeof(*impl));
1124
1120
  impl->ssl = ssl;
1125
1121
  impl->into_ssl = into_ssl;
1126
1122
  impl->from_ssl = from_ssl;
@@ -1338,8 +1334,7 @@ tsi_result tsi_create_ssl_client_handshaker_factory(
1338
1334
  return TSI_INVALID_ARGUMENT;
1339
1335
  }
1340
1336
 
1341
- impl = gpr_malloc(sizeof(*impl));
1342
- memset(impl, 0, sizeof(*impl));
1337
+ impl = gpr_zalloc(sizeof(*impl));
1343
1338
  impl->ssl_context = ssl_context;
1344
1339
 
1345
1340
  do {
@@ -1433,17 +1428,13 @@ tsi_result tsi_create_ssl_server_handshaker_factory_ex(
1433
1428
  return TSI_INVALID_ARGUMENT;
1434
1429
  }
1435
1430
 
1436
- impl = gpr_malloc(sizeof(*impl));
1437
- memset(impl, 0, sizeof(*impl));
1431
+ impl = gpr_zalloc(sizeof(*impl));
1438
1432
  impl->base.create_handshaker =
1439
1433
  ssl_server_handshaker_factory_create_handshaker;
1440
1434
  impl->base.destroy = ssl_server_handshaker_factory_destroy;
1441
- impl->ssl_contexts = gpr_malloc(key_cert_pair_count * sizeof(SSL_CTX *));
1442
- memset(impl->ssl_contexts, 0, key_cert_pair_count * sizeof(SSL_CTX *));
1435
+ impl->ssl_contexts = gpr_zalloc(key_cert_pair_count * sizeof(SSL_CTX *));
1443
1436
  impl->ssl_context_x509_subject_names =
1444
- gpr_malloc(key_cert_pair_count * sizeof(tsi_peer));
1445
- memset(impl->ssl_context_x509_subject_names, 0,
1446
- key_cert_pair_count * sizeof(tsi_peer));
1437
+ gpr_zalloc(key_cert_pair_count * sizeof(tsi_peer));
1447
1438
  if (impl->ssl_contexts == NULL ||
1448
1439
  impl->ssl_context_x509_subject_names == NULL) {
1449
1440
  tsi_ssl_handshaker_factory_destroy(&impl->base);
@@ -231,8 +231,7 @@ tsi_result tsi_construct_allocated_string_peer_property(
231
231
  *property = tsi_init_peer_property();
232
232
  if (name != NULL) property->name = gpr_strdup(name);
233
233
  if (value_length > 0) {
234
- property->value.data = gpr_malloc(value_length);
235
- memset(property->value.data, 0, value_length);
234
+ property->value.data = gpr_zalloc(value_length);
236
235
  property->value.length = value_length;
237
236
  }
238
237
  return TSI_OK;
@@ -260,8 +259,7 @@ tsi_result tsi_construct_string_peer_property(const char *name,
260
259
  tsi_result tsi_construct_peer(size_t property_count, tsi_peer *peer) {
261
260
  memset(peer, 0, sizeof(tsi_peer));
262
261
  if (property_count > 0) {
263
- peer->properties = gpr_malloc(property_count * sizeof(tsi_peer_property));
264
- memset(peer->properties, 0, property_count * sizeof(tsi_peer_property));
262
+ peer->properties = gpr_zalloc(property_count * sizeof(tsi_peer_property));
265
263
  peer->property_count = property_count;
266
264
  }
267
265
  return TSI_OK;
@@ -27,6 +27,7 @@
27
27
  # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
28
  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
 
30
+ require 'etc'
30
31
  require 'mkmf'
31
32
 
32
33
  LIBDIR = RbConfig::CONFIG['libdir']
@@ -80,7 +81,9 @@ ENV['BUILDDIR'] = output_dir
80
81
 
81
82
  unless windows
82
83
  puts 'Building internal gRPC into ' + grpc_lib_dir
83
- system("make -j -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config}")
84
+ nproc = 4
85
+ nproc = Etc.nprocessors * 2 if Etc.respond_to? :nprocessors
86
+ system("make -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config}")
84
87
  exit 1 unless $? == 0
85
88
  end
86
89
 
@@ -68,3 +68,10 @@ VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) {
68
68
  grpc_byte_buffer_reader_destroy(&reader);
69
69
  return rb_string;
70
70
  }
71
+
72
+ VALUE grpc_rb_slice_to_ruby_string(grpc_slice slice) {
73
+ if (GRPC_SLICE_START_PTR(slice) == NULL) {
74
+ rb_raise(rb_eRuntimeError, "attempt to convert uninitialized grpc_slice to ruby string");
75
+ }
76
+ return rb_str_new((char*)GRPC_SLICE_START_PTR(slice), GRPC_SLICE_LENGTH(slice));
77
+ }
@@ -44,4 +44,7 @@ grpc_byte_buffer *grpc_rb_s_to_byte_buffer(char *string, size_t length);
44
44
  /* Converts a grpc_byte_buffer to a ruby string */
45
45
  VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer);
46
46
 
47
+ /* Converts a grpc_slice to a ruby string */
48
+ VALUE grpc_rb_slice_to_ruby_string(grpc_slice slice);
49
+
47
50
  #endif /* GRPC_RB_BYTE_BUFFER_H_ */
@@ -121,8 +121,8 @@ static size_t md_ary_datasize(const void *p) {
121
121
  size_t i, datasize = sizeof(grpc_metadata_array);
122
122
  for (i = 0; i < ary->count; ++i) {
123
123
  const grpc_metadata *const md = &ary->metadata[i];
124
- datasize += strlen(md->key);
125
- datasize += md->value_length;
124
+ datasize += GRPC_SLICE_LENGTH(md->key);
125
+ datasize += GRPC_SLICE_LENGTH(md->value);
126
126
  }
127
127
  datasize += ary->capacity * sizeof(grpc_metadata);
128
128
  return datasize;
@@ -386,23 +386,23 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
386
386
  grpc_metadata_array *md_ary = NULL;
387
387
  long array_length;
388
388
  long i;
389
- char *key_str;
390
- size_t key_len;
391
- char *value_str;
392
- size_t value_len;
389
+ grpc_slice key_slice;
390
+ grpc_slice value_slice;
391
+ char* tmp_str;
393
392
 
394
393
  if (TYPE(key) == T_SYMBOL) {
395
- key_str = (char *)rb_id2name(SYM2ID(key));
396
- key_len = strlen(key_str);
397
- } else { /* StringValueCStr does all other type exclusions for us */
398
- key_str = StringValueCStr(key);
399
- key_len = RSTRING_LEN(key);
394
+ key_slice = grpc_slice_from_static_string(rb_id2name(SYM2ID(key)));
395
+ } else if (TYPE(key) == T_STRING) {
396
+ key_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(key), RSTRING_LEN(key));
397
+ } else {
398
+ rb_raise(rb_eTypeError, "grpc_rb_md_ary_fill_hash_cb: bad type for key parameter");
400
399
  }
401
400
 
402
- if (!grpc_header_key_is_legal(key_str, key_len)) {
401
+ if (!grpc_header_key_is_legal(key_slice)) {
402
+ tmp_str = grpc_slice_to_c_string(key_slice);
403
403
  rb_raise(rb_eArgError,
404
404
  "'%s' is an invalid header key, must match [a-z0-9-_.]+",
405
- key_str);
405
+ tmp_str);
406
406
  return ST_STOP;
407
407
  }
408
408
 
@@ -414,33 +414,31 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
414
414
  array_length = RARRAY_LEN(val);
415
415
  /* If the value is an array, add capacity for each value in the array */
416
416
  for (i = 0; i < array_length; i++) {
417
- value_str = RSTRING_PTR(rb_ary_entry(val, i));
418
- value_len = RSTRING_LEN(rb_ary_entry(val, i));
419
- if (!grpc_is_binary_header(key_str, key_len) &&
420
- !grpc_header_nonbin_value_is_legal(value_str, value_len)) {
417
+ value_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(rb_ary_entry(val, i)), RSTRING_LEN(rb_ary_entry(val, i)));
418
+ if (!grpc_is_binary_header(key_slice) &&
419
+ !grpc_header_nonbin_value_is_legal(value_slice)) {
421
420
  // The value has invalid characters
421
+ tmp_str = grpc_slice_to_c_string(value_slice);
422
422
  rb_raise(rb_eArgError,
423
- "Header value '%s' has invalid characters", value_str);
423
+ "Header value '%s' has invalid characters", tmp_str);
424
424
  return ST_STOP;
425
425
  }
426
- md_ary->metadata[md_ary->count].key = key_str;
427
- md_ary->metadata[md_ary->count].value = value_str;
428
- md_ary->metadata[md_ary->count].value_length = value_len;
426
+ md_ary->metadata[md_ary->count].key = key_slice;
427
+ md_ary->metadata[md_ary->count].value = value_slice;
429
428
  md_ary->count += 1;
430
429
  }
431
430
  } else if (TYPE(val) == T_STRING) {
432
- value_str = RSTRING_PTR(val);
433
- value_len = RSTRING_LEN(val);
434
- if (!grpc_is_binary_header(key_str, key_len) &&
435
- !grpc_header_nonbin_value_is_legal(value_str, value_len)) {
431
+ value_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(val), RSTRING_LEN(val));
432
+ if (!grpc_is_binary_header(key_slice) &&
433
+ !grpc_header_nonbin_value_is_legal(value_slice)) {
436
434
  // The value has invalid characters
435
+ tmp_str = grpc_slice_to_c_string(value_slice);
437
436
  rb_raise(rb_eArgError,
438
- "Header value '%s' has invalid characters", value_str);
437
+ "Header value '%s' has invalid characters", tmp_str);
439
438
  return ST_STOP;
440
439
  }
441
- md_ary->metadata[md_ary->count].key = key_str;
442
- md_ary->metadata[md_ary->count].value = value_str;
443
- md_ary->metadata[md_ary->count].value_length = value_len;
440
+ md_ary->metadata[md_ary->count].key = key_slice;
441
+ md_ary->metadata[md_ary->count].value = value_slice;
444
442
  md_ary->count += 1;
445
443
  } else {
446
444
  rb_raise(rb_eArgError,
@@ -506,22 +504,19 @@ VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary) {
506
504
  size_t i;
507
505
 
508
506
  for (i = 0; i < md_ary->count; i++) {
509
- key = rb_str_new2(md_ary->metadata[i].key);
507
+ key = grpc_rb_slice_to_ruby_string(md_ary->metadata[i].key);
510
508
  value = rb_hash_aref(result, key);
511
509
  if (value == Qnil) {
512
- value = rb_str_new(md_ary->metadata[i].value,
513
- md_ary->metadata[i].value_length);
510
+ value = grpc_rb_slice_to_ruby_string(md_ary->metadata[i].value);
514
511
  rb_hash_aset(result, key, value);
515
512
  } else if (TYPE(value) == T_ARRAY) {
516
513
  /* Add the string to the returned array */
517
- rb_ary_push(value, rb_str_new(md_ary->metadata[i].value,
518
- md_ary->metadata[i].value_length));
514
+ rb_ary_push(value, grpc_rb_slice_to_ruby_string(md_ary->metadata[i].value));
519
515
  } else {
520
516
  /* Add the current value with this key and the new one to an array */
521
517
  new_ary = rb_ary_new();
522
518
  rb_ary_push(new_ary, value);
523
- rb_ary_push(new_ary, rb_str_new(md_ary->metadata[i].value,
524
- md_ary->metadata[i].value_length));
519
+ rb_ary_push(new_ary, grpc_rb_slice_to_ruby_string(md_ary->metadata[i].value));
525
520
  rb_hash_aset(result, key, new_ary);
526
521
  }
527
522
  }
@@ -563,6 +558,7 @@ static int grpc_rb_call_check_op_keys_hash_cb(VALUE key, VALUE val,
563
558
  */
564
559
  static void grpc_rb_op_update_status_from_server(grpc_op *op,
565
560
  grpc_metadata_array *md_ary,
561
+ grpc_slice *send_status_details,
566
562
  VALUE status) {
567
563
  VALUE code = rb_struct_aref(status, sym_code);
568
564
  VALUE details = rb_struct_aref(status, sym_details);
@@ -579,8 +575,11 @@ static void grpc_rb_op_update_status_from_server(grpc_op *op,
579
575
  rb_obj_classname(code));
580
576
  return;
581
577
  }
578
+
579
+ *send_status_details = grpc_slice_from_copied_buffer(RSTRING_PTR(details), RSTRING_LEN(details));
580
+
582
581
  op->data.send_status_from_server.status = NUM2INT(code);
583
- op->data.send_status_from_server.status_details = StringValueCStr(details);
582
+ op->data.send_status_from_server.status_details = send_status_details;
584
583
  grpc_rb_md_ary_convert(metadata_hash, md_ary);
585
584
  op->data.send_status_from_server.trailing_metadata_count = md_ary->count;
586
585
  op->data.send_status_from_server.trailing_metadata = md_ary->metadata;
@@ -603,9 +602,9 @@ typedef struct run_batch_stack {
603
602
  grpc_metadata_array recv_trailing_metadata;
604
603
  int recv_cancelled;
605
604
  grpc_status_code recv_status;
606
- char *recv_status_details;
607
- size_t recv_status_details_capacity;
605
+ grpc_slice recv_status_details;
608
606
  unsigned write_flag;
607
+ grpc_slice send_status_details;
609
608
  } run_batch_stack;
610
609
 
611
610
  /* grpc_run_batch_stack_init ensures the run_batch_stack is properly
@@ -631,8 +630,12 @@ static void grpc_run_batch_stack_cleanup(run_batch_stack *st) {
631
630
  grpc_metadata_array_destroy(&st->recv_metadata);
632
631
  grpc_metadata_array_destroy(&st->recv_trailing_metadata);
633
632
 
634
- if (st->recv_status_details != NULL) {
635
- gpr_free(st->recv_status_details);
633
+ if (GRPC_SLICE_START_PTR(st->send_status_details) != NULL) {
634
+ grpc_slice_unref(st->send_status_details);
635
+ }
636
+
637
+ if (GRPC_SLICE_START_PTR(st->recv_status_details) != NULL) {
638
+ grpc_slice_unref(st->recv_status_details);
636
639
  }
637
640
 
638
641
  if (st->recv_message != NULL) {
@@ -684,7 +687,7 @@ static void grpc_run_batch_stack_fill_ops(run_batch_stack *st, VALUE ops_hash) {
684
687
  /* N.B. later there is no need to explicitly delete the metadata keys
685
688
  * and values, they are references to data in ruby objects. */
686
689
  grpc_rb_op_update_status_from_server(
687
- &st->ops[st->op_num], &st->send_trailing_metadata, this_value);
690
+ &st->ops[st->op_num], &st->send_trailing_metadata, &st->send_status_details, this_value);
688
691
  break;
689
692
  case GRPC_OP_RECV_INITIAL_METADATA:
690
693
  st->ops[st->op_num].data.recv_initial_metadata.recv_initial_metadata =
@@ -700,8 +703,6 @@ static void grpc_run_batch_stack_fill_ops(run_batch_stack *st, VALUE ops_hash) {
700
703
  &st->recv_status;
701
704
  st->ops[st->op_num].data.recv_status_on_client.status_details =
702
705
  &st->recv_status_details;
703
- st->ops[st->op_num].data.recv_status_on_client.status_details_capacity =
704
- &st->recv_status_details_capacity;
705
706
  break;
706
707
  case GRPC_OP_RECV_CLOSE_ON_SERVER:
707
708
  st->ops[st->op_num].data.recv_close_on_server.cancelled =
@@ -749,9 +750,9 @@ static VALUE grpc_run_batch_stack_build_result(run_batch_stack *st) {
749
750
  rb_struct_aset(
750
751
  result, sym_status,
751
752
  rb_struct_new(grpc_rb_sStatus, UINT2NUM(st->recv_status),
752
- (st->recv_status_details == NULL
753
+ (GRPC_SLICE_START_PTR(st->recv_status_details) == NULL
753
754
  ? Qnil
754
- : rb_str_new2(st->recv_status_details)),
755
+ : grpc_rb_slice_to_ruby_string(st->recv_status_details)),
755
756
  grpc_rb_md_ary_to_h(&st->recv_trailing_metadata),
756
757
  NULL));
757
758
  break;
@@ -35,6 +35,7 @@
35
35
 
36
36
  #include "rb_grpc_imports.generated.h"
37
37
  #include "rb_channel.h"
38
+ #include "rb_byte_buffer.h"
38
39
 
39
40
  #include <grpc/grpc.h>
40
41
  #include <grpc/grpc_security.h>
@@ -252,10 +253,14 @@ static VALUE grpc_rb_channel_create_call(VALUE self, VALUE parent,
252
253
  grpc_channel *ch = NULL;
253
254
  grpc_completion_queue *cq = NULL;
254
255
  int flags = GRPC_PROPAGATE_DEFAULTS;
255
- char *method_chars = StringValueCStr(method);
256
- char *host_chars = NULL;
256
+ grpc_slice method_slice;
257
+ grpc_slice host_slice;
258
+ grpc_slice *host_slice_ptr = NULL;
259
+ char* tmp_str = NULL;
260
+
257
261
  if (host != Qnil) {
258
- host_chars = StringValueCStr(host);
262
+ host_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(host), RSTRING_LEN(host));
263
+ host_slice_ptr = &host_slice;
259
264
  }
260
265
  if (mask != Qnil) {
261
266
  flags = NUM2UINT(mask);
@@ -272,15 +277,25 @@ static VALUE grpc_rb_channel_create_call(VALUE self, VALUE parent,
272
277
  return Qnil;
273
278
  }
274
279
 
275
- call = grpc_channel_create_call(ch, parent_call, flags, cq, method_chars,
276
- host_chars, grpc_rb_time_timeval(
280
+ method_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(method), RSTRING_LEN(method));
281
+
282
+ call = grpc_channel_create_call(ch, parent_call, flags, cq, method_slice,
283
+ host_slice_ptr, grpc_rb_time_timeval(
277
284
  deadline,
278
285
  /* absolute time */ 0), NULL);
286
+
279
287
  if (call == NULL) {
288
+ tmp_str = grpc_slice_to_c_string(method_slice);
280
289
  rb_raise(rb_eRuntimeError, "cannot create call with method %s",
281
- method_chars);
290
+ tmp_str);
282
291
  return Qnil;
283
292
  }
293
+
294
+ grpc_slice_unref(method_slice);
295
+ if (host_slice_ptr != NULL) {
296
+ grpc_slice_unref(host_slice);
297
+ }
298
+
284
299
  res = grpc_rb_wrap_call(call, cq);
285
300
 
286
301
  /* Make this channel an instance attribute of the call so that it is not GCed
@@ -34,6 +34,7 @@
34
34
  #include <ruby/ruby.h>
35
35
 
36
36
  #include "rb_compression_options.h"
37
+ #include "rb_byte_buffer.h"
37
38
  #include "rb_grpc_imports.generated.h"
38
39
 
39
40
  #include <grpc/compression.h>
@@ -168,9 +169,9 @@ void grpc_rb_compression_options_set_default_level(
168
169
  * Raises an error if the name of the algorithm passed in is invalid. */
169
170
  void grpc_rb_compression_options_algorithm_name_to_value_internal(
170
171
  grpc_compression_algorithm *algorithm_value, VALUE algorithm_name) {
171
- char *name_str = NULL;
172
- long name_len = 0;
172
+ grpc_slice name_slice;
173
173
  VALUE algorithm_name_as_string = Qnil;
174
+ char *tmp_str = NULL;
174
175
 
175
176
  Check_Type(algorithm_name, T_SYMBOL);
176
177
 
@@ -178,16 +179,18 @@ void grpc_rb_compression_options_algorithm_name_to_value_internal(
178
179
  * correct C string out of it. */
179
180
  algorithm_name_as_string = rb_funcall(algorithm_name, rb_intern("to_s"), 0);
180
181
 
181
- name_str = RSTRING_PTR(algorithm_name_as_string);
182
- name_len = RSTRING_LEN(algorithm_name_as_string);
182
+ name_slice = grpc_slice_from_copied_buffer(RSTRING_PTR(algorithm_name_as_string), RSTRING_LEN(algorithm_name_as_string));
183
183
 
184
184
  /* Raise an error if the name isn't recognized as a compression algorithm by
185
185
  * the algorithm parse function
186
186
  * in GRPC core. */
187
- if (!grpc_compression_algorithm_parse(name_str, name_len, algorithm_value)) {
187
+ if(!grpc_compression_algorithm_parse(name_slice, algorithm_value)) {
188
+ tmp_str = grpc_slice_to_c_string(name_slice);
188
189
  rb_raise(rb_eNameError, "Invalid compression algorithm name: %s",
189
- StringValueCStr(algorithm_name_as_string));
190
+ tmp_str);
190
191
  }
192
+
193
+ grpc_slice_unref(name_slice);
191
194
  }
192
195
 
193
196
  /* Indicates whether a given algorithm is enabled on this instance, given the
@@ -107,6 +107,7 @@ grpc_channel_register_call_type grpc_channel_register_call_import;
107
107
  grpc_channel_create_registered_call_type grpc_channel_create_registered_call_import;
108
108
  grpc_call_start_batch_type grpc_call_start_batch_import;
109
109
  grpc_call_get_peer_type grpc_call_get_peer_import;
110
+ grpc_call_set_load_reporting_cost_context_type grpc_call_set_load_reporting_cost_context_import;
110
111
  grpc_census_call_set_context_type grpc_census_call_set_context_import;
111
112
  grpc_census_call_get_context_type grpc_census_call_get_context_import;
112
113
  grpc_channel_get_target_type grpc_channel_get_target_import;
@@ -179,17 +180,30 @@ grpc_slice_new_type grpc_slice_new_import;
179
180
  grpc_slice_new_with_user_data_type grpc_slice_new_with_user_data_import;
180
181
  grpc_slice_new_with_len_type grpc_slice_new_with_len_import;
181
182
  grpc_slice_malloc_type grpc_slice_malloc_import;
183
+ grpc_slice_intern_type grpc_slice_intern_import;
182
184
  grpc_slice_from_copied_string_type grpc_slice_from_copied_string_import;
183
185
  grpc_slice_from_copied_buffer_type grpc_slice_from_copied_buffer_import;
184
186
  grpc_slice_from_static_string_type grpc_slice_from_static_string_import;
187
+ grpc_slice_from_static_buffer_type grpc_slice_from_static_buffer_import;
185
188
  grpc_slice_sub_type grpc_slice_sub_import;
186
189
  grpc_slice_sub_no_ref_type grpc_slice_sub_no_ref_import;
187
190
  grpc_slice_split_tail_type grpc_slice_split_tail_import;
188
191
  grpc_slice_split_head_type grpc_slice_split_head_import;
189
- gpr_empty_slice_type gpr_empty_slice_import;
192
+ grpc_empty_slice_type grpc_empty_slice_import;
193
+ grpc_slice_default_hash_impl_type grpc_slice_default_hash_impl_import;
194
+ grpc_slice_default_eq_impl_type grpc_slice_default_eq_impl_import;
195
+ grpc_slice_eq_type grpc_slice_eq_import;
190
196
  grpc_slice_cmp_type grpc_slice_cmp_import;
191
197
  grpc_slice_str_cmp_type grpc_slice_str_cmp_import;
198
+ grpc_slice_buf_cmp_type grpc_slice_buf_cmp_import;
199
+ grpc_slice_buf_start_eq_type grpc_slice_buf_start_eq_import;
200
+ grpc_slice_rchr_type grpc_slice_rchr_import;
201
+ grpc_slice_chr_type grpc_slice_chr_import;
202
+ grpc_slice_slice_type grpc_slice_slice_import;
203
+ grpc_slice_hash_type grpc_slice_hash_import;
192
204
  grpc_slice_is_equivalent_type grpc_slice_is_equivalent_import;
205
+ grpc_slice_dup_type grpc_slice_dup_import;
206
+ grpc_slice_to_c_string_type grpc_slice_to_c_string_import;
193
207
  grpc_slice_buffer_init_type grpc_slice_buffer_init_import;
194
208
  grpc_slice_buffer_destroy_type grpc_slice_buffer_destroy_import;
195
209
  grpc_slice_buffer_add_type grpc_slice_buffer_add_import;
@@ -202,8 +216,11 @@ grpc_slice_buffer_swap_type grpc_slice_buffer_swap_import;
202
216
  grpc_slice_buffer_move_into_type grpc_slice_buffer_move_into_import;
203
217
  grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import;
204
218
  grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import;
219
+ grpc_slice_buffer_move_first_into_buffer_type grpc_slice_buffer_move_first_into_buffer_import;
205
220
  grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import;
221
+ grpc_slice_buffer_undo_take_first_type grpc_slice_buffer_undo_take_first_import;
206
222
  gpr_malloc_type gpr_malloc_import;
223
+ gpr_zalloc_type gpr_zalloc_import;
207
224
  gpr_free_type gpr_free_import;
208
225
  gpr_realloc_type gpr_realloc_import;
209
226
  gpr_malloc_aligned_type gpr_malloc_aligned_import;
@@ -383,6 +400,7 @@ void grpc_rb_load_imports(HMODULE library) {
383
400
  grpc_channel_create_registered_call_import = (grpc_channel_create_registered_call_type) GetProcAddress(library, "grpc_channel_create_registered_call");
384
401
  grpc_call_start_batch_import = (grpc_call_start_batch_type) GetProcAddress(library, "grpc_call_start_batch");
385
402
  grpc_call_get_peer_import = (grpc_call_get_peer_type) GetProcAddress(library, "grpc_call_get_peer");
403
+ grpc_call_set_load_reporting_cost_context_import = (grpc_call_set_load_reporting_cost_context_type) GetProcAddress(library, "grpc_call_set_load_reporting_cost_context");
386
404
  grpc_census_call_set_context_import = (grpc_census_call_set_context_type) GetProcAddress(library, "grpc_census_call_set_context");
387
405
  grpc_census_call_get_context_import = (grpc_census_call_get_context_type) GetProcAddress(library, "grpc_census_call_get_context");
388
406
  grpc_channel_get_target_import = (grpc_channel_get_target_type) GetProcAddress(library, "grpc_channel_get_target");
@@ -455,17 +473,30 @@ void grpc_rb_load_imports(HMODULE library) {
455
473
  grpc_slice_new_with_user_data_import = (grpc_slice_new_with_user_data_type) GetProcAddress(library, "grpc_slice_new_with_user_data");
456
474
  grpc_slice_new_with_len_import = (grpc_slice_new_with_len_type) GetProcAddress(library, "grpc_slice_new_with_len");
457
475
  grpc_slice_malloc_import = (grpc_slice_malloc_type) GetProcAddress(library, "grpc_slice_malloc");
476
+ grpc_slice_intern_import = (grpc_slice_intern_type) GetProcAddress(library, "grpc_slice_intern");
458
477
  grpc_slice_from_copied_string_import = (grpc_slice_from_copied_string_type) GetProcAddress(library, "grpc_slice_from_copied_string");
459
478
  grpc_slice_from_copied_buffer_import = (grpc_slice_from_copied_buffer_type) GetProcAddress(library, "grpc_slice_from_copied_buffer");
460
479
  grpc_slice_from_static_string_import = (grpc_slice_from_static_string_type) GetProcAddress(library, "grpc_slice_from_static_string");
480
+ grpc_slice_from_static_buffer_import = (grpc_slice_from_static_buffer_type) GetProcAddress(library, "grpc_slice_from_static_buffer");
461
481
  grpc_slice_sub_import = (grpc_slice_sub_type) GetProcAddress(library, "grpc_slice_sub");
462
482
  grpc_slice_sub_no_ref_import = (grpc_slice_sub_no_ref_type) GetProcAddress(library, "grpc_slice_sub_no_ref");
463
483
  grpc_slice_split_tail_import = (grpc_slice_split_tail_type) GetProcAddress(library, "grpc_slice_split_tail");
464
484
  grpc_slice_split_head_import = (grpc_slice_split_head_type) GetProcAddress(library, "grpc_slice_split_head");
465
- gpr_empty_slice_import = (gpr_empty_slice_type) GetProcAddress(library, "gpr_empty_slice");
485
+ grpc_empty_slice_import = (grpc_empty_slice_type) GetProcAddress(library, "grpc_empty_slice");
486
+ grpc_slice_default_hash_impl_import = (grpc_slice_default_hash_impl_type) GetProcAddress(library, "grpc_slice_default_hash_impl");
487
+ grpc_slice_default_eq_impl_import = (grpc_slice_default_eq_impl_type) GetProcAddress(library, "grpc_slice_default_eq_impl");
488
+ grpc_slice_eq_import = (grpc_slice_eq_type) GetProcAddress(library, "grpc_slice_eq");
466
489
  grpc_slice_cmp_import = (grpc_slice_cmp_type) GetProcAddress(library, "grpc_slice_cmp");
467
490
  grpc_slice_str_cmp_import = (grpc_slice_str_cmp_type) GetProcAddress(library, "grpc_slice_str_cmp");
491
+ grpc_slice_buf_cmp_import = (grpc_slice_buf_cmp_type) GetProcAddress(library, "grpc_slice_buf_cmp");
492
+ grpc_slice_buf_start_eq_import = (grpc_slice_buf_start_eq_type) GetProcAddress(library, "grpc_slice_buf_start_eq");
493
+ grpc_slice_rchr_import = (grpc_slice_rchr_type) GetProcAddress(library, "grpc_slice_rchr");
494
+ grpc_slice_chr_import = (grpc_slice_chr_type) GetProcAddress(library, "grpc_slice_chr");
495
+ grpc_slice_slice_import = (grpc_slice_slice_type) GetProcAddress(library, "grpc_slice_slice");
496
+ grpc_slice_hash_import = (grpc_slice_hash_type) GetProcAddress(library, "grpc_slice_hash");
468
497
  grpc_slice_is_equivalent_import = (grpc_slice_is_equivalent_type) GetProcAddress(library, "grpc_slice_is_equivalent");
498
+ grpc_slice_dup_import = (grpc_slice_dup_type) GetProcAddress(library, "grpc_slice_dup");
499
+ grpc_slice_to_c_string_import = (grpc_slice_to_c_string_type) GetProcAddress(library, "grpc_slice_to_c_string");
469
500
  grpc_slice_buffer_init_import = (grpc_slice_buffer_init_type) GetProcAddress(library, "grpc_slice_buffer_init");
470
501
  grpc_slice_buffer_destroy_import = (grpc_slice_buffer_destroy_type) GetProcAddress(library, "grpc_slice_buffer_destroy");
471
502
  grpc_slice_buffer_add_import = (grpc_slice_buffer_add_type) GetProcAddress(library, "grpc_slice_buffer_add");
@@ -478,8 +509,11 @@ void grpc_rb_load_imports(HMODULE library) {
478
509
  grpc_slice_buffer_move_into_import = (grpc_slice_buffer_move_into_type) GetProcAddress(library, "grpc_slice_buffer_move_into");
479
510
  grpc_slice_buffer_trim_end_import = (grpc_slice_buffer_trim_end_type) GetProcAddress(library, "grpc_slice_buffer_trim_end");
480
511
  grpc_slice_buffer_move_first_import = (grpc_slice_buffer_move_first_type) GetProcAddress(library, "grpc_slice_buffer_move_first");
512
+ grpc_slice_buffer_move_first_into_buffer_import = (grpc_slice_buffer_move_first_into_buffer_type) GetProcAddress(library, "grpc_slice_buffer_move_first_into_buffer");
481
513
  grpc_slice_buffer_take_first_import = (grpc_slice_buffer_take_first_type) GetProcAddress(library, "grpc_slice_buffer_take_first");
514
+ grpc_slice_buffer_undo_take_first_import = (grpc_slice_buffer_undo_take_first_type) GetProcAddress(library, "grpc_slice_buffer_undo_take_first");
482
515
  gpr_malloc_import = (gpr_malloc_type) GetProcAddress(library, "gpr_malloc");
516
+ gpr_zalloc_import = (gpr_zalloc_type) GetProcAddress(library, "gpr_zalloc");
483
517
  gpr_free_import = (gpr_free_type) GetProcAddress(library, "gpr_free");
484
518
  gpr_realloc_import = (gpr_realloc_type) GetProcAddress(library, "gpr_realloc");
485
519
  gpr_malloc_aligned_import = (gpr_malloc_aligned_type) GetProcAddress(library, "gpr_malloc_aligned");