diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ext/client_config/README.md (renamed from src/core/lib/client_config/README.md) | 0 | ||||
-rw-r--r-- | src/core/ext/client_config/channel_connectivity.c (renamed from src/core/lib/surface/channel_connectivity.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/client_channel.c (renamed from src/core/lib/channel/client_channel.c) | 4 | ||||
-rw-r--r-- | src/core/ext/client_config/client_channel.h (renamed from src/core/lib/channel/client_channel.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/client_channel_factory.c (renamed from src/core/lib/client_config/client_channel_factory.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/client_channel_factory.h (renamed from src/core/lib/client_config/client_channel_factory.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/client_config.c (renamed from src/core/lib/client_config/client_config.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/client_config.h (renamed from src/core/lib/client_config/client_config.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/connector.c (renamed from src/core/lib/client_config/connector.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/connector.h (renamed from src/core/lib/client_config/connector.h) | 6 | ||||
-rw-r--r-- | src/core/ext/client_config/default_initial_connect_string.c (renamed from src/core/lib/client_config/default_initial_connect_string.c) | 0 | ||||
-rw-r--r-- | src/core/ext/client_config/initial_connect_string.c (renamed from src/core/lib/client_config/initial_connect_string.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/initial_connect_string.h (renamed from src/core/lib/client_config/initial_connect_string.h) | 6 | ||||
-rw-r--r-- | src/core/ext/client_config/lb_policy.c (renamed from src/core/lib/client_config/lb_policy.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/lb_policy.h (renamed from src/core/lib/client_config/lb_policy.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/lb_policy_factory.c (renamed from src/core/lib/client_config/lb_policy_factory.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/lb_policy_factory.h (renamed from src/core/lib/client_config/lb_policy_factory.h) | 10 | ||||
-rw-r--r-- | src/core/ext/client_config/lb_policy_registry.c (renamed from src/core/lib/client_config/lb_policy_registry.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/lb_policy_registry.h (renamed from src/core/lib/client_config/lb_policy_registry.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/resolver.c (renamed from src/core/lib/client_config/resolver.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/resolver.h (renamed from src/core/lib/client_config/resolver.h) | 10 | ||||
-rw-r--r-- | src/core/ext/client_config/resolver_factory.c (renamed from src/core/lib/client_config/resolver_factory.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/resolver_factory.h (renamed from src/core/lib/client_config/resolver_factory.h) | 12 | ||||
-rw-r--r-- | src/core/ext/client_config/resolver_registry.c (renamed from src/core/lib/client_config/resolver_registry.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/resolver_registry.h (renamed from src/core/lib/client_config/resolver_registry.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel.c (renamed from src/core/lib/client_config/subchannel.c) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel.h (renamed from src/core/lib/client_config/subchannel.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel_call_holder.c (renamed from src/core/lib/channel/subchannel_call_holder.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel_call_holder.h (renamed from src/core/lib/channel/subchannel_call_holder.h) | 8 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel_factory.c | 49 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel_factory.h | 66 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel_index.c (renamed from src/core/lib/client_config/subchannel_index.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel_index.h (renamed from src/core/lib/client_config/subchannel_index.h) | 10 | ||||
-rw-r--r-- | src/core/ext/client_config/uri_parser.c (renamed from src/core/lib/client_config/uri_parser.c) | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/uri_parser.h (renamed from src/core/lib/client_config/uri_parser.h) | 6 | ||||
-rw-r--r-- | src/core/ext/lb_policy/grpclb/load_balancer_api.c | 25 | ||||
-rw-r--r-- | src/core/ext/lb_policy/grpclb/load_balancer_api.h | 2 | ||||
-rw-r--r-- | src/core/ext/lb_policy/pick_first/pick_first.c | 2 | ||||
-rw-r--r-- | src/core/ext/lb_policy/round_robin/round_robin.c | 2 | ||||
-rw-r--r-- | src/core/ext/resolver/dns/native/dns_resolver.c | 4 | ||||
-rw-r--r-- | src/core/ext/resolver/sockaddr/sockaddr_resolver.c | 6 | ||||
-rw-r--r-- | src/core/ext/resolver/zookeeper/zookeeper_resolver.c | 4 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/client/insecure/channel_create.c | 4 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/client/secure/secure_channel_create.c | 4 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/chttp2_transport.c | 20 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/parsing.c | 6 | ||||
-rw-r--r-- | src/core/lib/iomgr/unix_sockets_posix.h | 4 | ||||
-rw-r--r-- | src/core/lib/surface/call.c | 31 | ||||
-rw-r--r-- | src/core/lib/surface/channel.c | 2 | ||||
-rw-r--r-- | src/core/lib/surface/channel.h | 1 | ||||
-rw-r--r-- | src/core/lib/surface/init.c | 10 | ||||
-rw-r--r-- | src/core/lib/surface/server.c | 8 | ||||
-rw-r--r-- | src/core/lib/transport/metadata.c | 6 | ||||
-rw-r--r-- | src/core/lib/transport/transport.h | 2 | ||||
-rw-r--r-- | src/node/stress/stress_client.js | 6 | ||||
-rw-r--r-- | src/proto/grpc/testing/control.proto | 25 | ||||
-rw-r--r-- | src/proto/grpc/testing/metrics.proto | 4 | ||||
-rw-r--r-- | src/python/grpcio/grpc_core_dependencies.py | 34 |
58 files changed, 329 insertions, 162 deletions
diff --git a/src/core/lib/client_config/README.md b/src/core/ext/client_config/README.md index 7024fd540d..7024fd540d 100644 --- a/src/core/lib/client_config/README.md +++ b/src/core/ext/client_config/README.md diff --git a/src/core/lib/surface/channel_connectivity.c b/src/core/ext/client_config/channel_connectivity.c index 9a9ee422c2..3ebc333608 100644 --- a/src/core/lib/surface/channel_connectivity.c +++ b/src/core/ext/client_config/channel_connectivity.c @@ -36,7 +36,7 @@ #include <grpc/support/alloc.h> #include <grpc/support/log.h> -#include "src/core/lib/channel/client_channel.h" +#include "src/core/ext/client_config/client_channel.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/completion_queue.h" diff --git a/src/core/lib/channel/client_channel.c b/src/core/ext/client_config/client_channel.c index 55867ba80c..93d54fdcfe 100644 --- a/src/core/lib/channel/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/channel/client_channel.h" +#include "src/core/ext/client_config/client_channel.h" #include <stdio.h> #include <string.h> @@ -41,9 +41,9 @@ #include <grpc/support/sync.h> #include <grpc/support/useful.h> +#include "src/core/ext/client_config/subchannel_call_holder.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/connected_channel.h" -#include "src/core/lib/channel/subchannel_call_holder.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/profiling/timers.h" #include "src/core/lib/support/string.h" diff --git a/src/core/lib/channel/client_channel.h b/src/core/ext/client_config/client_channel.h index ac418c8c51..1e47ad34ad 100644 --- a/src/core/lib/channel/client_channel.h +++ b/src/core/ext/client_config/client_channel.h @@ -31,11 +31,11 @@ * */ -#ifndef GRPC_CORE_LIB_CHANNEL_CLIENT_CHANNEL_H -#define GRPC_CORE_LIB_CHANNEL_CLIENT_CHANNEL_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H +#include "src/core/ext/client_config/resolver.h" #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/client_config/resolver.h" /* A client channel is a channel that begins disconnected, and can connect to some endpoint on demand. If that endpoint disconnects, it will be @@ -60,4 +60,4 @@ void grpc_client_channel_watch_connectivity_state( grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, grpc_pollset *pollset, grpc_connectivity_state *state, grpc_closure *on_complete); -#endif /* GRPC_CORE_LIB_CHANNEL_CLIENT_CHANNEL_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H */ diff --git a/src/core/lib/client_config/client_channel_factory.c b/src/core/ext/client_config/client_channel_factory.c index d27b38d9f2..71c64c0da1 100644 --- a/src/core/lib/client_config/client_channel_factory.c +++ b/src/core/ext/client_config/client_channel_factory.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/client_channel_factory.h" +#include "src/core/ext/client_config/client_channel_factory.h" void grpc_client_channel_factory_ref(grpc_client_channel_factory* factory) { factory->vtable->ref(factory); diff --git a/src/core/lib/client_config/client_channel_factory.h b/src/core/ext/client_config/client_channel_factory.h index 0b71cd9bdb..1241b9b781 100644 --- a/src/core/lib/client_config/client_channel_factory.h +++ b/src/core/ext/client_config/client_channel_factory.h @@ -31,13 +31,13 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H #include <grpc/impl/codegen/grpc_types.h> +#include "src/core/ext/client_config/subchannel.h" #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/client_config/subchannel.h" typedef struct grpc_client_channel_factory grpc_client_channel_factory; typedef struct grpc_client_channel_factory_vtable @@ -82,4 +82,4 @@ grpc_channel *grpc_client_channel_factory_create_channel( grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory, const char *target, grpc_client_channel_type type, grpc_channel_args *args); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H */ diff --git a/src/core/lib/client_config/client_config.c b/src/core/ext/client_config/client_config.c index 2521023364..f9b8e68698 100644 --- a/src/core/lib/client_config/client_config.c +++ b/src/core/ext/client_config/client_config.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/client_config.h" +#include "src/core/ext/client_config/client_config.h" #include <string.h> diff --git a/src/core/lib/client_config/client_config.h b/src/core/ext/client_config/client_config.h index 8dc2f6b299..a6290cbcf0 100644 --- a/src/core/lib/client_config/client_config.h +++ b/src/core/ext/client_config/client_config.h @@ -31,10 +31,10 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_CLIENT_CONFIG_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_CLIENT_CONFIG_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CONFIG_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CONFIG_H -#include "src/core/lib/client_config/lb_policy.h" +#include "src/core/ext/client_config/lb_policy.h" /** Total configuration for a client. Provided, and updated, by grpc_resolver */ @@ -50,4 +50,4 @@ void grpc_client_config_set_lb_policy(grpc_client_config *client_config, grpc_lb_policy *grpc_client_config_get_lb_policy( grpc_client_config *client_config); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_CLIENT_CONFIG_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CONFIG_H */ diff --git a/src/core/lib/client_config/connector.c b/src/core/ext/client_config/connector.c index 4c7b823dac..5b629ed5fb 100644 --- a/src/core/lib/client_config/connector.c +++ b/src/core/ext/client_config/connector.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/connector.h" +#include "src/core/ext/client_config/connector.h" grpc_connector* grpc_connector_ref(grpc_connector* connector) { connector->vtable->ref(connector); diff --git a/src/core/lib/client_config/connector.h b/src/core/ext/client_config/connector.h index 39870a261c..dd85dfcb7d 100644 --- a/src/core/lib/client_config/connector.h +++ b/src/core/ext/client_config/connector.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_CONNECTOR_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_CONNECTOR_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CONNECTOR_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_CONNECTOR_H #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/iomgr/sockaddr.h" @@ -89,4 +89,4 @@ void grpc_connector_connect(grpc_exec_ctx *exec_ctx, grpc_connector *connector, void grpc_connector_shutdown(grpc_exec_ctx *exec_ctx, grpc_connector *connector); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_CONNECTOR_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CONNECTOR_H */ diff --git a/src/core/lib/client_config/default_initial_connect_string.c b/src/core/ext/client_config/default_initial_connect_string.c index a70da4a84a..a70da4a84a 100644 --- a/src/core/lib/client_config/default_initial_connect_string.c +++ b/src/core/ext/client_config/default_initial_connect_string.c diff --git a/src/core/lib/client_config/initial_connect_string.c b/src/core/ext/client_config/initial_connect_string.c index 4034ea2e87..41580d2106 100644 --- a/src/core/lib/client_config/initial_connect_string.c +++ b/src/core/ext/client_config/initial_connect_string.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/initial_connect_string.h" +#include "src/core/ext/client_config/initial_connect_string.h" #include <stddef.h> diff --git a/src/core/lib/client_config/initial_connect_string.h b/src/core/ext/client_config/initial_connect_string.h index 51302768c6..06f0767832 100644 --- a/src/core/lib/client_config/initial_connect_string.h +++ b/src/core/ext/client_config/initial_connect_string.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H #include <grpc/support/slice.h> #include "src/core/lib/iomgr/sockaddr.h" @@ -47,4 +47,4 @@ void grpc_test_set_initial_connect_string_function( void grpc_set_initial_connect_string(struct sockaddr **addr, size_t *addr_len, gpr_slice *connect_string); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H */ diff --git a/src/core/lib/client_config/lb_policy.c b/src/core/ext/client_config/lb_policy.c index 6174162d49..a7ad9842dc 100644 --- a/src/core/lib/client_config/lb_policy.c +++ b/src/core/ext/client_config/lb_policy.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/lb_policy.h" +#include "src/core/ext/client_config/lb_policy.h" #define WEAK_REF_BITS 16 diff --git a/src/core/lib/client_config/lb_policy.h b/src/core/ext/client_config/lb_policy.h index 60729ef8f9..0384e0b2eb 100644 --- a/src/core/lib/client_config/lb_policy.h +++ b/src/core/ext/client_config/lb_policy.h @@ -31,10 +31,10 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_H -#include "src/core/lib/client_config/subchannel.h" +#include "src/core/ext/client_config/subchannel.h" #include "src/core/lib/transport/connectivity_state.h" /** A load balancing policy: specified by a vtable and a struct (which @@ -154,4 +154,4 @@ void grpc_lb_policy_notify_on_state_change(grpc_exec_ctx *exec_ctx, grpc_connectivity_state grpc_lb_policy_check_connectivity( grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_H */ diff --git a/src/core/lib/client_config/lb_policy_factory.c b/src/core/ext/client_config/lb_policy_factory.c index 92e1f5f08b..70e46ef3cf 100644 --- a/src/core/lib/client_config/lb_policy_factory.c +++ b/src/core/ext/client_config/lb_policy_factory.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/lb_policy_factory.h" +#include "src/core/ext/client_config/lb_policy_factory.h" void grpc_lb_policy_factory_ref(grpc_lb_policy_factory* factory) { factory->vtable->ref(factory); diff --git a/src/core/lib/client_config/lb_policy_factory.h b/src/core/ext/client_config/lb_policy_factory.h index 4931d4df58..1c89b28b59 100644 --- a/src/core/lib/client_config/lb_policy_factory.h +++ b/src/core/ext/client_config/lb_policy_factory.h @@ -31,11 +31,11 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_FACTORY_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_FACTORY_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_FACTORY_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_FACTORY_H -#include "src/core/lib/client_config/client_channel_factory.h" -#include "src/core/lib/client_config/lb_policy.h" +#include "src/core/ext/client_config/client_channel_factory.h" +#include "src/core/ext/client_config/lb_policy.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -75,4 +75,4 @@ grpc_lb_policy *grpc_lb_policy_factory_create_lb_policy( grpc_exec_ctx *exec_ctx, grpc_lb_policy_factory *factory, grpc_lb_policy_args *args); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_FACTORY_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_FACTORY_H */ diff --git a/src/core/lib/client_config/lb_policy_registry.c b/src/core/ext/client_config/lb_policy_registry.c index af396362a1..a23643ecc6 100644 --- a/src/core/lib/client_config/lb_policy_registry.c +++ b/src/core/ext/client_config/lb_policy_registry.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/lb_policy_registry.h" +#include "src/core/ext/client_config/lb_policy_registry.h" #include <string.h> diff --git a/src/core/lib/client_config/lb_policy_registry.h b/src/core/ext/client_config/lb_policy_registry.h index 4b8495d8a1..92f38d6de6 100644 --- a/src/core/lib/client_config/lb_policy_registry.h +++ b/src/core/ext/client_config/lb_policy_registry.h @@ -31,10 +31,10 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_REGISTRY_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_REGISTRY_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_REGISTRY_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_REGISTRY_H -#include "src/core/lib/client_config/lb_policy_factory.h" +#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/lib/iomgr/exec_ctx.h" /** Initialize the registry and set \a default_factory as the factory to be @@ -52,4 +52,4 @@ void grpc_register_lb_policy(grpc_lb_policy_factory *factory); grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name, grpc_lb_policy_args *args); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_LB_POLICY_REGISTRY_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_REGISTRY_H */ diff --git a/src/core/lib/client_config/resolver.c b/src/core/ext/client_config/resolver.c index b9eef5575f..eb004455bd 100644 --- a/src/core/lib/client_config/resolver.c +++ b/src/core/ext/client_config/resolver.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/resolver.h" +#include "src/core/ext/client_config/resolver.h" void grpc_resolver_init(grpc_resolver *resolver, const grpc_resolver_vtable *vtable) { diff --git a/src/core/lib/client_config/resolver.h b/src/core/ext/client_config/resolver.h index cf0bb2bc7a..6ecb5d2774 100644 --- a/src/core/lib/client_config/resolver.h +++ b/src/core/ext/client_config/resolver.h @@ -31,11 +31,11 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H -#include "src/core/lib/client_config/client_config.h" -#include "src/core/lib/client_config/subchannel.h" +#include "src/core/ext/client_config/client_config.h" +#include "src/core/ext/client_config/subchannel.h" #include "src/core/lib/iomgr/iomgr.h" typedef struct grpc_resolver grpc_resolver; @@ -91,4 +91,4 @@ void grpc_resolver_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver, grpc_client_config **target_config, grpc_closure *on_complete); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H */ diff --git a/src/core/lib/client_config/resolver_factory.c b/src/core/ext/client_config/resolver_factory.c index 001fa28536..67832dcf59 100644 --- a/src/core/lib/client_config/resolver_factory.c +++ b/src/core/ext/client_config/resolver_factory.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/resolver_factory.h" +#include "src/core/ext/client_config/resolver_factory.h" void grpc_resolver_factory_ref(grpc_resolver_factory* factory) { factory->vtable->ref(factory); diff --git a/src/core/lib/client_config/resolver_factory.h b/src/core/ext/client_config/resolver_factory.h index 18c7fd7d62..4eb6979aad 100644 --- a/src/core/lib/client_config/resolver_factory.h +++ b/src/core/ext/client_config/resolver_factory.h @@ -31,12 +31,12 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_FACTORY_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_FACTORY_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_FACTORY_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_FACTORY_H -#include "src/core/lib/client_config/client_channel_factory.h" -#include "src/core/lib/client_config/resolver.h" -#include "src/core/lib/client_config/uri_parser.h" +#include "src/core/ext/client_config/client_channel_factory.h" +#include "src/core/ext/client_config/resolver.h" +#include "src/core/ext/client_config/uri_parser.h" typedef struct grpc_resolver_factory grpc_resolver_factory; typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable; @@ -79,4 +79,4 @@ grpc_resolver *grpc_resolver_factory_create_resolver( char *grpc_resolver_factory_get_default_authority( grpc_resolver_factory *factory, grpc_uri *uri); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_FACTORY_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_FACTORY_H */ diff --git a/src/core/lib/client_config/resolver_registry.c b/src/core/ext/client_config/resolver_registry.c index 5584f6692e..07f29bcb27 100644 --- a/src/core/lib/client_config/resolver_registry.c +++ b/src/core/ext/client_config/resolver_registry.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/resolver_registry.h" +#include "src/core/ext/client_config/resolver_registry.h" #include <string.h> diff --git a/src/core/lib/client_config/resolver_registry.h b/src/core/ext/client_config/resolver_registry.h index b207313084..5ef1383cd3 100644 --- a/src/core/lib/client_config/resolver_registry.h +++ b/src/core/ext/client_config/resolver_registry.h @@ -31,10 +31,10 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_REGISTRY_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_REGISTRY_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_REGISTRY_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_REGISTRY_H -#include "src/core/lib/client_config/resolver_factory.h" +#include "src/core/ext/client_config/resolver_factory.h" void grpc_resolver_registry_init(const char *default_prefix); void grpc_resolver_registry_shutdown(void); @@ -66,4 +66,4 @@ grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name); representing the default authority to pass from a client. */ char *grpc_get_default_authority(const char *target); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVER_REGISTRY_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_REGISTRY_H */ diff --git a/src/core/lib/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c index f44e2f7404..20cf245a5b 100644 --- a/src/core/lib/client_config/subchannel.c +++ b/src/core/ext/client_config/subchannel.c @@ -31,18 +31,18 @@ * */ -#include "src/core/lib/client_config/subchannel.h" +#include "src/core/ext/client_config/subchannel.h" #include <string.h> #include <grpc/support/alloc.h> #include <grpc/support/avl.h> +#include "src/core/ext/client_config/client_channel.h" +#include "src/core/ext/client_config/initial_connect_string.h" +#include "src/core/ext/client_config/subchannel_index.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/channel/client_channel.h" #include "src/core/lib/channel/connected_channel.h" -#include "src/core/lib/client_config/initial_connect_string.h" -#include "src/core/lib/client_config/subchannel_index.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/profiling/timers.h" #include "src/core/lib/support/backoff.h" diff --git a/src/core/lib/client_config/subchannel.h b/src/core/ext/client_config/subchannel.h index 68aeff39a1..0765a544e8 100644 --- a/src/core/lib/client_config/subchannel.h +++ b/src/core/ext/client_config/subchannel.h @@ -31,11 +31,11 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_SUBCHANNEL_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_SUBCHANNEL_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_H +#include "src/core/ext/client_config/connector.h" #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/client_config/connector.h" #include "src/core/lib/transport/connectivity_state.h" /** A (sub-)channel that knows how to connect to exactly one target @@ -171,4 +171,4 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, grpc_connector *connector, grpc_subchannel_args *args); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_SUBCHANNEL_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_H */ diff --git a/src/core/lib/channel/subchannel_call_holder.c b/src/core/ext/client_config/subchannel_call_holder.c index a2686a380a..3db462b246 100644 --- a/src/core/lib/channel/subchannel_call_holder.c +++ b/src/core/ext/client_config/subchannel_call_holder.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/channel/subchannel_call_holder.h" +#include "src/core/ext/client_config/subchannel_call_holder.h" #include <grpc/support/alloc.h> diff --git a/src/core/lib/channel/subchannel_call_holder.h b/src/core/ext/client_config/subchannel_call_holder.h index 769e22b061..9299908788 100644 --- a/src/core/lib/channel/subchannel_call_holder.h +++ b/src/core/ext/client_config/subchannel_call_holder.h @@ -31,10 +31,10 @@ * */ -#ifndef GRPC_CORE_LIB_CHANNEL_SUBCHANNEL_CALL_HOLDER_H -#define GRPC_CORE_LIB_CHANNEL_SUBCHANNEL_CALL_HOLDER_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_CALL_HOLDER_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_CALL_HOLDER_H -#include "src/core/lib/client_config/subchannel.h" +#include "src/core/ext/client_config/subchannel.h" /** Pick a subchannel for grpc_subchannel_call_holder; Return 1 if subchannel is available immediately (in which case on_ready @@ -95,4 +95,4 @@ void grpc_subchannel_call_holder_perform_op(grpc_exec_ctx *exec_ctx, char *grpc_subchannel_call_holder_get_peer(grpc_exec_ctx *exec_ctx, grpc_subchannel_call_holder *holder); -#endif /* GRPC_CORE_LIB_CHANNEL_SUBCHANNEL_CALL_HOLDER_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_CALL_HOLDER_H */ diff --git a/src/core/ext/client_config/subchannel_factory.c b/src/core/ext/client_config/subchannel_factory.c new file mode 100644 index 0000000000..d1e4d75a02 --- /dev/null +++ b/src/core/ext/client_config/subchannel_factory.c @@ -0,0 +1,49 @@ +/* + * + * Copyright 2015, 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. + * + */ + +#include "src/core/ext/client_config/subchannel_factory.h" + +void grpc_subchannel_factory_ref(grpc_subchannel_factory* factory) { + factory->vtable->ref(factory); +} + +void grpc_subchannel_factory_unref(grpc_exec_ctx* exec_ctx, + grpc_subchannel_factory* factory) { + factory->vtable->unref(exec_ctx, factory); +} + +grpc_subchannel* grpc_subchannel_factory_create_subchannel( + grpc_exec_ctx* exec_ctx, grpc_subchannel_factory* factory, + grpc_subchannel_args* args) { + return factory->vtable->create_subchannel(exec_ctx, factory, args); +} diff --git a/src/core/ext/client_config/subchannel_factory.h b/src/core/ext/client_config/subchannel_factory.h new file mode 100644 index 0000000000..0fb806d081 --- /dev/null +++ b/src/core/ext/client_config/subchannel_factory.h @@ -0,0 +1,66 @@ +/* + * + * Copyright 2015, 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. + * + */ + +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H + +#include "src/core/ext/client_config/subchannel.h" +#include "src/core/lib/channel/channel_stack.h" + +typedef struct grpc_subchannel_factory grpc_subchannel_factory; +typedef struct grpc_subchannel_factory_vtable grpc_subchannel_factory_vtable; + +/** Constructor for new configured channels. + Creating decorators around this type is encouraged to adapt behavior. */ +struct grpc_subchannel_factory { + const grpc_subchannel_factory_vtable *vtable; +}; + +struct grpc_subchannel_factory_vtable { + void (*ref)(grpc_subchannel_factory *factory); + void (*unref)(grpc_exec_ctx *exec_ctx, grpc_subchannel_factory *factory); + grpc_subchannel *(*create_subchannel)(grpc_exec_ctx *exec_ctx, + grpc_subchannel_factory *factory, + grpc_subchannel_args *args); +}; + +void grpc_subchannel_factory_ref(grpc_subchannel_factory *factory); +void grpc_subchannel_factory_unref(grpc_exec_ctx *exec_ctx, + grpc_subchannel_factory *factory); + +/** Create a new grpc_subchannel */ +grpc_subchannel *grpc_subchannel_factory_create_subchannel( + grpc_exec_ctx *exec_ctx, grpc_subchannel_factory *factory, + grpc_subchannel_args *args); + +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H */ diff --git a/src/core/lib/client_config/subchannel_index.c b/src/core/ext/client_config/subchannel_index.c index 2c545002a2..ab8d9bd91d 100644 --- a/src/core/lib/client_config/subchannel_index.c +++ b/src/core/ext/client_config/subchannel_index.c @@ -31,7 +31,7 @@ // // -#include "src/core/lib/client_config/subchannel_index.h" +#include "src/core/ext/client_config/subchannel_index.h" #include <stdbool.h> #include <string.h> diff --git a/src/core/lib/client_config/subchannel_index.h b/src/core/ext/client_config/subchannel_index.h index bc5f03beb4..6b8d063855 100644 --- a/src/core/lib/client_config/subchannel_index.h +++ b/src/core/ext/client_config/subchannel_index.h @@ -31,11 +31,11 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_SUBCHANNEL_INDEX_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_SUBCHANNEL_INDEX_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_INDEX_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_INDEX_H -#include "src/core/lib/client_config/connector.h" -#include "src/core/lib/client_config/subchannel.h" +#include "src/core/ext/client_config/connector.h" +#include "src/core/ext/client_config/subchannel.h" /** \file Provides an index of active subchannels so that they can be shared amongst channels */ @@ -74,4 +74,4 @@ void grpc_subchannel_index_init(void); /** Shutdown the subchannel index (global) */ void grpc_subchannel_index_shutdown(void); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_SUBCHANNEL_INDEX_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_INDEX_H */ diff --git a/src/core/lib/client_config/uri_parser.c b/src/core/ext/client_config/uri_parser.c index 6bec70da2d..3ca1a58e69 100644 --- a/src/core/lib/client_config/uri_parser.c +++ b/src/core/ext/client_config/uri_parser.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/client_config/uri_parser.h" +#include "src/core/ext/client_config/uri_parser.h" #include <string.h> diff --git a/src/core/lib/client_config/uri_parser.h b/src/core/ext/client_config/uri_parser.h index 5d6785d293..875a7cb07c 100644 --- a/src/core/lib/client_config/uri_parser.h +++ b/src/core/ext/client_config/uri_parser.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_URI_PARSER_H -#define GRPC_CORE_LIB_CLIENT_CONFIG_URI_PARSER_H +#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_URI_PARSER_H +#define GRPC_CORE_EXT_CLIENT_CONFIG_URI_PARSER_H #include <stddef.h> @@ -60,4 +60,4 @@ const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key); /** destroy a uri */ void grpc_uri_destroy(grpc_uri *uri); -#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_URI_PARSER_H */ +#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_URI_PARSER_H */ diff --git a/src/core/ext/lb_policy/grpclb/load_balancer_api.c b/src/core/ext/lb_policy/grpclb/load_balancer_api.c index d8af644870..459d6d9954 100644 --- a/src/core/ext/lb_policy/grpclb/load_balancer_api.c +++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.c @@ -110,13 +110,15 @@ grpc_grpclb_response *grpc_grpclb_response_parse(gpr_slice encoded_response) { grpc_grpclb_response *res = gpr_malloc(sizeof(grpc_grpclb_response)); memset(res, 0, sizeof(*res)); status = pb_decode(&stream, grpc_lb_v0_LoadBalanceResponse_fields, res); - GPR_ASSERT(status == true); + if (!status) { + grpc_grpclb_response_destroy(res); + return NULL; + } return res; } grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist( gpr_slice encoded_response) { - grpc_grpclb_serverlist *sl = gpr_malloc(sizeof(grpc_grpclb_serverlist)); bool status; decode_serverlist_arg arg; pb_istream_t stream = @@ -131,15 +133,20 @@ grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist( res->server_list.servers.arg = &arg; arg.first_pass = 1; status = pb_decode(&stream, grpc_lb_v0_LoadBalanceResponse_fields, res); - GPR_ASSERT(status == true); - GPR_ASSERT(arg.num_servers > 0); + if (!status) { + grpc_grpclb_response_destroy(res); + return NULL; + } arg.first_pass = 0; status = pb_decode(&stream_at_start, grpc_lb_v0_LoadBalanceResponse_fields, res); - GPR_ASSERT(status == true); - GPR_ASSERT(arg.servers != NULL); + if (!status) { + grpc_grpclb_response_destroy(res); + return NULL; + } + grpc_grpclb_serverlist *sl = gpr_malloc(sizeof(grpc_grpclb_serverlist)); sl->num_servers = arg.num_servers; sl->servers = arg.servers; if (res->server_list.has_expiration_interval) { @@ -150,8 +157,10 @@ grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist( } void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist *serverlist) { - size_t i; - for (i = 0; i < serverlist->num_servers; i++) { + if (serverlist == NULL) { + return; + } + for (size_t i = 0; i < serverlist->num_servers; i++) { gpr_free(serverlist->servers[i]); } gpr_free(serverlist->servers); diff --git a/src/core/ext/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/lb_policy/grpclb/load_balancer_api.h index d329a2ffe8..968f7d278a 100644 --- a/src/core/ext/lb_policy/grpclb/load_balancer_api.h +++ b/src/core/ext/lb_policy/grpclb/load_balancer_api.h @@ -36,8 +36,8 @@ #include <grpc/support/slice_buffer.h> +#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h" -#include "src/core/lib/client_config/lb_policy_factory.h" #ifdef __cplusplus extern "C" { diff --git a/src/core/ext/lb_policy/pick_first/pick_first.c b/src/core/ext/lb_policy/pick_first/pick_first.c index 43197c1191..5926f9d70b 100644 --- a/src/core/ext/lb_policy/pick_first/pick_first.c +++ b/src/core/ext/lb_policy/pick_first/pick_first.c @@ -34,7 +34,7 @@ #include <string.h> #include <grpc/support/alloc.h> -#include "src/core/lib/client_config/lb_policy_registry.h" +#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/lib/transport/connectivity_state.h" typedef struct pending_pick { diff --git a/src/core/ext/lb_policy/round_robin/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c index eac6971099..3f6051b892 100644 --- a/src/core/ext/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/lb_policy/round_robin/round_robin.c @@ -35,7 +35,7 @@ #include <grpc/support/alloc.h> -#include "src/core/lib/client_config/lb_policy_registry.h" +#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/transport/connectivity_state.h" diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 1a0bf305d6..2749b0ca01 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -37,8 +37,8 @@ #include <grpc/support/host_port.h> #include <grpc/support/string_util.h> -#include "src/core/lib/client_config/lb_policy_registry.h" -#include "src/core/lib/client_config/resolver_registry.h" +#include "src/core/ext/client_config/lb_policy_registry.h" +#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/support/backoff.h" diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c index 76c03c08b5..1f14b40e18 100644 --- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,8 @@ #include <grpc/support/port_platform.h> #include <grpc/support/string_util.h> -#include "src/core/lib/client_config/lb_policy_registry.h" -#include "src/core/lib/client_config/resolver_registry.h" +#include "src/core/ext/client_config/lb_policy_registry.h" +#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/support/string.h" diff --git a/src/core/ext/resolver/zookeeper/zookeeper_resolver.c b/src/core/ext/resolver/zookeeper/zookeeper_resolver.c index 91153f14b5..898632c3cd 100644 --- a/src/core/ext/resolver/zookeeper/zookeeper_resolver.c +++ b/src/core/ext/resolver/zookeeper/zookeeper_resolver.c @@ -39,8 +39,8 @@ #include <grpc/grpc_zookeeper.h> #include <zookeeper/zookeeper.h> -#include "src/core/lib/client_config/lb_policy_registry.h" -#include "src/core/lib/client_config/resolver_registry.h" +#include "src/core/ext/client_config/lb_policy_registry.h" +#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/json/json.h" #include "src/core/lib/support/string.h" diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c index ee2ac44978..5484438f0a 100644 --- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c +++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c @@ -41,12 +41,12 @@ #include <grpc/support/slice_buffer.h> #include "src/core/ext/census/grpc_filter.h" +#include "src/core/ext/client_config/client_channel.h" +#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/channel/client_channel.h" #include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/http_client_filter.h" -#include "src/core/lib/client_config/resolver_registry.h" #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/channel.h" diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c index 5d30805639..58af6f995a 100644 --- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c @@ -40,10 +40,10 @@ #include <grpc/support/slice.h> #include <grpc/support/slice_buffer.h> +#include "src/core/ext/client_config/client_channel.h" +#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/channel/client_channel.h" -#include "src/core/lib/client_config/resolver_registry.h" #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/security/auth_filters.h" #include "src/core/lib/security/credentials.h" diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 62f0c53e0d..b4cd185e62 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1147,16 +1147,18 @@ static void cancel_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global, grpc_chttp2_stream_global *stream_global, grpc_status_code status) { - if (stream_global->id != 0) { - gpr_slice_buffer_add( - &transport_global->qbuf, - grpc_chttp2_rst_stream_create( - stream_global->id, - (uint32_t)grpc_chttp2_grpc_status_to_http2_error(status), - &stream_global->stats.outgoing)); + if (!stream_global->read_closed || !stream_global->write_closed) { + if (stream_global->id != 0) { + gpr_slice_buffer_add( + &transport_global->qbuf, + grpc_chttp2_rst_stream_create( + stream_global->id, + (uint32_t)grpc_chttp2_grpc_status_to_http2_error(status), + &stream_global->stats.outgoing)); + } + grpc_chttp2_fake_status(exec_ctx, transport_global, stream_global, status, + NULL); } - grpc_chttp2_fake_status(exec_ctx, transport_global, stream_global, status, - NULL); grpc_chttp2_mark_stream_closed(exec_ctx, transport_global, stream_global, 1, 1); } diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index c754c6005e..e827a43f7a 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -112,7 +112,7 @@ void grpc_chttp2_publish_reads( GOAWAY last-grpc_chttp2_stream-id=0 in this case. */ if (!transport_parsing->is_client) { transport_global->last_incoming_stream_id = - transport_parsing->incoming_stream_id; + transport_parsing->last_incoming_stream_id; } /* update global settings */ @@ -371,7 +371,9 @@ int grpc_chttp2_perform_read(grpc_exec_ctx *exec_ctx, if (!init_frame_parser(exec_ctx, transport_parsing)) { return 0; } - if (transport_parsing->incoming_stream_id) { + if (transport_parsing->incoming_stream_id != 0 && + transport_parsing->incoming_stream_id > + transport_parsing->last_incoming_stream_id) { transport_parsing->last_incoming_stream_id = transport_parsing->incoming_stream_id; } diff --git a/src/core/lib/iomgr/unix_sockets_posix.h b/src/core/lib/iomgr/unix_sockets_posix.h index 752cab85a5..22d6af5044 100644 --- a/src/core/lib/iomgr/unix_sockets_posix.h +++ b/src/core/lib/iomgr/unix_sockets_posix.h @@ -38,8 +38,8 @@ #include <grpc/support/string_util.h> -#include "src/core/lib/client_config/resolver_factory.h" -#include "src/core/lib/client_config/uri_parser.h" +#include "src/core/ext/client_config/resolver_factory.h" +#include "src/core/ext/client_config/uri_parser.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/sockaddr.h" diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index ba94852f9a..6581bbd3d1 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1074,24 +1074,29 @@ static void receiving_initial_metadata_ready(grpc_exec_ctx *exec_ctx, gpr_mu_lock(&call->mu); - grpc_metadata_batch *md = - &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */]; - grpc_metadata_batch_filter(md, recv_initial_filter, call); - call->has_initial_md_been_received = true; - - if (gpr_time_cmp(md->deadline, gpr_inf_future(md->deadline.clock_type)) != - 0 && - !call->is_client) { - GPR_TIMER_BEGIN("set_deadline_alarm", 0); - set_deadline_alarm(exec_ctx, call, md->deadline); - GPR_TIMER_END("set_deadline_alarm", 0); + if (!success) { + bctl->success = false; + } else { + grpc_metadata_batch *md = + &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */]; + grpc_metadata_batch_filter(md, recv_initial_filter, call); + + if (gpr_time_cmp(md->deadline, gpr_inf_future(md->deadline.clock_type)) != + 0 && + !call->is_client) { + GPR_TIMER_BEGIN("set_deadline_alarm", 0); + set_deadline_alarm(exec_ctx, call, md->deadline); + GPR_TIMER_END("set_deadline_alarm", 0); + } } + call->has_initial_md_been_received = true; if (call->saved_receiving_stream_ready_ctx.bctlp != NULL) { grpc_closure *saved_rsr_closure = grpc_closure_create( receiving_stream_ready, call->saved_receiving_stream_ready_ctx.bctlp); - grpc_exec_ctx_enqueue(exec_ctx, saved_rsr_closure, - call->saved_receiving_stream_ready_ctx.success, NULL); + grpc_exec_ctx_enqueue( + exec_ctx, saved_rsr_closure, + call->saved_receiving_stream_ready_ctx.success && success, NULL); call->saved_receiving_stream_ready_ctx.bctlp = NULL; } diff --git a/src/core/lib/surface/channel.c b/src/core/lib/surface/channel.c index 06f991b085..332f504507 100644 --- a/src/core/lib/surface/channel.c +++ b/src/core/lib/surface/channel.c @@ -40,7 +40,7 @@ #include <grpc/support/log.h> #include <grpc/support/string_util.h> -#include "src/core/lib/client_config/resolver_registry.h" +#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/support/string.h" #include "src/core/lib/surface/api_trace.h" diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h index 68afac6fac..22dae930e4 100644 --- a/src/core/lib/surface/channel.h +++ b/src/core/lib/surface/channel.h @@ -35,7 +35,6 @@ #define GRPC_CORE_LIB_SURFACE_CHANNEL_H #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/client_config/client_channel_factory.h" #include "src/core/lib/surface/channel_stack_type.h" grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target, diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index aca4ce9d07..f221d8db35 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -39,17 +39,17 @@ #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/time.h> +#include "src/core/ext/client_config/client_channel.h" +#include "src/core/ext/client_config/lb_policy_registry.h" +#include "src/core/ext/client_config/resolver_registry.h" +#include "src/core/ext/client_config/subchannel.h" +#include "src/core/ext/client_config/subchannel_index.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/channel/client_channel.h" #include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/http_client_filter.h" #include "src/core/lib/channel/http_server_filter.h" -#include "src/core/lib/client_config/lb_policy_registry.h" -#include "src/core/lib/client_config/resolver_registry.h" -#include "src/core/lib/client_config/subchannel.h" -#include "src/core/lib/client_config/subchannel_index.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/iomgr.h" diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 37cc2bd101..ad8ee8c7a9 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -685,10 +685,14 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; if (md->key == GRPC_MDSTR_PATH) { - calld->path = GRPC_MDSTR_REF(md->value); + if (calld->path == NULL) { + calld->path = GRPC_MDSTR_REF(md->value); + } return NULL; } else if (md->key == GRPC_MDSTR_AUTHORITY) { - calld->host = GRPC_MDSTR_REF(md->value); + if (calld->host == NULL) { + calld->host = GRPC_MDSTR_REF(md->value); + } return NULL; } return md; diff --git a/src/core/lib/transport/metadata.c b/src/core/lib/transport/metadata.c index d358bea76f..5d9e7e74c1 100644 --- a/src/core/lib/transport/metadata.c +++ b/src/core/lib/transport/metadata.c @@ -246,6 +246,12 @@ void grpc_mdctx_global_shutdown(void) { if (shard->count != 0) { gpr_log(GPR_DEBUG, "WARNING: %d metadata strings were leaked", shard->count); + for (size_t j = 0; j < shard->capacity; j++) { + for (internal_string *s = shard->strs[j]; s; s = s->bucket_next) { + gpr_log(GPR_DEBUG, "LEAKED: %s", + grpc_mdstr_as_c_string((grpc_mdstr *)s)); + } + } if (grpc_iomgr_abort_on_leaks()) { abort(); } diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index bb1120ee3a..1eb446312b 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -50,7 +50,7 @@ typedef struct grpc_transport grpc_transport; for a stream. */ typedef struct grpc_stream grpc_stream; -/*#define GRPC_STREAM_REFCOUNT_DEBUG*/ +//#define GRPC_STREAM_REFCOUNT_DEBUG typedef struct grpc_stream_refcount { gpr_refcount refs; diff --git a/src/node/stress/stress_client.js b/src/node/stress/stress_client.js index 8332652e2a..6054d3a253 100644 --- a/src/node/stress/stress_client.js +++ b/src/node/stress/stress_client.js @@ -102,7 +102,7 @@ function main() { var argv = parseArgs(process.argv, { string: ['server_addresses', 'test_cases', 'metrics_port'], default: {'server_addresses': 'localhost:8080', - 'test_duration-secs': -1, + 'test_duration_secs': -1, 'num_channels_per_server': 1, 'num_stubs_per_channel': 1, 'metrics_port': '8081'} @@ -118,8 +118,8 @@ function main() { })); start(server_addresses, test_cases, argv.num_channels_per_server, argv.num_stubs_per_channel, argv.metrics_port); - if (argv['test_duration-secs'] > -1) { - setTimeout(stop, argv['test_duration-secs'] * 1000); + if (argv.test_duration_secs > -1) { + setTimeout(stop, argv.test_duration_secs * 1000); } } diff --git a/src/proto/grpc/testing/control.proto b/src/proto/grpc/testing/control.proto index 11e752a74b..458b19c4d6 100644 --- a/src/proto/grpc/testing/control.proto +++ b/src/proto/grpc/testing/control.proto @@ -169,3 +169,28 @@ message CoreResponse { message Void { } + +// A single performance scenario: input to qps_json_driver +message Scenario { + // Human readable name for this scenario + string name = 1; + // Client configuration + ClientConfig client_config = 2; + // Number of clients to start for the test + int32 num_clients = 3; + // Server configuration + ServerConfig server_config = 4; + // Number of servers to start for the test + int32 num_servers = 5; + // Warmup period, in seconds + int32 warmup_seconds = 6; + // Benchmark time, in seconds + int32 benchmark_seconds = 7; + // Number of workers to spawn locally (usually zero) + int32 spawn_local_worker_count = 8; +} + +// A set of scenarios to be run with qps_json_driver +message Scenarios { + repeated Scenario scenarios = 1; +} diff --git a/src/proto/grpc/testing/metrics.proto b/src/proto/grpc/testing/metrics.proto index 0cc4b60239..1202b20b8f 100644 --- a/src/proto/grpc/testing/metrics.proto +++ b/src/proto/grpc/testing/metrics.proto @@ -1,4 +1,4 @@ -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ message GaugeResponse { string name = 1; oneof value { int64 long_value = 2; - double double_vale = 3; + double double_value = 3; string string_value = 4; } } diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 3452e3a0f5..2ed0b1e520 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -83,6 +83,23 @@ CORE_SOURCE_FILES = [ 'src/core/ext/census/operation.c', 'src/core/ext/census/placeholders.c', 'src/core/ext/census/tracing.c', + 'src/core/ext/client_config/channel_connectivity.c', + 'src/core/ext/client_config/client_channel.c', + 'src/core/ext/client_config/client_channel_factory.c', + 'src/core/ext/client_config/client_config.c', + 'src/core/ext/client_config/connector.c', + 'src/core/ext/client_config/default_initial_connect_string.c', + '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/resolver.c', + 'src/core/ext/client_config/resolver_factory.c', + 'src/core/ext/client_config/resolver_registry.c', + 'src/core/ext/client_config/subchannel.c', + 'src/core/ext/client_config/subchannel_call_holder.c', + 'src/core/ext/client_config/subchannel_index.c', + 'src/core/ext/client_config/uri_parser.c', 'src/core/ext/lb_policy/grpclb/load_balancer_api.c', 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/ext/lb_policy/pick_first/pick_first.c', @@ -117,26 +134,10 @@ CORE_SOURCE_FILES = [ 'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack_builder.c', - 'src/core/lib/channel/client_channel.c', 'src/core/lib/channel/compress_filter.c', 'src/core/lib/channel/connected_channel.c', 'src/core/lib/channel/http_client_filter.c', 'src/core/lib/channel/http_server_filter.c', - 'src/core/lib/channel/subchannel_call_holder.c', - 'src/core/lib/client_config/client_channel_factory.c', - 'src/core/lib/client_config/client_config.c', - 'src/core/lib/client_config/connector.c', - 'src/core/lib/client_config/default_initial_connect_string.c', - 'src/core/lib/client_config/initial_connect_string.c', - 'src/core/lib/client_config/lb_policy.c', - 'src/core/lib/client_config/lb_policy_factory.c', - 'src/core/lib/client_config/lb_policy_registry.c', - 'src/core/lib/client_config/resolver.c', - 'src/core/lib/client_config/resolver_factory.c', - 'src/core/lib/client_config/resolver_registry.c', - 'src/core/lib/client_config/subchannel.c', - 'src/core/lib/client_config/subchannel_index.c', - 'src/core/lib/client_config/uri_parser.c', 'src/core/lib/compression/compression_algorithm.c', 'src/core/lib/compression/message_compress.c', 'src/core/lib/debug/trace.c', @@ -209,7 +210,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/surface/call_details.c', 'src/core/lib/surface/call_log_batch.c', 'src/core/lib/surface/channel.c', - 'src/core/lib/surface/channel_connectivity.c', 'src/core/lib/surface/channel_init.c', 'src/core/lib/surface/channel_ping.c', 'src/core/lib/surface/channel_stack_type.c', |