diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-21 17:15:19 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-21 17:15:19 -0700 |
commit | ba496454b2f0909a64845f1305f3b0a81073a4f1 (patch) | |
tree | d01a5956fb76ebd83d89fb6c14bf3f9cf082f727 /src/core/security | |
parent | 294d0ecc05097753982e89f14bb0b63c67451038 (diff) |
Fixes
Diffstat (limited to 'src/core/security')
-rw-r--r-- | src/core/security/secure_endpoint.c | 11 | ||||
-rw-r--r-- | src/core/security/server_secure_chttp2.c | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c index a501544341..a647345796 100644 --- a/src/core/security/secure_endpoint.c +++ b/src/core/security/secure_endpoint.c @@ -82,16 +82,17 @@ static void destroy(secure_endpoint *secure_ep, grpc_call_list *call_list) { /*#define GRPC_SECURE_ENDPOINT_REFCOUNT_DEBUG*/ #ifdef GRPC_SECURE_ENDPOINT_REFCOUNT_DEBUG -#define SECURE_ENDPOINT_UNREF(ep, reason) \ - secure_endpoint_unref((ep), (reason), __FILE__, __LINE__) +#define SECURE_ENDPOINT_UNREF(ep, reason, cl) \ + secure_endpoint_unref((ep), (cl), (reason), __FILE__, __LINE__) #define SECURE_ENDPOINT_REF(ep, reason) \ secure_endpoint_ref((ep), (reason), __FILE__, __LINE__) -static void secure_endpoint_unref(secure_endpoint *ep, const char *reason, +static void secure_endpoint_unref(secure_endpoint *ep, + grpc_call_list *call_list, const char *reason, const char *file, int line) { gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "SECENDP unref %p : %s %d -> %d", ep, reason, ep->ref.count, ep->ref.count - 1); if (gpr_unref(&ep->ref)) { - destroy(ep); + destroy(ep, call_list); } } @@ -219,6 +220,7 @@ static void endpoint_read(grpc_endpoint *secure_ep, gpr_slice_buffer *slices, ep->read_buffer = slices; gpr_slice_buffer_reset_and_unref(ep->read_buffer); + SECURE_ENDPOINT_REF(ep, "read"); if (ep->leftover_bytes.count) { gpr_slice_buffer_swap(&ep->leftover_bytes, &ep->source_buffer); GPR_ASSERT(ep->leftover_bytes.count == 0); @@ -226,7 +228,6 @@ static void endpoint_read(grpc_endpoint *secure_ep, gpr_slice_buffer *slices, return; } - SECURE_ENDPOINT_REF(ep, "read"); grpc_endpoint_read(ep->wrapped_ep, &ep->source_buffer, &ep->on_read, call_list); } diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c index 0662839105..829082507c 100644 --- a/src/core/security/server_secure_chttp2.c +++ b/src/core/security/server_secure_chttp2.c @@ -87,8 +87,7 @@ static void state_unref(grpc_server_secure_state *state) { } static void setup_transport(void *statep, grpc_transport *transport, - grpc_mdctx *mdctx, grpc_workqueue *workqueue, - grpc_call_list *call_list) { + grpc_mdctx *mdctx, grpc_call_list *call_list) { static grpc_channel_filter const *extra_filters[] = { &grpc_server_auth_filter, &grpc_http_server_filter}; grpc_server_secure_state *state = statep; @@ -101,8 +100,8 @@ static void setup_transport(void *statep, grpc_transport *transport, grpc_server_get_channel_args(state->server), args_to_add, GPR_ARRAY_SIZE(args_to_add)); grpc_server_setup_transport(state->server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, workqueue, - args_copy, call_list); + GPR_ARRAY_SIZE(extra_filters), mdctx, args_copy, + call_list); grpc_channel_args_destroy(args_copy); } @@ -135,17 +134,15 @@ static void on_secure_transport_setup_done(void *statep, grpc_server_secure_state *state = statep; grpc_transport *transport; grpc_mdctx *mdctx; - grpc_workqueue *workqueue; if (status == GRPC_SECURITY_OK) { gpr_mu_lock(&state->mu); remove_tcp_from_list_locked(state, wrapped_endpoint); if (!state->is_shutdown) { mdctx = grpc_mdctx_create(); - workqueue = grpc_workqueue_create(call_list); transport = grpc_create_chttp2_transport( grpc_server_get_channel_args(state->server), secure_endpoint, mdctx, 0, call_list); - setup_transport(state, transport, mdctx, workqueue, call_list); + setup_transport(state, transport, mdctx, call_list); grpc_chttp2_transport_start_reading(transport, NULL, 0, call_list); } else { /* We need to consume this here, because the server may already have gone |