Move method config table code to its own module.

pull/8303/head
Mark D. Roth 8 years ago
parent 9037eff583
commit 4c3a4688bb
  1. 8
      BUILD
  2. 3
      CMakeLists.txt
  3. 3
      Makefile
  4. 1
      binding.gyp
  5. 2
      build.yaml
  6. 1
      config.m4
  7. 3
      gRPC-Core.podspec
  8. 2
      grpc.gemspec
  9. 3
      include/grpc/impl/codegen/grpc_types.h
  10. 2
      package.xml
  11. 9
      src/core/ext/client_config/client_channel.c
  12. 177
      src/core/ext/client_config/resolver_result.c
  13. 55
      src/core/ext/client_config/resolver_result.h
  14. 2
      src/core/ext/resolver/dns/native/dns_resolver.c
  15. 2
      src/core/ext/resolver/sockaddr/sockaddr_resolver.c
  16. 1
      src/python/grpcio/grpc_core_dependencies.py
  17. 2
      tools/doxygen/Doxyfile.core.internal
  18. 3
      tools/run_tests/sources_and_headers.json
  19. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj
  20. 6
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  21. 3
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  22. 6
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters

@ -297,6 +297,7 @@ cc_library(
"src/core/ext/client_config/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h",
"src/core/ext/client_config/parse_address.h",
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
@ -476,6 +477,7 @@ cc_library(
"src/core/ext/client_config/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c",
"src/core/ext/client_config/parse_address.c",
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
@ -673,6 +675,7 @@ cc_library(
"src/core/ext/client_config/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h",
"src/core/ext/client_config/parse_address.h",
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
@ -834,6 +837,7 @@ cc_library(
"src/core/ext/client_config/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c",
"src/core/ext/client_config/parse_address.c",
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
@ -1026,6 +1030,7 @@ cc_library(
"src/core/ext/client_config/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h",
"src/core/ext/client_config/parse_address.h",
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
@ -1180,6 +1185,7 @@ cc_library(
"src/core/ext/client_config/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c",
"src/core/ext/client_config/parse_address.c",
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
@ -2326,6 +2332,7 @@ objc_library(
"src/core/ext/client_config/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c",
"src/core/ext/client_config/parse_address.c",
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
@ -2525,6 +2532,7 @@ objc_library(
"src/core/ext/client_config/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h",
"src/core/ext/client_config/parse_address.h",
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",

@ -444,6 +444,7 @@ add_library(grpc
src/core/ext/client_config/lb_policy.c
src/core/ext/client_config/lb_policy_factory.c
src/core/ext/client_config/lb_policy_registry.c
src/core/ext/client_config/method_config.c
src/core/ext/client_config/parse_address.c
src/core/ext/client_config/resolver.c
src/core/ext/client_config/resolver_factory.c
@ -676,6 +677,7 @@ add_library(grpc_cronet
src/core/ext/client_config/lb_policy.c
src/core/ext/client_config/lb_policy_factory.c
src/core/ext/client_config/lb_policy_registry.c
src/core/ext/client_config/method_config.c
src/core/ext/client_config/parse_address.c
src/core/ext/client_config/resolver.c
src/core/ext/client_config/resolver_factory.c
@ -906,6 +908,7 @@ add_library(grpc_unsecure
src/core/ext/client_config/lb_policy.c
src/core/ext/client_config/lb_policy_factory.c
src/core/ext/client_config/lb_policy_registry.c
src/core/ext/client_config/method_config.c
src/core/ext/client_config/parse_address.c
src/core/ext/client_config/resolver.c
src/core/ext/client_config/resolver_factory.c

@ -2681,6 +2681,7 @@ LIBGRPC_SRC = \
src/core/ext/client_config/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \
src/core/ext/client_config/parse_address.c \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \
@ -2931,6 +2932,7 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/client_config/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \
src/core/ext/client_config/parse_address.c \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \
@ -3388,6 +3390,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/client_config/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \
src/core/ext/client_config/parse_address.c \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \

@ -719,6 +719,7 @@
'src/core/ext/client_config/lb_policy.c',
'src/core/ext/client_config/lb_policy_factory.c',
'src/core/ext/client_config/lb_policy_registry.c',
'src/core/ext/client_config/method_config.c',
'src/core/ext/client_config/parse_address.c',
'src/core/ext/client_config/resolver.c',
'src/core/ext/client_config/resolver_factory.c',

@ -354,6 +354,7 @@ filegroups:
- src/core/ext/client_config/lb_policy.h
- src/core/ext/client_config/lb_policy_factory.h
- src/core/ext/client_config/lb_policy_registry.h
- src/core/ext/client_config/method_config.h
- src/core/ext/client_config/parse_address.h
- src/core/ext/client_config/resolver.h
- src/core/ext/client_config/resolver_factory.h
@ -374,6 +375,7 @@ filegroups:
- src/core/ext/client_config/lb_policy.c
- src/core/ext/client_config/lb_policy_factory.c
- src/core/ext/client_config/lb_policy_registry.c
- src/core/ext/client_config/method_config.c
- src/core/ext/client_config/parse_address.c
- src/core/ext/client_config/resolver.c
- src/core/ext/client_config/resolver_factory.c

@ -238,6 +238,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/client_config/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \
src/core/ext/client_config/parse_address.c \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \

@ -384,6 +384,7 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/lb_policy.h',
'src/core/ext/client_config/lb_policy_factory.h',
'src/core/ext/client_config/lb_policy_registry.h',
'src/core/ext/client_config/method_config.h',
'src/core/ext/client_config/parse_address.h',
'src/core/ext/client_config/resolver.h',
'src/core/ext/client_config/resolver_factory.h',
@ -567,6 +568,7 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/lb_policy.c',
'src/core/ext/client_config/lb_policy_factory.c',
'src/core/ext/client_config/lb_policy_registry.c',
'src/core/ext/client_config/method_config.c',
'src/core/ext/client_config/parse_address.c',
'src/core/ext/client_config/resolver.c',
'src/core/ext/client_config/resolver_factory.c',
@ -755,6 +757,7 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/lb_policy.h',
'src/core/ext/client_config/lb_policy_factory.h',
'src/core/ext/client_config/lb_policy_registry.h',
'src/core/ext/client_config/method_config.h',
'src/core/ext/client_config/parse_address.h',
'src/core/ext/client_config/resolver.h',
'src/core/ext/client_config/resolver_factory.h',

@ -304,6 +304,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_config/lb_policy.h )
s.files += %w( src/core/ext/client_config/lb_policy_factory.h )
s.files += %w( src/core/ext/client_config/lb_policy_registry.h )
s.files += %w( src/core/ext/client_config/method_config.h )
s.files += %w( src/core/ext/client_config/parse_address.h )
s.files += %w( src/core/ext/client_config/resolver.h )
s.files += %w( src/core/ext/client_config/resolver_factory.h )
@ -487,6 +488,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_config/lb_policy.c )
s.files += %w( src/core/ext/client_config/lb_policy_factory.c )
s.files += %w( src/core/ext/client_config/lb_policy_registry.c )
s.files += %w( src/core/ext/client_config/method_config.c )
s.files += %w( src/core/ext/client_config/parse_address.c )
s.files += %w( src/core/ext/client_config/resolver.c )
s.files += %w( src/core/ext/client_config/resolver_factory.c )

@ -196,6 +196,9 @@ typedef struct {
#define GRPC_ARG_MAX_METADATA_SIZE "grpc.max_metadata_size"
/** If non-zero, allow the use of SO_REUSEPORT if it's available (default 1) */
#define GRPC_ARG_ALLOW_REUSEPORT "grpc.so_reuseport"
/** Service config data, to be passed to subchannels.
Not intended for external use. */
#define GRPC_ARG_SERVICE_CONFIG "grpc.service_config"
/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a

@ -311,6 +311,7 @@
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/method_config.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/parse_address.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_factory.h" role="src" />
@ -494,6 +495,7 @@
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/method_config.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/parse_address.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_factory.c" role="src" />

@ -511,8 +511,13 @@ static void subchannel_ready(grpc_exec_ctx *exec_ctx, void *arg,
} else {
/* Get method config. */
// FIXME: need to actually use the config data!
calld->method_config = grpc_resolver_result_get_method_config(
chand->current_resolver_result, calld->path);
// FIXME: think about refcounting vs. atomicity here
grpc_method_config_table* table = grpc_resolver_result_get_method_configs(
chand->current_resolver_result);
if (table != NULL) {
calld->method_config = grpc_method_config_table_get_method_config(
table, calld->path);
}
/* Create call on subchannel. */
grpc_subchannel_call *subchannel_call = NULL;
grpc_error *new_error = grpc_connected_subchannel_create_call(

@ -39,141 +39,6 @@
#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/channel/channel_args.h"
//
// grpc_method_config
//
struct grpc_method_config {
gpr_refcount refs;
bool* wait_for_ready;
gpr_timespec* timeout;
int32_t* max_request_message_bytes;
int32_t* max_response_message_bytes;
};
grpc_method_config* grpc_method_config_create(
bool* wait_for_ready, gpr_timespec* timeout,
int32_t* max_request_message_bytes, int32_t* max_response_message_bytes) {
grpc_method_config* config = gpr_malloc(sizeof(*config));
memset(config, 0, sizeof(*config));
gpr_ref_init(&config->refs, 1);
if (wait_for_ready != NULL) {
config->wait_for_ready = gpr_malloc(sizeof(*wait_for_ready));
*config->wait_for_ready = *wait_for_ready;
}
if (timeout != NULL) {
config->timeout = gpr_malloc(sizeof(*timeout));
*config->timeout = *timeout;
}
if (max_request_message_bytes != NULL) {
config->max_request_message_bytes =
gpr_malloc(sizeof(*max_request_message_bytes));
*config->max_request_message_bytes = *max_request_message_bytes;
}
if (max_response_message_bytes != NULL) {
config->max_response_message_bytes =
gpr_malloc(sizeof(*max_response_message_bytes));
*config->max_response_message_bytes = *max_response_message_bytes;
}
return config;
}
grpc_method_config* grpc_method_config_ref(grpc_method_config* method_config) {
gpr_ref(&method_config->refs);
return method_config;
}
void grpc_method_config_unref(grpc_method_config* method_config) {
if (gpr_unref(&method_config->refs)) {
gpr_free(method_config->wait_for_ready);
gpr_free(method_config->timeout);
gpr_free(method_config->max_request_message_bytes);
gpr_free(method_config->max_response_message_bytes);
gpr_free(method_config);
}
}
bool* grpc_method_config_get_wait_for_ready(grpc_method_config* method_config) {
return method_config->wait_for_ready;
}
gpr_timespec* grpc_method_config_get_timeout(
grpc_method_config* method_config) {
return method_config->timeout;
}
int32_t* grpc_method_config_get_max_request_message_bytes(
grpc_method_config* method_config) {
return method_config->max_request_message_bytes;
}
int32_t* grpc_method_config_get_max_response_message_bytes(
grpc_method_config* method_config) {
return method_config->max_response_message_bytes;
}
//
// method_config_table
//
typedef struct method_config_table_entry {
grpc_mdstr* path;
grpc_method_config* method_config;
} method_config_table_entry;
#define METHOD_CONFIG_TABLE_SIZE 128
typedef struct method_config_table {
method_config_table_entry entries[METHOD_CONFIG_TABLE_SIZE];
} method_config_table;
static void method_config_table_init(method_config_table* table) {
memset(table, 0, sizeof(*table));
}
static void method_config_table_destroy(method_config_table* table) {
for (size_t i = 0; i < GPR_ARRAY_SIZE(table->entries); ++i) {
method_config_table_entry* entry = &table->entries[i];
if (entry->path != NULL) {
GRPC_MDSTR_UNREF(entry->path);
grpc_method_config_unref(entry->method_config);
}
}
}
// Helper function for insert and get operations that performs quadratic
// probing (https://en.wikipedia.org/wiki/Quadratic_probing).
static size_t method_config_table_find_index(method_config_table* table,
grpc_mdstr* path,
bool find_empty) {
for (size_t i = 0; i < GPR_ARRAY_SIZE(table->entries); ++i) {
const size_t idx = (path->hash + i * i) % GPR_ARRAY_SIZE(table->entries);
if (table->entries[idx].path == NULL)
return find_empty ? idx : GPR_ARRAY_SIZE(table->entries);
if (table->entries[idx].path == path) return idx;
}
return GPR_ARRAY_SIZE(table->entries) + 1; // Not found.
}
static void method_config_table_insert(method_config_table* table,
grpc_mdstr* path,
grpc_method_config* config) {
const size_t idx =
method_config_table_find_index(table, path, true /* find_empty */);
// This can happen if the table is full.
GPR_ASSERT(idx != GPR_ARRAY_SIZE(table->entries));
method_config_table_entry* entry = &table->entries[idx];
entry->path = GRPC_MDSTR_REF(path);
entry->method_config = grpc_method_config_ref(config);
}
static grpc_method_config* method_config_table_get(method_config_table* table,
grpc_mdstr* path) {
const size_t idx =
method_config_table_find_index(table, path, false /* find_empty */);
if (idx == GPR_ARRAY_SIZE(table->entries)) return NULL; // Not found.
return table->entries[idx].method_config;
}
//
// grpc_resolver_result
//
@ -184,12 +49,13 @@ struct grpc_resolver_result {
grpc_lb_addresses* addresses;
char* lb_policy_name;
grpc_channel_args* lb_policy_args;
method_config_table method_configs;
grpc_method_config_table* method_configs;
};
grpc_resolver_result* grpc_resolver_result_create(
const char* server_name, grpc_lb_addresses* addresses,
const char* lb_policy_name, grpc_channel_args* lb_policy_args) {
const char* lb_policy_name, grpc_channel_args* lb_policy_args,
grpc_method_config_table* method_configs) {
grpc_resolver_result* result = gpr_malloc(sizeof(*result));
memset(result, 0, sizeof(*result));
gpr_ref_init(&result->refs, 1);
@ -197,7 +63,7 @@ grpc_resolver_result* grpc_resolver_result_create(
result->addresses = addresses;
result->lb_policy_name = gpr_strdup(lb_policy_name);
result->lb_policy_args = lb_policy_args;
method_config_table_init(&result->method_configs);
result->method_configs = grpc_method_config_table_ref(method_configs);
return result;
}
@ -212,7 +78,7 @@ void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx,
grpc_lb_addresses_destroy(result->addresses, NULL /* user_data_destroy */);
gpr_free(result->lb_policy_name);
grpc_channel_args_destroy(result->lb_policy_args);
method_config_table_destroy(&result->method_configs);
grpc_method_config_table_unref(result->method_configs);
gpr_free(result);
}
}
@ -236,34 +102,7 @@ grpc_channel_args* grpc_resolver_result_get_lb_policy_args(
return result->lb_policy_args;
}
void grpc_resolver_result_add_method_config(grpc_resolver_result* result,
grpc_mdstr** paths,
size_t num_paths,
grpc_method_config* method_config) {
for (size_t i = 0; i < num_paths; ++i) {
method_config_table_insert(&result->method_configs, paths[i],
method_config);
}
}
grpc_method_config* grpc_resolver_result_get_method_config(
grpc_resolver_result* result, grpc_mdstr* path) {
grpc_method_config* method_config =
method_config_table_get(&result->method_configs, path);
// If we didn't find a match for the path, try looking for a wildcard
// entry (i.e., change "/service/method" to "/service/*").
if (method_config == NULL) {
const char* path_str = grpc_mdstr_as_c_string(path);
const char* sep = strrchr(path_str, '/') + 1;
const size_t len = (size_t)(sep - path_str);
char buf[len + 2]; // '*' and NUL
memcpy(buf, path_str, len);
buf[len] = '*';
buf[len + 1] = '\0';
grpc_mdstr* wildcard_path = grpc_mdstr_from_string(buf);
method_config =
method_config_table_get(&result->method_configs, wildcard_path);
GRPC_MDSTR_UNREF(wildcard_path);
}
return method_config;
grpc_method_config_table* grpc_resolver_result_get_method_configs(
grpc_resolver_result* result) {
return result->method_configs;
}

@ -33,6 +33,7 @@
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H
#include "src/core/ext/client_config/lb_policy_factory.h"
#include "src/core/ext/client_config/method_config.h"
#include "src/core/lib/iomgr/resolve_address.h"
// TODO(roth, ctiller): In the long term, we are considering replacing
@ -45,68 +46,28 @@
// grpc_channel_args such to a hash table or AVL or some other data
// structure that does not require linear search to find keys.
/// Per-method configuration.
typedef struct grpc_method_config grpc_method_config;
/// Any parameter may be NULL to indicate that the value is unset.
grpc_method_config* grpc_method_config_create(
bool* wait_for_ready, gpr_timespec* timeout,
int32_t* max_request_message_bytes, int32_t* max_response_message_bytes);
grpc_method_config* grpc_method_config_ref(grpc_method_config* method_config);
void grpc_method_config_unref(grpc_method_config* method_config);
/// These methods return NULL if the requested field is unset.
/// The caller does NOT take ownership of the result.
bool* grpc_method_config_get_wait_for_ready(grpc_method_config* method_config);
gpr_timespec* grpc_method_config_get_timeout(grpc_method_config* method_config);
int32_t* grpc_method_config_get_max_request_message_bytes(
grpc_method_config* method_config);
int32_t* grpc_method_config_get_max_response_message_bytes(
grpc_method_config* method_config);
/// Results reported from a grpc_resolver.
typedef struct grpc_resolver_result grpc_resolver_result;
/// Takes ownership of \a addresses and \a lb_policy_args.
/// Takes ownership of \a addresses, \a lb_policy_args.
grpc_resolver_result* grpc_resolver_result_create(
const char* server_name, grpc_lb_addresses* addresses,
const char* lb_policy_name, grpc_channel_args* lb_policy_args);
const char* lb_policy_name, grpc_channel_args* lb_policy_args,
grpc_method_config_table* method_configs);
void grpc_resolver_result_ref(grpc_resolver_result* result);
void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx,
grpc_resolver_result* result);
/// Caller does NOT take ownership of result.
/// Accessors. Caller does NOT take ownership of results.
const char* grpc_resolver_result_get_server_name(grpc_resolver_result* result);
/// Caller does NOT take ownership of result.
grpc_lb_addresses* grpc_resolver_result_get_addresses(
grpc_resolver_result* result);
/// Caller does NOT take ownership of result.
const char* grpc_resolver_result_get_lb_policy_name(
grpc_resolver_result* result);
/// Caller does NOT take ownership of result.
grpc_channel_args* grpc_resolver_result_get_lb_policy_args(
grpc_resolver_result* result);
/// Adds a method config. \a paths indicates the set of path names
/// for which this config applies. Each name is of one of the following
/// forms:
/// service/method -- specifies exact service and method name
/// service/* -- matches all methods for the specified service
/// * -- matches all methods for all services
/// Takes new references to all elements of \a paths and to \a method_config.
void grpc_resolver_result_add_method_config(grpc_resolver_result* result,
grpc_mdstr** paths,
size_t num_paths,
grpc_method_config* method_config);
/// Returns NULL if the method has no config.
/// Caller does NOT take ownership of result.
grpc_method_config* grpc_resolver_result_get_method_config(
grpc_resolver_result* result, grpc_mdstr* path);
grpc_method_config_table* grpc_resolver_result_get_method_configs(
grpc_resolver_result* result);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */

@ -181,7 +181,7 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
}
grpc_resolved_addresses_destroy(r->addresses);
result = grpc_resolver_result_create(r->target_name, addresses,
r->lb_policy_name, NULL);
r->lb_policy_name, NULL, NULL);
} else {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
gpr_timespec next_try = gpr_backoff_step(&r->backoff_state, now);

@ -122,7 +122,7 @@ static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
r->published = true;
*r->target_result = grpc_resolver_result_create(
"", grpc_lb_addresses_copy(r->addresses, NULL /* user_data_copy */),
r->lb_policy_name, NULL);
r->lb_policy_name, NULL, NULL);
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL;
}

@ -232,6 +232,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/client_config/lb_policy.c',
'src/core/ext/client_config/lb_policy_factory.c',
'src/core/ext/client_config/lb_policy_registry.c',
'src/core/ext/client_config/method_config.c',
'src/core/ext/client_config/parse_address.c',
'src/core/ext/client_config/resolver.c',
'src/core/ext/client_config/resolver_factory.c',

@ -921,6 +921,7 @@ src/core/ext/client_config/initial_connect_string.h \
src/core/ext/client_config/lb_policy.h \
src/core/ext/client_config/lb_policy_factory.h \
src/core/ext/client_config/lb_policy_registry.h \
src/core/ext/client_config/method_config.h \
src/core/ext/client_config/parse_address.h \
src/core/ext/client_config/resolver.h \
src/core/ext/client_config/resolver_factory.h \
@ -1104,6 +1105,7 @@ src/core/ext/client_config/initial_connect_string.c \
src/core/ext/client_config/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \
src/core/ext/client_config/parse_address.c \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \

@ -6256,6 +6256,7 @@
"src/core/ext/client_config/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h",
"src/core/ext/client_config/parse_address.h",
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
@ -6287,6 +6288,8 @@
"src/core/ext/client_config/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.c",
"src/core/ext/client_config/lb_policy_registry.h",
"src/core/ext/client_config/method_config.c",
"src/core/ext/client_config/method_config.h",
"src/core/ext/client_config/parse_address.c",
"src/core/ext/client_config/parse_address.h",
"src/core/ext/client_config/resolver.c",

@ -430,6 +430,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_factory.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_factory.h" />
@ -770,6 +771,8 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver.c">

@ -466,6 +466,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
@ -1070,6 +1073,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>

@ -396,6 +396,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_factory.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_factory.h" />
@ -686,6 +687,8 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver.c">

@ -391,6 +391,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
@ -908,6 +911,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy_registry.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\method_config.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\parse_address.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>

Loading…
Cancel
Save