aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-02-19 12:28:34 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-02-19 12:28:34 -0800
commitde676268aae52a1b7500d7021b102cf737bdf8d6 (patch)
treedc8cd3c0c4569c0c28e9e1585e5c592cf715e792 /src/core/surface
parent9a8df281ad4d9003a25a304c32df189f9469b838 (diff)
Reinstate sockpair tests
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/channel_init.c2
-rw-r--r--src/core/surface/channel_stack_type.c2
-rw-r--r--src/core/surface/channel_stack_type.h7
-rw-r--r--src/core/surface/init.c8
-rw-r--r--src/core/surface/init_secure.c2
5 files changed, 21 insertions, 0 deletions
diff --git a/src/core/surface/channel_init.c b/src/core/surface/channel_init.c
index d4c0e9f27f..70ee2c5bbd 100644
--- a/src/core/surface/channel_init.c
+++ b/src/core/surface/channel_init.c
@@ -116,6 +116,8 @@ static const char *name_for_type(grpc_channel_stack_type type) {
return "CLIENT_UCHANNEL";
case GRPC_CLIENT_LAME_CHANNEL:
return "CLIENT_LAME_CHANNEL";
+ case GRPC_CLIENT_DIRECT_CHANNEL:
+ return "CLIENT_DIRECT_CHANNEL";
case GRPC_NUM_CHANNEL_STACK_TYPES:
break;
}
diff --git a/src/core/surface/channel_stack_type.c b/src/core/surface/channel_stack_type.c
index f08dff2851..6fd33d411d 100644
--- a/src/core/surface/channel_stack_type.c
+++ b/src/core/surface/channel_stack_type.c
@@ -45,6 +45,8 @@ bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type) {
return true;
case GRPC_CLIENT_LAME_CHANNEL:
return true;
+ case GRPC_CLIENT_DIRECT_CHANNEL:
+ return true;
case GRPC_SERVER_CHANNEL:
return false;
case GRPC_NUM_CHANNEL_STACK_TYPES:
diff --git a/src/core/surface/channel_stack_type.h b/src/core/surface/channel_stack_type.h
index d60bfab227..56c6453fb5 100644
--- a/src/core/surface/channel_stack_type.h
+++ b/src/core/surface/channel_stack_type.h
@@ -37,10 +37,17 @@
#include <stdbool.h>
typedef enum {
+ // normal top-half client channel with load-balancing, connection management
GRPC_CLIENT_CHANNEL,
+ // abbreviated top-half client channel bound to one subchannel - for internal load balancing implementation
GRPC_CLIENT_UCHANNEL,
+ // bottom-half of a client channel: everything that happens post-load balancing (bound to a specific transport)
GRPC_CLIENT_SUBCHANNEL,
+ // a permanently broken client channel
GRPC_CLIENT_LAME_CHANNEL,
+ // a directly connected client channel (without load-balancing, directly talks to a transport)
+ GRPC_CLIENT_DIRECT_CHANNEL,
+ // server side channel
GRPC_SERVER_CHANNEL,
// must be last
GRPC_NUM_CHANNEL_STACK_TYPES
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index 890f86a9b1..838798e309 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -109,6 +109,8 @@ static bool maybe_add_http_filter(grpc_channel_stack_builder *builder,
static void register_builtin_channel_init() {
grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX, prepend_filter,
(void *)&grpc_compress_filter);
+ grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX, prepend_filter,
+ (void *)&grpc_compress_filter);
grpc_channel_init_register_stage(GRPC_CLIENT_UCHANNEL, INT_MAX,
prepend_filter,
(void *)&grpc_compress_filter);
@@ -119,6 +121,11 @@ static void register_builtin_channel_init() {
(void *)&grpc_http_client_filter);
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
grpc_add_connected_filter, NULL);
+ grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+ maybe_add_http_filter,
+ (void *)&grpc_http_client_filter);
+ grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+ grpc_add_connected_filter, NULL);
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
maybe_add_http_filter,
(void *)&grpc_http_server_filter);
@@ -175,6 +182,7 @@ void grpc_init(void) {
grpc_register_tracer("http", &grpc_http_trace);
grpc_register_tracer("flowctl", &grpc_flowctl_trace);
grpc_register_tracer("connectivity_state", &grpc_connectivity_state_trace);
+ grpc_register_tracer("channel_stack_builder", &grpc_trace_channel_stack_builder);
grpc_security_pre_init();
grpc_iomgr_init();
grpc_executor_init();
diff --git a/src/core/surface/init_secure.c b/src/core/surface/init_secure.c
index de56fb3bf0..311dda9864 100644
--- a/src/core/surface/init_secure.c
+++ b/src/core/surface/init_secure.c
@@ -82,6 +82,8 @@ static bool maybe_prepend_server_auth_filter(
void grpc_register_security_filters(void) {
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
maybe_prepend_client_auth_filter, NULL);
+ grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+ maybe_prepend_client_auth_filter, NULL);
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
maybe_prepend_server_auth_filter, NULL);
}