diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-01 08:48:45 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-01 08:48:45 -0700 |
commit | aaa03d74ceae4d48e31f4ba0619e359acd21505a (patch) | |
tree | 06677cfa5ddf1e7732d53cf550cd2ec1deadbc83 /src/core/surface | |
parent | c590f213c7a7d0b9b1692826050152130fa5709f (diff) | |
parent | ee066371bbc83e3fdc0dd069d191335c32b9b6db (diff) |
Merge github.com:grpc/grpc into you-complete-me
Diffstat (limited to 'src/core/surface')
-rw-r--r-- | src/core/surface/call.c | 18 | ||||
-rw-r--r-- | src/core/surface/secure_channel_create.c | 4 | ||||
-rw-r--r-- | src/core/surface/server.c | 6 | ||||
-rw-r--r-- | src/core/surface/server.h | 2 | ||||
-rw-r--r-- | src/core/surface/server_chttp2.c | 3 |
5 files changed, 17 insertions, 16 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 4d2ba7cd7d..e3995a407b 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -205,8 +205,8 @@ struct grpc_call { /* Received call statuses from various sources */ received_status status[STATUS_SOURCE_COUNT]; - void *context[GRPC_CONTEXT_COUNT]; - void (*destroy_context[GRPC_CONTEXT_COUNT])(void *); + /* Contexts for various subsystems (security, tracing, ...). */ + grpc_call_context_element context[GRPC_CONTEXT_COUNT]; /* Deadline alarm - if have_alarm is non-zero */ grpc_alarm alarm; @@ -344,8 +344,8 @@ static void destroy_call(void *call, int ignored_success) { grpc_mdelem_unref(c->send_initial_metadata[i].md); } for (i = 0; i < GRPC_CONTEXT_COUNT; i++) { - if (c->destroy_context[i]) { - c->destroy_context[i](c->context[i]); + if (c->context[i].destroy) { + c->context[i].destroy(c->context[i].value); } } grpc_sopb_destroy(&c->send_ops); @@ -1300,15 +1300,15 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops, void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *value, void (*destroy)(void *value)) { - if (call->destroy_context[elem]) { - call->destroy_context[elem](value); + if (call->context[elem].destroy) { + call->context[elem].destroy(call->context[elem].value); } - call->context[elem] = value; - call->destroy_context[elem] = destroy; + call->context[elem].value = value; + call->context[elem].destroy = destroy; } void *grpc_call_context_get(grpc_call *call, grpc_context_index elem) { - return call->context[elem]; + return call->context[elem].value; } gpr_uint8 grpc_call_is_client(grpc_call *call) { return call->is_client; } diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index 3e331293b5..a71d12291e 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -46,7 +46,7 @@ #include "src/core/channel/http_client_filter.h" #include "src/core/iomgr/resolve_address.h" #include "src/core/iomgr/tcp_client.h" -#include "src/core/security/auth.h" +#include "src/core/security/auth_filters.h" #include "src/core/security/credentials.h" #include "src/core/security/secure_transport_setup.h" #include "src/core/support/string.h" @@ -226,7 +226,7 @@ grpc_channel *grpc_secure_channel_create(grpc_credentials *creds, GRPC_SECURITY_OK) { return grpc_lame_client_channel_create(); } - mdctx = grpc_credentials_get_or_create_metadata_context(creds); + mdctx = grpc_mdctx_create(); s = gpr_malloc(sizeof(setup)); connector_arg = grpc_security_connector_to_arg(&connector->base); diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 20985af44c..71b1dd0630 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -727,7 +727,7 @@ void grpc_server_start(grpc_server *server) { grpc_transport_setup_result grpc_server_setup_transport( grpc_server *s, grpc_transport *transport, grpc_channel_filter const **extra_filters, size_t num_extra_filters, - grpc_mdctx *mdctx) { + grpc_mdctx *mdctx, const grpc_channel_args *args) { size_t num_filters = s->channel_filter_count + num_extra_filters + 1; grpc_channel_filter const **filters = gpr_malloc(sizeof(grpc_channel_filter *) * num_filters); @@ -758,8 +758,8 @@ grpc_transport_setup_result grpc_server_setup_transport( grpc_transport_add_to_pollset(transport, grpc_cq_pollset(s->cqs[i])); } - channel = grpc_channel_create_from_filters(filters, num_filters, - s->channel_args, mdctx, 0); + channel = + grpc_channel_create_from_filters(filters, num_filters, args, mdctx, 0); chand = (channel_data *)grpc_channel_stack_element( grpc_channel_get_channel_stack(channel), 0) ->channel_data; diff --git a/src/core/surface/server.h b/src/core/surface/server.h index 58f17272a4..91a1a2a7f6 100644 --- a/src/core/surface/server.h +++ b/src/core/surface/server.h @@ -58,7 +58,7 @@ void grpc_server_listener_destroy_done(void *server); grpc_transport_setup_result grpc_server_setup_transport( grpc_server *server, grpc_transport *transport, grpc_channel_filter const **extra_filters, size_t num_extra_filters, - grpc_mdctx *mdctx); + grpc_mdctx *mdctx, const grpc_channel_args *args); const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server); diff --git a/src/core/surface/server_chttp2.c b/src/core/surface/server_chttp2.c index 7b5c2f227b..7e49a531df 100644 --- a/src/core/surface/server_chttp2.c +++ b/src/core/surface/server_chttp2.c @@ -48,7 +48,8 @@ static grpc_transport_setup_result setup_transport(void *server, static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; return grpc_server_setup_transport(server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx); + GPR_ARRAY_SIZE(extra_filters), mdctx, + grpc_server_get_channel_args(server)); } static void new_transport(void *server, grpc_endpoint *tcp) { |