diff --git a/BUILD b/BUILD index 3e6b0e2cbe2..2652f40b595 100644 --- a/BUILD +++ b/BUILD @@ -521,6 +521,7 @@ cc_library( "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c", + "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c", @@ -1273,6 +1274,7 @@ cc_library( "src/core/ext/client_channel/subchannel_index.c", "src/core/ext/client_channel/uri_parser.c", "src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c", + "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c", @@ -2195,6 +2197,7 @@ objc_library( "src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c", + "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c", diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e6db36f60a..4ec7b20ebda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -505,6 +505,7 @@ add_library(grpc src/core/ext/lb_policy/pick_first/pick_first.c src/core/ext/lb_policy/round_robin/round_robin.c src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c + src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c @@ -993,6 +994,7 @@ add_library(grpc_unsecure src/core/ext/client_channel/subchannel_index.c src/core/ext/client_channel/uri_parser.c src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c + src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c diff --git a/Makefile b/Makefile index a811e10e6ac..c0e7648e0f1 100644 --- a/Makefile +++ b/Makefile @@ -2823,6 +2823,7 @@ LIBGRPC_SRC = \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \ + src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c \ @@ -3571,6 +3572,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/client_channel/subchannel_index.c \ src/core/ext/client_channel/uri_parser.c \ src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \ + src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c \ diff --git a/binding.gyp b/binding.gyp index 9dcd2e36400..5d707cd6041 100644 --- a/binding.gyp +++ b/binding.gyp @@ -761,6 +761,7 @@ 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c', + 'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c', diff --git a/build.yaml b/build.yaml index 02caafc0c09..99fb2d87bc9 100644 --- a/build.yaml +++ b/build.yaml @@ -465,6 +465,7 @@ filegroups: - src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h src: - src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c + - src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c - src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c - src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c - src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c diff --git a/config.m4 b/config.m4 index a7effbf06f8..45d30a7ef0a 100644 --- a/config.m4 +++ b/config.m4 @@ -273,6 +273,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \ + src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c \ diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index ad4d9850633..7e08f9170f4 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -616,6 +616,7 @@ Pod::Spec.new do |s| 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c', + 'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c', diff --git a/grpc.gemspec b/grpc.gemspec index f8793e0e507..860f42bbc1a 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -535,6 +535,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c ) s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c ) s.files += %w( src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c ) + s.files += %w( src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c ) s.files += %w( src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c ) s.files += %w( src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c ) s.files += %w( src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c ) diff --git a/package.xml b/package.xml index 15310d751be..c485dfbf938 100644 --- a/package.xml +++ b/package.xml @@ -542,6 +542,7 @@ + diff --git a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h index 4d2b451321b..f31d9580a1d 100644 --- a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h +++ b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h @@ -34,9 +34,6 @@ #ifndef GRPC_CORE_EXT_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H #define GRPC_CORE_EXT_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H -#include -#ifndef GRPC_NATIVE_ADDRESS_RESOLVE - #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/pollset_set.h" @@ -64,6 +61,4 @@ grpc_error *grpc_ares_ev_driver_create(grpc_ares_ev_driver **ev_driver, void grpc_ares_ev_driver_destroy(grpc_exec_ctx *exec_ctx, grpc_ares_ev_driver *ev_driver); -#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */ - #endif /* GRPC_CORE_EXT_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H */ diff --git a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_windows.c b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c similarity index 72% rename from src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_windows.c rename to src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c index 4c055d90d92..2b5fd44f05a 100644 --- a/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_windows.c +++ b/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c @@ -30,8 +30,27 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ + #include -#ifdef GPR_WINSOCK_SOCKET +#ifdef GRPC_NATIVE_ADDRESS_RESOLVE + #include "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h" -#endif /* GPR_WINSOCK_SOCKET */ +struct grpc_ares_ev_driver {}; + +void grpc_ares_ev_driver_start(grpc_exec_ctx *exec_ctx, + grpc_ares_ev_driver *ev_driver) {} + +void *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver) { + return NULL; +} + +grpc_error *grpc_ares_ev_driver_create(grpc_ares_ev_driver **ev_driver, + grpc_pollset_set *pollset_set) { + return GRPC_ERROR_NONE; +} + +void grpc_ares_ev_driver_destroy(grpc_exec_ctx *exec_ctx, + grpc_ares_ev_driver *ev_driver) {} + +#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */ diff --git a/src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c b/src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c index 6c1053a5550..05eae51d0d7 100644 --- a/src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c +++ b/src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c @@ -40,7 +40,7 @@ void grpc_resolve_address_ares_impl(grpc_exec_ctx *exec_ctx, const char *name, const char *default_port, - grpc_pollset_set *pollset_set, + grpc_ares_ev_driver *ev_driver, grpc_closure *on_done, grpc_resolved_addresses **addrs) { grpc_resolve_address(exec_ctx, name, default_port, on_done, addrs); @@ -48,7 +48,7 @@ void grpc_resolve_address_ares_impl(grpc_exec_ctx *exec_ctx, const char *name, void (*grpc_resolve_address_ares)( grpc_exec_ctx *exec_ctx, const char *name, const char *default_port, - grpc_pollset_set *pollset_set, grpc_closure *on_done, + grpc_ares_ev_driver *ev_driver, grpc_closure *on_done, grpc_resolved_addresses **addrs) = grpc_resolve_address_ares_impl; grpc_error *grpc_ares_init(void) { return GRPC_ERROR_NONE; } diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index ab3fe9cfbb0..7aeb491b045 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -267,6 +267,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c', + 'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c', 'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 5d6d6f2c160..bd30636c752 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1152,6 +1152,7 @@ third_party/nanopb/pb_encode.c \ src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \ +src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \ src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index aa8b1b9c82f..f294eb1e18c 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -7087,6 +7087,7 @@ "src": [ "src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h", + "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c", "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index d39a8241dff..e217f4cc05a 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -853,6 +853,8 @@ + + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 41954f22e62..65c42292d19 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -571,6 +571,9 @@ src\core\ext\resolver\dns\c_ares + + src\core\ext\resolver\dns\c_ares + src\core\ext\resolver\dns\c_ares diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 7c4b4d6cbb2..258efdf7c38 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -747,6 +747,8 @@ + + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 3d3a2e767ea..f2528bfcbf2 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -463,6 +463,9 @@ src\core\ext\resolver\dns\c_ares + + src\core\ext\resolver\dns\c_ares + src\core\ext\resolver\dns\c_ares