Remove improper ifdef

pull/7900/head
Yuchen Zeng 9 years ago
parent ea88fc197b
commit dcd78be8c3
  1. 3
      BUILD
  2. 2
      CMakeLists.txt
  3. 2
      Makefile
  4. 1
      binding.gyp
  5. 1
      build.yaml
  6. 1
      config.m4
  7. 1
      gRPC-Core.podspec
  8. 1
      grpc.gemspec
  9. 1
      package.xml
  10. 8
      src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c
  11. 4
      src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c
  12. 7
      src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h
  13. 60
      src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c
  14. 1
      src/core/lib/security/credentials/fake/fake_credentials.c
  15. 2
      src/core/lib/security/credentials/fake/fake_credentials.h
  16. 1
      src/python/grpcio/grpc_core_dependencies.py
  17. 2
      test/core/end2end/fuzzers/api_fuzzer.c
  18. 1
      tools/doxygen/Doxyfile.core.internal
  19. 3
      tools/run_tests/sources_and_headers.json
  20. 2
      vsprojects/vcxproj/grpc/grpc.vcxproj
  21. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  22. 2
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  23. 3
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters

@ -489,6 +489,7 @@ cc_library(
"src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/load_reporting/load_reporting.c",
@ -1185,6 +1186,7 @@ cc_library(
"src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/load_reporting/load_reporting.c",
@ -1990,6 +1992,7 @@ objc_library(
"src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/load_reporting/load_reporting.c",

@ -453,6 +453,7 @@ add_library(grpc
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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
src/core/ext/resolver/dns/native/dns_resolver.c
src/core/ext/resolver/sockaddr/sockaddr_resolver.c
src/core/ext/load_reporting/load_reporting.c
@ -904,6 +905,7 @@ add_library(grpc_unsecure
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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
src/core/ext/resolver/dns/native/dns_resolver.c
src/core/ext/resolver/sockaddr/sockaddr_resolver.c
src/core/ext/load_reporting/load_reporting.c

@ -2756,6 +2756,7 @@ LIBGRPC_SRC = \
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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 \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/load_reporting/load_reporting.c \
@ -3455,6 +3456,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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 \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/load_reporting/load_reporting.c \

@ -742,6 +742,7 @@
'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/load_reporting/load_reporting.c',

@ -426,6 +426,7 @@ filegroups:
- src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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
plugin: grpc_resolver_dns_ares
uses:
- grpc_base

@ -257,6 +257,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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 \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/load_reporting/load_reporting.c \

@ -589,6 +589,7 @@ Pod::Spec.new do |s|
'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/load_reporting/load_reporting.c',

@ -508,6 +508,7 @@ Gem::Specification.new do |s|
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_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 )
s.files += %w( src/core/ext/resolver/dns/native/dns_resolver.c )
s.files += %w( src/core/ext/resolver/sockaddr/sockaddr_resolver.c )
s.files += %w( src/core/ext/load_reporting/load_reporting.c )

@ -516,6 +516,7 @@
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/native/dns_resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/sockaddr/sockaddr_resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/load_reporting/load_reporting.c" role="src" />

@ -230,12 +230,7 @@ static void dns_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
r->resolving = 1;
r->addresses = NULL;
r->pollent = NULL;
#ifdef GRPC_NATIVE_ADDRESS_RESOLVE
grpc_resolve_address(exec_ctx, r->name, r->default_port,
grpc_closure_create(dns_on_resolved, r),
&r->addresses);
#else
if (pollent) {
if (grpc_ares_need_poll_entity() && pollent) {
r->pollent = pollent;
grpc_polling_entity_add_to_pollset_set(exec_ctx, pollent,
r->base.pollset_set);
@ -245,7 +240,6 @@ static void dns_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_resolve_address_ares(
exec_ctx, r->name, r->default_port, r->base.pollset_set,
grpc_closure_create(dns_on_resolved, r), &r->addresses);
#endif
} else {
dns_maybe_finish_next_locked(exec_ctx, r);
}

@ -80,8 +80,6 @@ static void do_basic_init(void) { gpr_mu_init(&g_init_mu); }
static void destroy_request(grpc_ares_request *request) {
grpc_ares_ev_driver_destroy(request->ev_driver);
// ares_cancel(request->channel);
// ares_destroy(request->channel);
gpr_free(request->name);
gpr_free(request->host);
gpr_free(request->port);
@ -318,4 +316,6 @@ void grpc_ares_cleanup(void) {
gpr_mu_unlock(&g_init_mu);
}
int grpc_ares_need_poll_entity(void) { return 1; }
#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */

@ -35,16 +35,12 @@
#define GRPC_CORE_EXT_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H
#include <grpc/support/port_platform.h>
#ifndef GRPC_NATIVE_ADDRESS_RESOLVE
#include <stddef.h>
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/resolve_address.h"
// typedef struct grpc_ares_request grpc_ares_request;
extern void (*grpc_resolve_address_ares)(grpc_exec_ctx *exec_ctx,
const char *addr,
const char *default_port,
@ -56,6 +52,7 @@ grpc_error *grpc_ares_init(void);
void grpc_ares_cleanup(void);
#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */
/* TODO(zyc): remove this temporary hack after we can build c-ares on windows */
int grpc_ares_need_poll_entity(void);
#endif /* GRPC_CORE_EXT_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H */

@ -0,0 +1,60 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* TODO(zyc): remove this fallback after we can build c-ares on windows */
#include <grpc/support/port_platform.h>
#ifdef GRPC_NATIVE_ADDRESS_RESOLVE
#include "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h"
void grpc_resolve_address_ares_impl(grpc_exec_ctx *exec_ctx, const char *name,
const char *default_port,
grpc_pollset_set *pollset_set,
grpc_closure *on_done,
grpc_resolved_addresses **addrs) {
grpc_resolve_address(exec_ctx, name, default_port, on_done, addrs);
}
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_resolved_addresses **addrs) = grpc_resolve_address_ares_impl;
grpc_error *grpc_ares_init(void) { return GRPC_ERROR_NONE; }
void grpc_ares_cleanup(void) {}
int grpc_ares_need_poll_entity(void) { return 0; }
#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */

@ -37,6 +37,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/timer.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

@ -34,7 +34,6 @@
#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H
#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/security/credentials/credentials.h"
/* -- Fake transport security credentials. -- */
@ -51,7 +50,6 @@ grpc_server_credentials *grpc_fake_transport_security_server_credentials_create(
typedef struct {
grpc_call_credentials base;
grpc_credentials_md_store *md_store;
grpc_timer timer;
int is_async;
} grpc_md_only_test_credentials;

@ -251,6 +251,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.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',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/load_reporting/load_reporting.c',

@ -516,9 +516,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (squelch) gpr_set_log_function(dont_log);
input_stream inp = {data, data + size};
grpc_resolve_address = my_resolve_address;
#ifndef GRPC_NATIVE_ADDRESS_RESOLVE
grpc_resolve_address_ares = my_resolve_address_async;
#endif
grpc_tcp_client_connect_impl = my_tcp_client_connect;
gpr_now_impl = now_impl;
grpc_init();

@ -1127,6 +1127,7 @@ 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_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 \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/load_reporting/load_reporting.c \

@ -6303,7 +6303,8 @@
"src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h",
"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"
"src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h",
"src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c"
],
"third_party": false,
"type": "filegroup"

@ -814,6 +814,8 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper_fallback.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\native\dns_resolver.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\sockaddr\sockaddr_resolver.c">

@ -529,6 +529,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper.c">
<Filter>src\core\ext\resolver\dns\c_ares</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper_fallback.c">
<Filter>src\core\ext\resolver\dns\c_ares</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\native\dns_resolver.c">
<Filter>src\core\ext\resolver\dns\native</Filter>
</ClCompile>

@ -705,6 +705,8 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper_fallback.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\native\dns_resolver.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\sockaddr\sockaddr_resolver.c">

@ -418,6 +418,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper.c">
<Filter>src\core\ext\resolver\dns\c_ares</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_wrapper_fallback.c">
<Filter>src\core\ext\resolver\dns\c_ares</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\native\dns_resolver.c">
<Filter>src\core\ext\resolver\dns\native</Filter>
</ClCompile>

Loading…
Cancel
Save