grpc 1.14.2 → 1.15.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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +307 -12
  3. data/etc/roots.pem +40 -163
  4. data/include/grpc/grpc.h +49 -0
  5. data/include/grpc/grpc_security.h +0 -6
  6. data/include/grpc/grpc_security_constants.h +6 -0
  7. data/include/grpc/impl/codegen/grpc_types.h +17 -2
  8. data/include/grpc/impl/codegen/port_platform.h +41 -4
  9. data/include/grpc/support/sync.h +0 -16
  10. data/src/{cpp → core}/ext/filters/census/grpc_context.cc +0 -0
  11. data/src/core/ext/filters/client_channel/client_channel.cc +40 -11
  12. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +11 -9
  13. data/src/core/ext/filters/client_channel/client_channel_channelz.h +4 -2
  14. data/src/core/ext/filters/client_channel/lb_policy.h +14 -11
  15. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +67 -90
  16. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +108 -91
  17. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +79 -25
  18. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +40 -0
  19. data/src/core/ext/filters/client_channel/resolver.h +8 -0
  20. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +11 -3
  21. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +13 -10
  22. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +18 -4
  23. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +13 -5
  24. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +537 -0
  25. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +6 -5
  26. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +11 -0
  27. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc +29 -0
  28. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +29 -0
  29. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +9 -0
  30. data/src/core/ext/filters/client_channel/subchannel.cc +21 -8
  31. data/src/core/ext/filters/client_channel/subchannel.h +7 -0
  32. data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
  33. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +24 -0
  34. data/src/core/ext/transport/chttp2/transport/flow_control.cc +10 -7
  35. data/src/core/lib/channel/channel_stack.h +1 -1
  36. data/src/core/lib/channel/channel_trace.cc +1 -1
  37. data/src/core/lib/channel/channel_trace.h +1 -1
  38. data/src/core/lib/channel/channelz.cc +37 -27
  39. data/src/core/lib/channel/channelz.h +13 -4
  40. data/src/core/lib/channel/channelz_registry.cc +89 -4
  41. data/src/core/lib/channel/channelz_registry.h +56 -39
  42. data/src/core/lib/gpr/arena.cc +33 -40
  43. data/src/core/lib/gprpp/fork.cc +41 -33
  44. data/src/core/lib/gprpp/fork.h +13 -4
  45. data/src/core/lib/gprpp/mutex_lock.h +42 -0
  46. data/src/core/lib/gprpp/orphanable.h +4 -2
  47. data/src/core/lib/gprpp/ref_counted.h +4 -2
  48. data/src/core/lib/gprpp/ref_counted_ptr.h +65 -13
  49. data/src/core/lib/iomgr/call_combiner.h +4 -1
  50. data/src/core/lib/iomgr/ev_epoll1_linux.cc +77 -17
  51. data/src/core/lib/iomgr/ev_epollex_linux.cc +8 -26
  52. data/src/core/lib/iomgr/ev_epollsig_linux.cc +10 -28
  53. data/src/core/lib/iomgr/ev_poll_posix.cc +144 -35
  54. data/src/core/lib/iomgr/ev_posix.cc +58 -9
  55. data/src/core/lib/iomgr/ev_posix.h +22 -8
  56. data/src/core/lib/iomgr/exec_ctx.cc +6 -0
  57. data/src/core/lib/iomgr/exec_ctx.h +2 -0
  58. data/src/core/lib/iomgr/executor.cc +148 -72
  59. data/src/core/lib/iomgr/executor.h +39 -6
  60. data/src/core/lib/iomgr/fork_posix.cc +12 -1
  61. data/src/core/lib/iomgr/iocp_windows.cc +9 -4
  62. data/src/core/lib/iomgr/lockfree_event.cc +5 -1
  63. data/src/core/lib/iomgr/port.h +15 -2
  64. data/src/core/lib/iomgr/resolve_address_posix.cc +3 -2
  65. data/src/core/lib/iomgr/resolve_address_windows.cc +3 -2
  66. data/src/core/lib/iomgr/resource_quota.cc +78 -0
  67. data/src/core/lib/iomgr/resource_quota.h +16 -0
  68. data/src/core/lib/iomgr/socket_mutator.cc +1 -1
  69. data/src/core/lib/iomgr/socket_mutator.h +1 -1
  70. data/src/core/lib/iomgr/socket_windows.cc +33 -0
  71. data/src/core/lib/iomgr/socket_windows.h +6 -0
  72. data/src/core/lib/iomgr/tcp_windows.cc +2 -2
  73. data/src/core/lib/iomgr/tcp_windows.h +2 -0
  74. data/src/core/lib/iomgr/timer.h +3 -2
  75. data/src/core/lib/json/json.cc +2 -1
  76. data/src/core/lib/security/credentials/jwt/json_token.h +2 -0
  77. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -0
  78. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -1
  79. data/src/core/lib/security/security_connector/load_system_roots.h +29 -0
  80. data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +32 -0
  81. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +165 -0
  82. data/src/core/lib/security/security_connector/load_system_roots_linux.h +44 -0
  83. data/src/core/lib/security/security_connector/security_connector.cc +23 -4
  84. data/src/core/lib/security/transport/client_auth_filter.cc +0 -4
  85. data/src/core/lib/security/transport/server_auth_filter.cc +0 -2
  86. data/src/core/lib/surface/call.cc +7 -3
  87. data/src/core/lib/surface/channel.cc +18 -2
  88. data/src/core/lib/surface/completion_queue.cc +152 -15
  89. data/src/core/lib/surface/completion_queue.h +20 -1
  90. data/src/core/lib/surface/completion_queue_factory.cc +13 -4
  91. data/src/core/lib/surface/init.cc +2 -2
  92. data/src/core/lib/surface/init.h +0 -1
  93. data/src/core/lib/surface/version.cc +2 -2
  94. data/src/core/lib/transport/service_config.cc +2 -2
  95. data/src/core/lib/transport/service_config.h +3 -3
  96. data/src/core/lib/transport/transport.h +2 -0
  97. data/src/core/tsi/alts/crypt/aes_gcm.cc +2 -0
  98. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +8 -0
  99. data/src/core/tsi/grpc_shadow_boringssl.h +3006 -0
  100. data/src/core/tsi/ssl/session_cache/ssl_session.h +2 -0
  101. data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +5 -5
  102. data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +2 -0
  103. data/src/core/tsi/ssl_transport_security.cc +5 -3
  104. data/src/core/tsi/ssl_types.h +2 -0
  105. data/src/ruby/ext/grpc/extconf.rb +1 -26
  106. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -0
  107. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +18 -0
  108. data/src/ruby/lib/grpc/version.rb +1 -1
  109. data/src/ruby/spec/generic/client_stub_spec.rb +3 -3
  110. data/third_party/address_sorting/address_sorting.c +7 -2
  111. data/third_party/address_sorting/address_sorting_windows.c +43 -3
  112. data/third_party/address_sorting/include/address_sorting/address_sorting.h +3 -0
  113. metadata +40 -31
@@ -21,6 +21,8 @@
21
21
 
22
22
  #include <grpc/support/port_platform.h>
23
23
 
24
+ #include "src/core/tsi/grpc_shadow_boringssl.h"
25
+
24
26
  #include <grpc/slice.h>
25
27
 
26
28
  extern "C" {
@@ -18,9 +18,9 @@
18
18
 
19
19
  #include <grpc/support/port_platform.h>
20
20
 
21
- #include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
22
-
21
+ #include "src/core/lib/gprpp/mutex_lock.h"
23
22
  #include "src/core/tsi/ssl/session_cache/ssl_session.h"
23
+ #include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
24
24
 
25
25
  #include <grpc/support/log.h>
26
26
  #include <grpc/support/string_util.h>
@@ -97,7 +97,7 @@ SslSessionLRUCache::~SslSessionLRUCache() {
97
97
  }
98
98
 
99
99
  size_t SslSessionLRUCache::Size() {
100
- grpc_core::mu_guard guard(&lock_);
100
+ grpc_core::MutexLock lock(&lock_);
101
101
  return use_order_list_size_;
102
102
  }
103
103
 
@@ -117,7 +117,7 @@ SslSessionLRUCache::Node* SslSessionLRUCache::FindLocked(
117
117
  }
118
118
 
119
119
  void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
120
- grpc_core::mu_guard guard(&lock_);
120
+ grpc_core::MutexLock lock(&lock_);
121
121
  Node* node = FindLocked(grpc_slice_from_static_string(key));
122
122
  if (node != nullptr) {
123
123
  node->SetSession(std::move(session));
@@ -140,7 +140,7 @@ void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
140
140
  }
141
141
 
142
142
  SslSessionPtr SslSessionLRUCache::Get(const char* key) {
143
- grpc_core::mu_guard guard(&lock_);
143
+ grpc_core::MutexLock lock(&lock_);
144
144
  // Key is only used for lookups.
145
145
  grpc_slice key_slice = grpc_slice_from_static_string(key);
146
146
  Node* node = FindLocked(key_slice);
@@ -21,6 +21,8 @@
21
21
 
22
22
  #include <grpc/support/port_platform.h>
23
23
 
24
+ #include "src/core/tsi/grpc_shadow_boringssl.h"
25
+
24
26
  #include <grpc/slice.h>
25
27
  #include <grpc/support/sync.h>
26
28
 
@@ -18,6 +18,8 @@
18
18
 
19
19
  #include <grpc/support/port_platform.h>
20
20
 
21
+ #include "src/core/tsi/grpc_shadow_boringssl.h"
22
+
21
23
  #include "src/core/tsi/ssl_transport_security.h"
22
24
 
23
25
  #include <limits.h>
@@ -216,7 +218,7 @@ static void ssl_log_where_info(const SSL* ssl, int where, int flag,
216
218
  /* Used for debugging. TODO(jboeuf): Remove when code is mature enough. */
217
219
  static void ssl_info_callback(const SSL* ssl, int where, int ret) {
218
220
  if (ret == 0) {
219
- gpr_log(GPR_ERROR, "ssl_info_callback: error occured.\n");
221
+ gpr_log(GPR_ERROR, "ssl_info_callback: error occurred.\n");
220
222
  return;
221
223
  }
222
224
 
@@ -1049,9 +1051,9 @@ static tsi_result ssl_handshaker_result_extract_peer(
1049
1051
  }
1050
1052
 
1051
1053
  const char* session_reused = SSL_session_reused(impl->ssl) ? "true" : "false";
1052
- result = tsi_construct_string_peer_property(
1054
+ result = tsi_construct_string_peer_property_from_cstring(
1053
1055
  TSI_SSL_SESSION_REUSED_PEER_PROPERTY, session_reused,
1054
- strlen(session_reused) + 1, &peer->properties[peer->property_count]);
1056
+ &peer->properties[peer->property_count]);
1055
1057
  if (result != TSI_OK) return result;
1056
1058
  peer->property_count++;
1057
1059
 
@@ -29,6 +29,8 @@
29
29
 
30
30
  #include <grpc/support/port_platform.h>
31
31
 
32
+ #include "src/core/tsi/grpc_shadow_boringssl.h"
33
+
32
34
  #include <openssl/ssl.h>
33
35
 
34
36
  #ifdef OPENSSL_IS_BORINGSSL
@@ -15,31 +15,6 @@
15
15
  require 'etc'
16
16
  require 'mkmf'
17
17
 
18
- LIBDIR = RbConfig::CONFIG['libdir']
19
- INCLUDEDIR = RbConfig::CONFIG['includedir']
20
-
21
- HEADER_DIRS = [
22
- # Search /opt/local (Mac source install)
23
- '/opt/local/include',
24
-
25
- # Search /usr/local (Source install)
26
- '/usr/local/include',
27
-
28
- # Check the ruby install locations
29
- INCLUDEDIR
30
- ]
31
-
32
- LIB_DIRS = [
33
- # Search /opt/local (Mac source install)
34
- '/opt/local/lib',
35
-
36
- # Search /usr/local (Source install)
37
- '/usr/local/lib',
38
-
39
- # Check the ruby install locations
40
- LIBDIR
41
- ]
42
-
43
18
  windows = RUBY_PLATFORM =~ /mingw|mswin/
44
19
  bsd = RUBY_PLATFORM =~ /bsd/
45
20
 
@@ -110,7 +85,7 @@ if grpc_config == 'opt'
110
85
  o.puts i
111
86
  end
112
87
  o.puts
113
- o.puts 'strip:'
88
+ o.puts 'strip: $(DLLIB)'
114
89
  o.puts "\t$(ECHO) Stripping $(DLLIB)"
115
90
  o.puts "\t$(Q) #{strip_tool} $(DLLIB)"
116
91
  end
@@ -38,11 +38,13 @@ grpc_call_details_destroy_type grpc_call_details_destroy_import;
38
38
  grpc_register_plugin_type grpc_register_plugin_import;
39
39
  grpc_init_type grpc_init_import;
40
40
  grpc_shutdown_type grpc_shutdown_import;
41
+ grpc_is_initialized_type grpc_is_initialized_import;
41
42
  grpc_version_string_type grpc_version_string_import;
42
43
  grpc_g_stands_for_type grpc_g_stands_for_import;
43
44
  grpc_completion_queue_factory_lookup_type grpc_completion_queue_factory_lookup_import;
44
45
  grpc_completion_queue_create_for_next_type grpc_completion_queue_create_for_next_import;
45
46
  grpc_completion_queue_create_for_pluck_type grpc_completion_queue_create_for_pluck_import;
47
+ grpc_completion_queue_create_for_callback_type grpc_completion_queue_create_for_callback_import;
46
48
  grpc_completion_queue_create_type grpc_completion_queue_create_import;
47
49
  grpc_completion_queue_next_type grpc_completion_queue_next_import;
48
50
  grpc_completion_queue_pluck_type grpc_completion_queue_pluck_import;
@@ -65,6 +67,7 @@ grpc_census_call_set_context_type grpc_census_call_set_context_import;
65
67
  grpc_census_call_get_context_type grpc_census_call_get_context_import;
66
68
  grpc_channel_get_target_type grpc_channel_get_target_import;
67
69
  grpc_channel_get_info_type grpc_channel_get_info_import;
70
+ grpc_channel_reset_connect_backoff_type grpc_channel_reset_connect_backoff_import;
68
71
  grpc_insecure_channel_create_type grpc_insecure_channel_create_import;
69
72
  grpc_lame_client_channel_create_type grpc_lame_client_channel_create_import;
70
73
  grpc_channel_destroy_type grpc_channel_destroy_import;
@@ -91,7 +94,10 @@ grpc_resource_quota_create_type grpc_resource_quota_create_import;
91
94
  grpc_resource_quota_ref_type grpc_resource_quota_ref_import;
92
95
  grpc_resource_quota_unref_type grpc_resource_quota_unref_import;
93
96
  grpc_resource_quota_resize_type grpc_resource_quota_resize_import;
97
+ grpc_resource_quota_set_max_threads_type grpc_resource_quota_set_max_threads_import;
94
98
  grpc_resource_quota_arg_vtable_type grpc_resource_quota_arg_vtable_import;
99
+ grpc_channelz_get_top_channels_type grpc_channelz_get_top_channels_import;
100
+ grpc_channelz_get_channel_type grpc_channelz_get_channel_import;
95
101
  grpc_insecure_channel_create_from_fd_type grpc_insecure_channel_create_from_fd_import;
96
102
  grpc_server_add_insecure_channel_from_fd_type grpc_server_add_insecure_channel_from_fd_import;
97
103
  grpc_use_signal_type grpc_use_signal_import;
@@ -286,11 +292,13 @@ void grpc_rb_load_imports(HMODULE library) {
286
292
  grpc_register_plugin_import = (grpc_register_plugin_type) GetProcAddress(library, "grpc_register_plugin");
287
293
  grpc_init_import = (grpc_init_type) GetProcAddress(library, "grpc_init");
288
294
  grpc_shutdown_import = (grpc_shutdown_type) GetProcAddress(library, "grpc_shutdown");
295
+ grpc_is_initialized_import = (grpc_is_initialized_type) GetProcAddress(library, "grpc_is_initialized");
289
296
  grpc_version_string_import = (grpc_version_string_type) GetProcAddress(library, "grpc_version_string");
290
297
  grpc_g_stands_for_import = (grpc_g_stands_for_type) GetProcAddress(library, "grpc_g_stands_for");
291
298
  grpc_completion_queue_factory_lookup_import = (grpc_completion_queue_factory_lookup_type) GetProcAddress(library, "grpc_completion_queue_factory_lookup");
292
299
  grpc_completion_queue_create_for_next_import = (grpc_completion_queue_create_for_next_type) GetProcAddress(library, "grpc_completion_queue_create_for_next");
293
300
  grpc_completion_queue_create_for_pluck_import = (grpc_completion_queue_create_for_pluck_type) GetProcAddress(library, "grpc_completion_queue_create_for_pluck");
301
+ grpc_completion_queue_create_for_callback_import = (grpc_completion_queue_create_for_callback_type) GetProcAddress(library, "grpc_completion_queue_create_for_callback");
294
302
  grpc_completion_queue_create_import = (grpc_completion_queue_create_type) GetProcAddress(library, "grpc_completion_queue_create");
295
303
  grpc_completion_queue_next_import = (grpc_completion_queue_next_type) GetProcAddress(library, "grpc_completion_queue_next");
296
304
  grpc_completion_queue_pluck_import = (grpc_completion_queue_pluck_type) GetProcAddress(library, "grpc_completion_queue_pluck");
@@ -313,6 +321,7 @@ void grpc_rb_load_imports(HMODULE library) {
313
321
  grpc_census_call_get_context_import = (grpc_census_call_get_context_type) GetProcAddress(library, "grpc_census_call_get_context");
314
322
  grpc_channel_get_target_import = (grpc_channel_get_target_type) GetProcAddress(library, "grpc_channel_get_target");
315
323
  grpc_channel_get_info_import = (grpc_channel_get_info_type) GetProcAddress(library, "grpc_channel_get_info");
324
+ grpc_channel_reset_connect_backoff_import = (grpc_channel_reset_connect_backoff_type) GetProcAddress(library, "grpc_channel_reset_connect_backoff");
316
325
  grpc_insecure_channel_create_import = (grpc_insecure_channel_create_type) GetProcAddress(library, "grpc_insecure_channel_create");
317
326
  grpc_lame_client_channel_create_import = (grpc_lame_client_channel_create_type) GetProcAddress(library, "grpc_lame_client_channel_create");
318
327
  grpc_channel_destroy_import = (grpc_channel_destroy_type) GetProcAddress(library, "grpc_channel_destroy");
@@ -339,7 +348,10 @@ void grpc_rb_load_imports(HMODULE library) {
339
348
  grpc_resource_quota_ref_import = (grpc_resource_quota_ref_type) GetProcAddress(library, "grpc_resource_quota_ref");
340
349
  grpc_resource_quota_unref_import = (grpc_resource_quota_unref_type) GetProcAddress(library, "grpc_resource_quota_unref");
341
350
  grpc_resource_quota_resize_import = (grpc_resource_quota_resize_type) GetProcAddress(library, "grpc_resource_quota_resize");
351
+ grpc_resource_quota_set_max_threads_import = (grpc_resource_quota_set_max_threads_type) GetProcAddress(library, "grpc_resource_quota_set_max_threads");
342
352
  grpc_resource_quota_arg_vtable_import = (grpc_resource_quota_arg_vtable_type) GetProcAddress(library, "grpc_resource_quota_arg_vtable");
353
+ grpc_channelz_get_top_channels_import = (grpc_channelz_get_top_channels_type) GetProcAddress(library, "grpc_channelz_get_top_channels");
354
+ grpc_channelz_get_channel_import = (grpc_channelz_get_channel_type) GetProcAddress(library, "grpc_channelz_get_channel");
343
355
  grpc_insecure_channel_create_from_fd_import = (grpc_insecure_channel_create_from_fd_type) GetProcAddress(library, "grpc_insecure_channel_create_from_fd");
344
356
  grpc_server_add_insecure_channel_from_fd_import = (grpc_server_add_insecure_channel_from_fd_type) GetProcAddress(library, "grpc_server_add_insecure_channel_from_fd");
345
357
  grpc_use_signal_import = (grpc_use_signal_type) GetProcAddress(library, "grpc_use_signal");
@@ -89,6 +89,9 @@ extern grpc_init_type grpc_init_import;
89
89
  typedef void(*grpc_shutdown_type)(void);
90
90
  extern grpc_shutdown_type grpc_shutdown_import;
91
91
  #define grpc_shutdown grpc_shutdown_import
92
+ typedef int(*grpc_is_initialized_type)(void);
93
+ extern grpc_is_initialized_type grpc_is_initialized_import;
94
+ #define grpc_is_initialized grpc_is_initialized_import
92
95
  typedef const char*(*grpc_version_string_type)(void);
93
96
  extern grpc_version_string_type grpc_version_string_import;
94
97
  #define grpc_version_string grpc_version_string_import
@@ -104,6 +107,9 @@ extern grpc_completion_queue_create_for_next_type grpc_completion_queue_create_f
104
107
  typedef grpc_completion_queue*(*grpc_completion_queue_create_for_pluck_type)(void* reserved);
105
108
  extern grpc_completion_queue_create_for_pluck_type grpc_completion_queue_create_for_pluck_import;
106
109
  #define grpc_completion_queue_create_for_pluck grpc_completion_queue_create_for_pluck_import
110
+ typedef grpc_completion_queue*(*grpc_completion_queue_create_for_callback_type)(void* shutdown_callback, void* reserved);
111
+ extern grpc_completion_queue_create_for_callback_type grpc_completion_queue_create_for_callback_import;
112
+ #define grpc_completion_queue_create_for_callback grpc_completion_queue_create_for_callback_import
107
113
  typedef grpc_completion_queue*(*grpc_completion_queue_create_type)(const grpc_completion_queue_factory* factory, const grpc_completion_queue_attributes* attributes, void* reserved);
108
114
  extern grpc_completion_queue_create_type grpc_completion_queue_create_import;
109
115
  #define grpc_completion_queue_create grpc_completion_queue_create_import
@@ -170,6 +176,9 @@ extern grpc_channel_get_target_type grpc_channel_get_target_import;
170
176
  typedef void(*grpc_channel_get_info_type)(grpc_channel* channel, const grpc_channel_info* channel_info);
171
177
  extern grpc_channel_get_info_type grpc_channel_get_info_import;
172
178
  #define grpc_channel_get_info grpc_channel_get_info_import
179
+ typedef void(*grpc_channel_reset_connect_backoff_type)(grpc_channel* channel);
180
+ extern grpc_channel_reset_connect_backoff_type grpc_channel_reset_connect_backoff_import;
181
+ #define grpc_channel_reset_connect_backoff grpc_channel_reset_connect_backoff_import
173
182
  typedef grpc_channel*(*grpc_insecure_channel_create_type)(const char* target, const grpc_channel_args* args, void* reserved);
174
183
  extern grpc_insecure_channel_create_type grpc_insecure_channel_create_import;
175
184
  #define grpc_insecure_channel_create grpc_insecure_channel_create_import
@@ -248,9 +257,18 @@ extern grpc_resource_quota_unref_type grpc_resource_quota_unref_import;
248
257
  typedef void(*grpc_resource_quota_resize_type)(grpc_resource_quota* resource_quota, size_t new_size);
249
258
  extern grpc_resource_quota_resize_type grpc_resource_quota_resize_import;
250
259
  #define grpc_resource_quota_resize grpc_resource_quota_resize_import
260
+ typedef void(*grpc_resource_quota_set_max_threads_type)(grpc_resource_quota* resource_quota, int new_max_threads);
261
+ extern grpc_resource_quota_set_max_threads_type grpc_resource_quota_set_max_threads_import;
262
+ #define grpc_resource_quota_set_max_threads grpc_resource_quota_set_max_threads_import
251
263
  typedef const grpc_arg_pointer_vtable*(*grpc_resource_quota_arg_vtable_type)(void);
252
264
  extern grpc_resource_quota_arg_vtable_type grpc_resource_quota_arg_vtable_import;
253
265
  #define grpc_resource_quota_arg_vtable grpc_resource_quota_arg_vtable_import
266
+ typedef char*(*grpc_channelz_get_top_channels_type)(intptr_t start_channel_id);
267
+ extern grpc_channelz_get_top_channels_type grpc_channelz_get_top_channels_import;
268
+ #define grpc_channelz_get_top_channels grpc_channelz_get_top_channels_import
269
+ typedef char*(*grpc_channelz_get_channel_type)(intptr_t channel_id);
270
+ extern grpc_channelz_get_channel_type grpc_channelz_get_channel_import;
271
+ #define grpc_channelz_get_channel grpc_channelz_get_channel_import
254
272
  typedef grpc_channel*(*grpc_insecure_channel_create_from_fd_type)(const char* target, int fd, const grpc_channel_args* args);
255
273
  extern grpc_insecure_channel_create_from_fd_type grpc_insecure_channel_create_from_fd_import;
256
274
  #define grpc_insecure_channel_create_from_fd grpc_insecure_channel_create_from_fd_import
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.14.2'
17
+ VERSION = '1.15.0.pre1'
18
18
  end
@@ -265,14 +265,14 @@ describe 'ClientStub' do # rubocop:disable Metrics/BlockLength
265
265
  end
266
266
  creds = GRPC::Core::CallCredentials.new(failing_auth)
267
267
 
268
- unavailable_error_occured = false
268
+ unavailable_error_occurred = false
269
269
  begin
270
270
  get_response(stub, credentials: creds)
271
271
  rescue GRPC::Unavailable => e
272
- unavailable_error_occured = true
272
+ unavailable_error_occurred = true
273
273
  expect(e.details.include?(error_message)).to be true
274
274
  end
275
- expect(unavailable_error_occured).to eq(true)
275
+ expect(unavailable_error_occurred).to eq(true)
276
276
 
277
277
  @server.shutdown_and_notify(Time.now + 3)
278
278
  th.join
@@ -55,12 +55,17 @@ static const int kIPv6AddrScopeGlobal = 3;
55
55
  static address_sorting_source_addr_factory* g_current_source_addr_factory =
56
56
  NULL;
57
57
 
58
- static int address_sorting_get_source_addr(const address_sorting_address* dest,
59
- address_sorting_address* source) {
58
+ static bool address_sorting_get_source_addr(const address_sorting_address* dest,
59
+ address_sorting_address* source) {
60
60
  return g_current_source_addr_factory->vtable->get_source_addr(
61
61
  g_current_source_addr_factory, dest, source);
62
62
  }
63
63
 
64
+ bool address_sorting_get_source_addr_for_testing(
65
+ const address_sorting_address* dest, address_sorting_address* source) {
66
+ return address_sorting_get_source_addr(dest, source);
67
+ }
68
+
64
69
  static int ipv6_prefix_match_length(const struct sockaddr_in6* sa,
65
70
  const struct sockaddr_in6* sb) {
66
71
  unsigned char* a = (unsigned char*)&sa->sin6_addr;
@@ -42,14 +42,54 @@
42
42
 
43
43
  #if defined(ADDRESS_SORTING_WINDOWS)
44
44
 
45
+ #include <errno.h>
46
+ #include <inttypes.h>
47
+ #include <limits.h>
45
48
  #include <stdlib.h>
49
+ #include <string.h>
50
+ #include <sys/types.h>
46
51
 
47
- /* TODO : Add address sorting functionality to work on windows. */
52
+ static bool windows_source_addr_factory_get_source_addr(
53
+ address_sorting_source_addr_factory* factory,
54
+ const address_sorting_address* dest_addr,
55
+ address_sorting_address* source_addr) {
56
+ bool source_addr_exists = false;
57
+ SOCKET s = socket(((struct sockaddr_in6*)dest_addr)->sin6_family, SOCK_DGRAM,
58
+ IPPROTO_UDP);
59
+ if (s != INVALID_SOCKET) {
60
+ if (connect(s, (struct sockaddr*)dest_addr, (int)dest_addr->len) == 0) {
61
+ address_sorting_address found_source_addr;
62
+ memset(&found_source_addr, 0, sizeof(found_source_addr));
63
+ found_source_addr.len = sizeof(found_source_addr.addr);
64
+ if (getsockname(s, (struct sockaddr*)&found_source_addr.addr,
65
+ (socklen_t*)&found_source_addr.len) == 0) {
66
+ source_addr_exists = true;
67
+ *source_addr = found_source_addr;
68
+ }
69
+ }
70
+ closesocket(s);
71
+ }
72
+ return source_addr_exists;
73
+ }
74
+
75
+ static void windows_source_addr_factory_destroy(
76
+ address_sorting_source_addr_factory* self) {
77
+ free(self);
78
+ }
79
+
80
+ static const address_sorting_source_addr_factory_vtable
81
+ windows_source_addr_factory_vtable = {
82
+ windows_source_addr_factory_get_source_addr,
83
+ windows_source_addr_factory_destroy,
84
+ };
48
85
 
49
86
  address_sorting_source_addr_factory*
50
87
  address_sorting_create_source_addr_factory_for_current_platform() {
51
- abort();
52
- return NULL;
88
+ address_sorting_source_addr_factory* factory =
89
+ malloc(sizeof(address_sorting_source_addr_factory));
90
+ memset(factory, 0, sizeof(address_sorting_source_addr_factory));
91
+ factory->vtable = &windows_source_addr_factory_vtable;
92
+ return factory;
53
93
  }
54
94
 
55
95
  #endif // defined(ADDRESS_SORTING_WINDOWS)
@@ -103,6 +103,9 @@ address_sorting_family address_sorting_abstract_get_family(
103
103
  void address_sorting_override_source_addr_factory_for_testing(
104
104
  address_sorting_source_addr_factory* factory);
105
105
 
106
+ bool address_sorting_get_source_addr_for_testing(
107
+ const address_sorting_address* dest, address_sorting_address* source);
108
+
106
109
  #ifdef __cplusplus
107
110
  }
108
111
  #endif
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.2
4
+ version: 1.15.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2018-08-29 00:00:00.000000000 Z
11
+ date: 2018-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -264,6 +264,7 @@ files:
264
264
  - include/grpc/support/time.h
265
265
  - include/grpc/support/workaround_list.h
266
266
  - src/boringssl/err_data.c
267
+ - src/core/ext/filters/census/grpc_context.cc
267
268
  - src/core/ext/filters/client_channel/backup_poller.cc
268
269
  - src/core/ext/filters/client_channel/backup_poller.h
269
270
  - src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -319,9 +320,12 @@ files:
319
320
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
320
321
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
321
322
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
323
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
322
324
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
323
325
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
324
326
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
327
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
328
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
325
329
  - src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
326
330
  - src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
327
331
  - src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
@@ -520,6 +524,7 @@ files:
520
524
  - src/core/lib/gprpp/inlined_vector.h
521
525
  - src/core/lib/gprpp/manual_constructor.h
522
526
  - src/core/lib/gprpp/memory.h
527
+ - src/core/lib/gprpp/mutex_lock.h
523
528
  - src/core/lib/gprpp/orphanable.h
524
529
  - src/core/lib/gprpp/ref_counted.h
525
530
  - src/core/lib/gprpp/ref_counted_ptr.h
@@ -733,6 +738,10 @@ files:
733
738
  - src/core/lib/security/credentials/ssl/ssl_credentials.h
734
739
  - src/core/lib/security/security_connector/alts_security_connector.cc
735
740
  - src/core/lib/security/security_connector/alts_security_connector.h
741
+ - src/core/lib/security/security_connector/load_system_roots.h
742
+ - src/core/lib/security/security_connector/load_system_roots_fallback.cc
743
+ - src/core/lib/security/security_connector/load_system_roots_linux.cc
744
+ - src/core/lib/security/security_connector/load_system_roots_linux.h
736
745
  - src/core/lib/security/security_connector/local_security_connector.cc
737
746
  - src/core/lib/security/security_connector/local_security_connector.h
738
747
  - src/core/lib/security/security_connector/security_connector.cc
@@ -876,6 +885,7 @@ files:
876
885
  - src/core/tsi/alts_transport_security.h
877
886
  - src/core/tsi/fake_transport_security.cc
878
887
  - src/core/tsi/fake_transport_security.h
888
+ - src/core/tsi/grpc_shadow_boringssl.h
879
889
  - src/core/tsi/local_transport_security.cc
880
890
  - src/core/tsi/local_transport_security.h
881
891
  - src/core/tsi/ssl/session_cache/ssl_session.h
@@ -891,7 +901,6 @@ files:
891
901
  - src/core/tsi/transport_security_grpc.cc
892
902
  - src/core/tsi/transport_security_grpc.h
893
903
  - src/core/tsi/transport_security_interface.h
894
- - src/cpp/ext/filters/census/grpc_context.cc
895
904
  - src/ruby/bin/math_client.rb
896
905
  - src/ruby/bin/math_pb.rb
897
906
  - src/ruby/bin/math_server.rb
@@ -1547,9 +1556,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1547
1556
  version: 2.0.0
1548
1557
  required_rubygems_version: !ruby/object:Gem::Requirement
1549
1558
  requirements:
1550
- - - ">="
1559
+ - - ">"
1551
1560
  - !ruby/object:Gem::Version
1552
- version: '0'
1561
+ version: 1.3.1
1553
1562
  requirements: []
1554
1563
  rubyforge_project:
1555
1564
  rubygems_version: 2.7.7
@@ -1557,36 +1566,36 @@ signing_key:
1557
1566
  specification_version: 4
1558
1567
  summary: GRPC system in Ruby
1559
1568
  test_files:
1560
- - src/ruby/spec/compression_options_spec.rb
1569
+ - src/ruby/spec/call_spec.rb
1570
+ - src/ruby/spec/client_server_spec.rb
1571
+ - src/ruby/spec/client_auth_spec.rb
1572
+ - src/ruby/spec/channel_connection_spec.rb
1573
+ - src/ruby/spec/google_rpc_status_utils_spec.rb
1574
+ - src/ruby/spec/server_credentials_spec.rb
1575
+ - src/ruby/spec/server_spec.rb
1576
+ - src/ruby/spec/call_credentials_spec.rb
1561
1577
  - src/ruby/spec/error_sanity_spec.rb
1562
- - src/ruby/spec/generic/server_interceptors_spec.rb
1563
- - src/ruby/spec/generic/rpc_server_spec.rb
1564
- - src/ruby/spec/generic/active_call_spec.rb
1578
+ - src/ruby/spec/compression_options_spec.rb
1579
+ - src/ruby/spec/support/services.rb
1580
+ - src/ruby/spec/support/helpers.rb
1581
+ - src/ruby/spec/pb/duplicate/codegen_spec.rb
1582
+ - src/ruby/spec/pb/health/checker_spec.rb
1583
+ - src/ruby/spec/channel_spec.rb
1565
1584
  - src/ruby/spec/generic/client_stub_spec.rb
1566
- - src/ruby/spec/generic/client_interceptors_spec.rb
1567
- - src/ruby/spec/generic/interceptor_registry_spec.rb
1585
+ - src/ruby/spec/generic/active_call_spec.rb
1568
1586
  - src/ruby/spec/generic/rpc_server_pool_spec.rb
1569
- - src/ruby/spec/generic/service_spec.rb
1570
1587
  - src/ruby/spec/generic/rpc_desc_spec.rb
1571
- - src/ruby/spec/client_server_spec.rb
1588
+ - src/ruby/spec/generic/service_spec.rb
1589
+ - src/ruby/spec/generic/server_interceptors_spec.rb
1590
+ - src/ruby/spec/generic/rpc_server_spec.rb
1591
+ - src/ruby/spec/generic/interceptor_registry_spec.rb
1592
+ - src/ruby/spec/generic/client_interceptors_spec.rb
1572
1593
  - src/ruby/spec/spec_helper.rb
1573
- - src/ruby/spec/call_spec.rb
1574
- - src/ruby/spec/server_credentials_spec.rb
1575
- - src/ruby/spec/testdata/server1.pem
1576
- - src/ruby/spec/testdata/server1.key
1577
- - src/ruby/spec/testdata/README
1594
+ - src/ruby/spec/channel_credentials_spec.rb
1595
+ - src/ruby/spec/time_consts_spec.rb
1578
1596
  - src/ruby/spec/testdata/client.pem
1579
- - src/ruby/spec/testdata/client.key
1580
1597
  - src/ruby/spec/testdata/ca.pem
1581
- - src/ruby/spec/channel_spec.rb
1582
- - src/ruby/spec/client_auth_spec.rb
1583
- - src/ruby/spec/time_consts_spec.rb
1584
- - src/ruby/spec/pb/health/checker_spec.rb
1585
- - src/ruby/spec/pb/duplicate/codegen_spec.rb
1586
- - src/ruby/spec/server_spec.rb
1587
- - src/ruby/spec/channel_credentials_spec.rb
1588
- - src/ruby/spec/google_rpc_status_utils_spec.rb
1589
- - src/ruby/spec/support/services.rb
1590
- - src/ruby/spec/support/helpers.rb
1591
- - src/ruby/spec/call_credentials_spec.rb
1592
- - src/ruby/spec/channel_connection_spec.rb
1598
+ - src/ruby/spec/testdata/server1.pem
1599
+ - src/ruby/spec/testdata/client.key
1600
+ - src/ruby/spec/testdata/README
1601
+ - src/ruby/spec/testdata/server1.key