aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-22 10:47:08 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-22 10:47:08 -0700
commit9f7dc3a4e5c3eeb6524472c6dc694f0600d03688 (patch)
tree8b7d92f3bdd000ec44011dd4c96bd3d9c39036fb /src/core/security
parent1be70ccdb84ec41975cc018f6b2a2a89cf5072ee (diff)
Move argument passing to start of list
Diffstat (limited to 'src/core/security')
-rw-r--r--src/core/security/client_auth_filter.c24
-rw-r--r--src/core/security/credentials.c38
-rw-r--r--src/core/security/handshake.c46
-rw-r--r--src/core/security/jwt_verifier.c6
-rw-r--r--src/core/security/secure_endpoint.c28
-rw-r--r--src/core/security/security_connector.c20
-rw-r--r--src/core/security/server_auth_filter.c4
-rw-r--r--src/core/security/server_secure_chttp2.c20
8 files changed, 93 insertions, 93 deletions
diff --git a/src/core/security/client_auth_filter.c b/src/core/security/client_auth_filter.c
index 89ac3f464f..33f2e8093a 100644
--- a/src/core/security/client_auth_filter.c
+++ b/src/core/security/client_auth_filter.c
@@ -94,7 +94,7 @@ bubble_up_error (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_status
call_data *calld = elem->call_data;
gpr_log (GPR_ERROR, "Client side authentication failure: %s", error_msg);
grpc_transport_stream_op_add_cancellation (&calld->op, status);
- grpc_call_next_op (elem, &calld->op, closure_list);
+ grpc_call_next_op (exec_ctx, elem, &calld->op);
}
static void
@@ -109,7 +109,7 @@ on_credentials_metadata (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credent
reset_service_url (calld);
if (status != GRPC_CREDENTIALS_OK)
{
- bubble_up_error (elem, GRPC_STATUS_UNAUTHENTICATED, "Credentials failed to get metadata.", closure_list);
+ bubble_up_error (exec_ctx, elem, GRPC_STATUS_UNAUTHENTICATED, "Credentials failed to get metadata.");
return;
}
GPR_ASSERT (num_md <= MAX_CREDENTIALS_METADATA_COUNT);
@@ -119,7 +119,7 @@ on_credentials_metadata (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credent
{
grpc_metadata_batch_add_tail (mdb, &calld->md_links[i], grpc_mdelem_from_slices (chand->md_ctx, gpr_slice_ref (md_elems[i].key), gpr_slice_ref (md_elems[i].value)));
}
- grpc_call_next_op (elem, op, closure_list);
+ grpc_call_next_op (exec_ctx, elem, op);
}
void
@@ -161,7 +161,7 @@ send_security_metadata (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc
if (!channel_creds_has_md && !call_creds_has_md)
{
/* Skip sending metadata altogether. */
- grpc_call_next_op (elem, op, closure_list);
+ grpc_call_next_op (exec_ctx, elem, op);
return;
}
@@ -170,7 +170,7 @@ send_security_metadata (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc
calld->creds = grpc_composite_credentials_create (channel_creds, ctx->creds, NULL);
if (calld->creds == NULL)
{
- bubble_up_error (elem, GRPC_STATUS_INVALID_ARGUMENT, "Incompatible credentials set on channel and call.", closure_list);
+ bubble_up_error (exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT, "Incompatible credentials set on channel and call.");
return;
}
}
@@ -182,7 +182,7 @@ send_security_metadata (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc
build_service_url (chand->security_connector->base.url_scheme, calld);
calld->op = *op; /* Copy op (originates from the caller's stack). */
GPR_ASSERT (calld->pollset);
- grpc_credentials_get_request_metadata (calld->creds, calld->pollset, calld->service_url, on_credentials_metadata, elem, closure_list);
+ grpc_credentials_get_request_metadata (exec_ctx, calld->creds, calld->pollset, calld->service_url, on_credentials_metadata, elem);
}
static void
@@ -193,13 +193,13 @@ on_host_checked (grpc_exec_ctx * exec_ctx, void *user_data, grpc_security_status
if (status == GRPC_SECURITY_OK)
{
- send_security_metadata (elem, &calld->op, closure_list);
+ send_security_metadata (exec_ctx, elem, &calld->op);
}
else
{
char *error_msg;
gpr_asprintf (&error_msg, "Invalid host %s set in :authority metadata.", grpc_mdstr_as_c_string (calld->host));
- bubble_up_error (elem, GRPC_STATUS_INVALID_ARGUMENT, error_msg, closure_list);
+ bubble_up_error (exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT, error_msg);
gpr_free (error_msg);
}
}
@@ -272,26 +272,26 @@ auth_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grp
grpc_security_status status;
const char *call_host = grpc_mdstr_as_c_string (calld->host);
calld->op = *op; /* Copy op (originates from the caller's stack). */
- status = grpc_channel_security_connector_check_call_host (chand->security_connector, call_host, on_host_checked, elem, closure_list);
+ status = grpc_channel_security_connector_check_call_host (exec_ctx, chand->security_connector, call_host, on_host_checked, elem);
if (status != GRPC_SECURITY_OK)
{
if (status == GRPC_SECURITY_ERROR)
{
char *error_msg;
gpr_asprintf (&error_msg, "Invalid host %s set in :authority metadata.", call_host);
- bubble_up_error (elem, GRPC_STATUS_INVALID_ARGUMENT, error_msg, closure_list);
+ bubble_up_error (exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT, error_msg);
gpr_free (error_msg);
}
return; /* early exit */
}
}
- send_security_metadata (elem, op, closure_list);
+ send_security_metadata (exec_ctx, elem, op);
return; /* early exit */
}
}
/* pass control down the stack */
- grpc_call_next_op (elem, op, closure_list);
+ grpc_call_next_op (exec_ctx, elem, op);
}
/* Constructor for call_data */
diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c
index caf3d6f885..7c444f6ac9 100644
--- a/src/core/security/credentials.c
+++ b/src/core/security/credentials.c
@@ -126,11 +126,11 @@ grpc_credentials_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credential
{
if (cb != NULL)
{
- cb (user_data, NULL, 0, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, NULL, 0, GRPC_CREDENTIALS_OK);
}
return;
}
- creds->vtable->get_request_metadata (creds, pollset, service_url, cb, user_data, closure_list);
+ creds->vtable->get_request_metadata (exec_ctx, creds, pollset, service_url, cb, user_data);
}
grpc_security_status
@@ -460,12 +460,12 @@ jwt_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, gr
if (jwt_md != NULL)
{
- cb (user_data, jwt_md->entries, jwt_md->num_entries, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, jwt_md->entries, jwt_md->num_entries, GRPC_CREDENTIALS_OK);
grpc_credentials_md_store_unref (jwt_md);
}
else
{
- cb (user_data, NULL, 0, GRPC_CREDENTIALS_ERROR, closure_list);
+ cb (exec_ctx, user_data, NULL, 0, GRPC_CREDENTIALS_ERROR);
}
}
@@ -644,12 +644,12 @@ on_oauth2_token_fetcher_http_response (grpc_exec_ctx * exec_ctx, void *user_data
if (status == GRPC_CREDENTIALS_OK)
{
c->token_expiration = gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), token_lifetime);
- r->cb (r->user_data, c->access_token_md->entries, c->access_token_md->num_entries, status, closure_list);
+ r->cb (exec_ctx, r->user_data, c->access_token_md->entries, c->access_token_md->num_entries, status);
}
else
{
c->token_expiration = gpr_inf_past (GPR_CLOCK_REALTIME);
- r->cb (r->user_data, NULL, 0, status, closure_list);
+ r->cb (exec_ctx, r->user_data, NULL, 0, status);
}
gpr_mu_unlock (&c->mu);
grpc_credentials_metadata_request_destroy (r);
@@ -671,12 +671,12 @@ oauth2_token_fetcher_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_creden
}
if (cached_access_token_md != NULL)
{
- cb (user_data, cached_access_token_md->entries, cached_access_token_md->num_entries, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, cached_access_token_md->entries, cached_access_token_md->num_entries, GRPC_CREDENTIALS_OK);
grpc_credentials_md_store_unref (cached_access_token_md);
}
else
{
- c->fetch_func (grpc_credentials_metadata_request_create (creds, cb, user_data), &c->httpcli_context, pollset, on_oauth2_token_fetcher_http_response, gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), refresh_threshold), closure_list);
+ c->fetch_func (grpc_credentials_metadata_request_create (creds, cb, user_data), &c->httpcli_context, pollset, on_oauth2_token_fetcher_http_response, gpr_time_add (gpr_now (exec_ctx, GPR_CLOCK_REALTIME), refresh_threshold));
}
}
@@ -710,7 +710,7 @@ compute_engine_fetch_oauth2 (grpc_exec_ctx * exec_ctx, grpc_credentials_metadata
request.path = GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
request.hdr_count = 1;
request.hdrs = &header;
- grpc_httpcli_get (httpcli_context, pollset, &request, deadline, response_cb, metadata_req, closure_list);
+ grpc_httpcli_get (exec_ctx, httpcli_context, pollset, &request, deadline, response_cb, metadata_req);
}
grpc_credentials *
@@ -755,7 +755,7 @@ refresh_token_fetch_oauth2 (grpc_exec_ctx * exec_ctx, grpc_credentials_metadata_
request.hdr_count = 1;
request.hdrs = &header;
request.handshaker = &grpc_httpcli_ssl;
- grpc_httpcli_post (httpcli_context, pollset, &request, body, strlen (body), deadline, response_cb, metadata_req, closure_list);
+ grpc_httpcli_post (httpcli_context, pollset, &request, body, strlen (exec_ctx, body), deadline, response_cb, metadata_req);
gpr_free (body);
}
@@ -828,7 +828,7 @@ md_only_test_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials *
}
else
{
- cb (user_data, c->md_store->entries, 1, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, c->md_store->entries, 1, GRPC_CREDENTIALS_OK);
}
}
@@ -877,7 +877,7 @@ static void
access_token_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data)
{
grpc_access_token_credentials *c = (grpc_access_token_credentials *) creds;
- cb (user_data, c->access_token_md->entries, 1, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, c->access_token_md->entries, 1, GRPC_CREDENTIALS_OK);
}
static grpc_credentials_vtable access_token_vtable = {
@@ -1047,7 +1047,7 @@ composite_metadata_cb (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credentia
grpc_composite_credentials_metadata_context *ctx = (grpc_composite_credentials_metadata_context *) user_data;
if (status != GRPC_CREDENTIALS_OK)
{
- ctx->cb (ctx->user_data, NULL, 0, status, closure_list);
+ ctx->cb (exec_ctx, ctx->user_data, NULL, 0, status);
return;
}
@@ -1067,13 +1067,13 @@ composite_metadata_cb (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credentia
grpc_credentials *inner_creds = ctx->composite_creds->inner.creds_array[ctx->creds_index++];
if (grpc_credentials_has_request_metadata (inner_creds))
{
- grpc_credentials_get_request_metadata (inner_creds, ctx->pollset, ctx->service_url, composite_metadata_cb, ctx, closure_list);
+ grpc_credentials_get_request_metadata (exec_ctx, inner_creds, ctx->pollset, ctx->service_url, composite_metadata_cb, ctx);
return;
}
}
/* We're done!. */
- ctx->cb (ctx->user_data, ctx->md_elems->entries, ctx->md_elems->num_entries, GRPC_CREDENTIALS_OK, closure_list);
+ ctx->cb (exec_ctx, ctx->user_data, ctx->md_elems->entries, ctx->md_elems->num_entries, GRPC_CREDENTIALS_OK);
composite_md_context_destroy (ctx);
grpc_closure_list_run (closure_list);
}
@@ -1085,7 +1085,7 @@ composite_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * cre
grpc_composite_credentials_metadata_context *ctx;
if (!grpc_credentials_has_request_metadata (creds))
{
- cb (user_data, NULL, 0, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, NULL, 0, GRPC_CREDENTIALS_OK);
return;
}
ctx = gpr_malloc (sizeof (grpc_composite_credentials_metadata_context));
@@ -1101,7 +1101,7 @@ composite_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * cre
grpc_credentials *inner_creds = c->inner.creds_array[ctx->creds_index++];
if (grpc_credentials_has_request_metadata (inner_creds))
{
- grpc_credentials_get_request_metadata (inner_creds, pollset, service_url, composite_metadata_cb, ctx, closure_list);
+ grpc_credentials_get_request_metadata (exec_ctx, inner_creds, pollset, service_url, composite_metadata_cb, ctx);
return;
}
}
@@ -1262,7 +1262,7 @@ static void
iam_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds, grpc_pollset * pollset, const char *service_url, grpc_credentials_metadata_cb cb, void *user_data)
{
grpc_google_iam_credentials *c = (grpc_google_iam_credentials *) creds;
- cb (user_data, c->iam_md->entries, c->iam_md->num_entries, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, c->iam_md->entries, c->iam_md->num_entries, GRPC_CREDENTIALS_OK);
}
static grpc_credentials_vtable iam_vtable = {
@@ -1373,7 +1373,7 @@ plugin_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_credentials * creds,
}
else
{
- cb (user_data, NULL, 0, GRPC_CREDENTIALS_OK, closure_list);
+ cb (exec_ctx, user_data, NULL, 0, GRPC_CREDENTIALS_OK);
}
}
diff --git a/src/core/security/handshake.c b/src/core/security/handshake.c
index 7951f34943..687cc575a7 100644
--- a/src/core/security/handshake.c
+++ b/src/core/security/handshake.c
@@ -68,20 +68,20 @@ security_handshake_done (grpc_exec_ctx * exec_ctx, grpc_security_handshake * h,
{
if (is_success)
{
- h->cb (h->user_data, GRPC_SECURITY_OK, h->wrapped_endpoint, h->secure_endpoint, closure_list);
+ h->cb (exec_ctx, h->user_data, GRPC_SECURITY_OK, h->wrapped_endpoint, h->secure_endpoint);
}
else
{
if (h->secure_endpoint != NULL)
{
- grpc_endpoint_shutdown (h->secure_endpoint, closure_list);
- grpc_endpoint_destroy (h->secure_endpoint, closure_list);
+ grpc_endpoint_shutdown (exec_ctx, h->secure_endpoint);
+ grpc_endpoint_destroy (exec_ctx, h->secure_endpoint);
}
else
{
- grpc_endpoint_destroy (h->wrapped_endpoint, closure_list);
+ grpc_endpoint_destroy (exec_ctx, h->wrapped_endpoint);
}
- h->cb (h->user_data, GRPC_SECURITY_ERROR, h->wrapped_endpoint, NULL, closure_list);
+ h->cb (exec_ctx, h->user_data, GRPC_SECURITY_ERROR, h->wrapped_endpoint, NULL);
}
if (h->handshaker != NULL)
tsi_handshaker_destroy (h->handshaker);
@@ -103,20 +103,20 @@ on_peer_checked (grpc_exec_ctx * exec_ctx, void *user_data, grpc_security_status
if (status != GRPC_SECURITY_OK)
{
gpr_log (GPR_ERROR, "Error checking peer.");
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
result = tsi_handshaker_create_frame_protector (h->handshaker, NULL, &protector);
if (result != TSI_OK)
{
gpr_log (GPR_ERROR, "Frame protector creation failed with error %s.", tsi_result_to_string (result));
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
h->secure_endpoint = grpc_secure_endpoint_create (protector, h->wrapped_endpoint, h->left_overs.slices, h->left_overs.count);
h->left_overs.count = 0;
h->left_overs.length = 0;
- security_handshake_done (h, 1, closure_list);
+ security_handshake_done (exec_ctx, h, 1);
return;
}
@@ -130,19 +130,19 @@ check_peer (grpc_exec_ctx * exec_ctx, grpc_security_handshake * h)
if (result != TSI_OK)
{
gpr_log (GPR_ERROR, "Peer extraction failed with error %s", tsi_result_to_string (result));
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
peer_status = grpc_security_connector_check_peer (h->connector, peer, on_peer_checked, h);
if (peer_status == GRPC_SECURITY_ERROR)
{
gpr_log (GPR_ERROR, "Peer check failed.");
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
else if (peer_status == GRPC_SECURITY_OK)
{
- on_peer_checked (h, peer_status, closure_list);
+ on_peer_checked (exec_ctx, h, peer_status);
}
}
@@ -169,7 +169,7 @@ send_handshake_bytes_to_peer (grpc_exec_ctx * exec_ctx, grpc_security_handshake
if (result != TSI_OK)
{
gpr_log (GPR_ERROR, "Handshake failed with error %s", tsi_result_to_string (result));
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
@@ -178,7 +178,7 @@ send_handshake_bytes_to_peer (grpc_exec_ctx * exec_ctx, grpc_security_handshake
gpr_slice_buffer_add (&h->outgoing, to_send);
/* TODO(klempner,jboeuf): This should probably use the client setup
deadline */
- grpc_endpoint_write (h->wrapped_endpoint, &h->outgoing, &h->on_handshake_data_sent_to_peer, closure_list);
+ grpc_endpoint_write (exec_ctx, h->wrapped_endpoint, &h->outgoing, &h->on_handshake_data_sent_to_peer);
}
static void
@@ -194,7 +194,7 @@ on_handshake_data_received_from_peer (grpc_exec_ctx * exec_ctx, void *handshake,
if (!success)
{
gpr_log (GPR_ERROR, "Read failed.");
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
@@ -211,12 +211,12 @@ on_handshake_data_received_from_peer (grpc_exec_ctx * exec_ctx, void *handshake,
/* We may need more data. */
if (result == TSI_INCOMPLETE_DATA)
{
- grpc_endpoint_read (h->wrapped_endpoint, &h->incoming, &h->on_handshake_data_received_from_peer, closure_list);
+ grpc_endpoint_read (exec_ctx, h->wrapped_endpoint, &h->incoming, &h->on_handshake_data_received_from_peer);
return;
}
else
{
- send_handshake_bytes_to_peer (h, closure_list);
+ send_handshake_bytes_to_peer (exec_ctx, h);
return;
}
}
@@ -224,7 +224,7 @@ on_handshake_data_received_from_peer (grpc_exec_ctx * exec_ctx, void *handshake,
if (result != TSI_OK)
{
gpr_log (GPR_ERROR, "Handshake failed with error %s", tsi_result_to_string (result));
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
@@ -233,7 +233,7 @@ on_handshake_data_received_from_peer (grpc_exec_ctx * exec_ctx, void *handshake,
num_left_overs = (has_left_overs_in_current_slice ? 1 : 0) + h->incoming.count - i - 1;
if (num_left_overs == 0)
{
- check_peer (h, closure_list);
+ check_peer (exec_ctx, h);
return;
}
@@ -244,7 +244,7 @@ on_handshake_data_received_from_peer (grpc_exec_ctx * exec_ctx, void *handshake,
gpr_slice_unref (h->incoming.slices[i]); /* split_tail above increments refcount. */
}
gpr_slice_buffer_addn (&h->left_overs, &h->incoming.slices[i + 1], num_left_overs - (size_t) has_left_overs_in_current_slice);
- check_peer (h, closure_list);
+ check_peer (exec_ctx, h);
}
/* If handshake is NULL, the handshake is done. */
@@ -258,7 +258,7 @@ on_handshake_data_sent_to_peer (grpc_exec_ctx * exec_ctx, void *handshake, int s
{
gpr_log (GPR_ERROR, "Write failed.");
if (handshake != NULL)
- security_handshake_done (h, 0, closure_list);
+ security_handshake_done (exec_ctx, h, 0);
return;
}
@@ -267,11 +267,11 @@ on_handshake_data_sent_to_peer (grpc_exec_ctx * exec_ctx, void *handshake, int s
{
/* TODO(klempner,jboeuf): This should probably use the client setup
deadline */
- grpc_endpoint_read (h->wrapped_endpoint, &h->incoming, &h->on_handshake_data_received_from_peer, closure_list);
+ grpc_endpoint_read (exec_ctx, h->wrapped_endpoint, &h->incoming, &h->on_handshake_data_received_from_peer);
}
else
{
- check_peer (h, closure_list);
+ check_peer (exec_ctx, h);
}
}
@@ -292,5 +292,5 @@ grpc_do_security_handshake (grpc_exec_ctx * exec_ctx, tsi_handshaker * handshake
gpr_slice_buffer_init (&h->left_overs);
gpr_slice_buffer_init (&h->outgoing);
gpr_slice_buffer_init (&h->incoming);
- send_handshake_bytes_to_peer (h, closure_list);
+ send_handshake_bytes_to_peer (exec_ctx, h);
}
diff --git a/src/core/security/jwt_verifier.c b/src/core/security/jwt_verifier.c
index dcc751f143..7a45ff9343 100644
--- a/src/core/security/jwt_verifier.c
+++ b/src/core/security/jwt_verifier.c
@@ -774,7 +774,7 @@ on_openid_config_retrieved (grpc_exec_ctx * exec_ctx, void *user_data, const grp
{
*(req.host + (req.path - jwks_uri)) = '\0';
}
- grpc_httpcli_get (&ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), on_keys_retrieved, ctx, closure_list);
+ grpc_httpcli_get (&ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (exec_ctx, GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), on_keys_retrieved, ctx);
grpc_json_destroy (json);
gpr_free (req.host);
return;
@@ -893,7 +893,7 @@ retrieve_key_and_verify (grpc_exec_ctx * exec_ctx, verifier_cb_ctx * ctx)
http_cb = on_openid_config_retrieved;
}
- grpc_httpcli_get (&ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), http_cb, ctx, closure_list);
+ grpc_httpcli_get (&ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (exec_ctx, GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), http_cb, ctx);
gpr_free (req.host);
gpr_free (req.path);
return;
@@ -943,7 +943,7 @@ grpc_jwt_verifier_verify (grpc_exec_ctx * exec_ctx, grpc_jwt_verifier * verifier
signature = grpc_base64_decode (cur, 1);
if (GPR_SLICE_IS_EMPTY (signature))
goto error;
- retrieve_key_and_verify (verifier_cb_ctx_create (verifier, pollset, header, claims, audience, signature, jwt, signed_jwt_len, user_data, cb), closure_list);
+ retrieve_key_and_verify (verifier_cb_ctx_create (exec_ctx, verifier, pollset, header, claims, audience, signature, jwt, signed_jwt_len, user_data, cb));
return;
error:
diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c
index 966dfbb666..7dee1c1edb 100644
--- a/src/core/security/secure_endpoint.c
+++ b/src/core/security/secure_endpoint.c
@@ -72,7 +72,7 @@ static void
destroy (grpc_exec_ctx * exec_ctx, secure_endpoint * secure_ep)
{
secure_endpoint *ep = secure_ep;
- grpc_endpoint_destroy (ep->wrapped_ep, closure_list);
+ grpc_endpoint_destroy (exec_ctx, ep->wrapped_ep);
tsi_frame_protector_destroy (ep->protector);
gpr_slice_buffer_destroy (&ep->leftover_bytes);
gpr_slice_unref (ep->read_staging_buffer);
@@ -95,7 +95,7 @@ secure_endpoint_unref (secure_endpoint * ep, grpc_closure_list * closure_list, c
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, closure_list);
+ destroy (exec_ctx, ep);
}
}
@@ -113,7 +113,7 @@ secure_endpoint_unref (grpc_exec_ctx * exec_ctx, secure_endpoint * ep)
{
if (gpr_unref (&ep->ref))
{
- destroy (ep, closure_list);
+ destroy (exec_ctx, ep);
}
}
@@ -149,7 +149,7 @@ call_read_cb (grpc_exec_ctx * exec_ctx, secure_endpoint * ep, int success)
}
ep->read_buffer = NULL;
grpc_closure_list_add (closure_list, ep->read_cb, success);
- SECURE_ENDPOINT_UNREF (ep, "read", closure_list);
+ SECURE_ENDPOINT_UNREF (exec_ctx, ep, "read");
}
static void
@@ -165,7 +165,7 @@ on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success)
if (!success)
{
gpr_slice_buffer_reset_and_unref (ep->read_buffer);
- call_read_cb (ep, 0, closure_list);
+ call_read_cb (exec_ctx, ep, 0);
return;
}
@@ -226,11 +226,11 @@ on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success)
if (result != TSI_OK)
{
gpr_slice_buffer_reset_and_unref (ep->read_buffer);
- call_read_cb (ep, 0, closure_list);
+ call_read_cb (exec_ctx, ep, 0);
return;
}
- call_read_cb (ep, 1, closure_list);
+ call_read_cb (exec_ctx, ep, 1);
}
static void
@@ -246,11 +246,11 @@ endpoint_read (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, gpr_slice_bu
{
gpr_slice_buffer_swap (&ep->leftover_bytes, &ep->source_buffer);
GPR_ASSERT (ep->leftover_bytes.count == 0);
- on_read (ep, 1, closure_list);
+ on_read (exec_ctx, ep, 1);
return;
}
- grpc_endpoint_read (ep->wrapped_ep, &ep->source_buffer, &ep->on_read, closure_list);
+ grpc_endpoint_read (exec_ctx, ep->wrapped_ep, &ep->source_buffer, &ep->on_read);
}
static void
@@ -344,35 +344,35 @@ endpoint_write (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, gpr_slice_b
return;
}
- grpc_endpoint_write (ep->wrapped_ep, &ep->output_buffer, cb, closure_list);
+ grpc_endpoint_write (exec_ctx, ep->wrapped_ep, &ep->output_buffer, cb);
}
static void
endpoint_shutdown (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep)
{
secure_endpoint *ep = (secure_endpoint *) secure_ep;
- grpc_endpoint_shutdown (ep->wrapped_ep, closure_list);
+ grpc_endpoint_shutdown (exec_ctx, ep->wrapped_ep);
}
static void
endpoint_destroy (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep)
{
secure_endpoint *ep = (secure_endpoint *) secure_ep;
- SECURE_ENDPOINT_UNREF (ep, "destroy", closure_list);
+ SECURE_ENDPOINT_UNREF (exec_ctx, ep, "destroy");
}
static void
endpoint_add_to_pollset (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, grpc_pollset * pollset)
{
secure_endpoint *ep = (secure_endpoint *) secure_ep;
- grpc_endpoint_add_to_pollset (ep->wrapped_ep, pollset, closure_list);
+ grpc_endpoint_add_to_pollset (exec_ctx, ep->wrapped_ep, pollset);
}
static void
endpoint_add_to_pollset_set (grpc_exec_ctx * exec_ctx, grpc_endpoint * secure_ep, grpc_pollset_set * pollset_set)
{
secure_endpoint *ep = (secure_endpoint *) secure_ep;
- grpc_endpoint_add_to_pollset_set (ep->wrapped_ep, pollset_set, closure_list);
+ grpc_endpoint_add_to_pollset_set (exec_ctx, ep->wrapped_ep, pollset_set);
}
static char *
diff --git a/src/core/security/security_connector.c b/src/core/security/security_connector.c
index 91462c52cd..729de29d49 100644
--- a/src/core/security/security_connector.c
+++ b/src/core/security/security_connector.c
@@ -114,11 +114,11 @@ grpc_security_connector_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_co
{
if (sc == NULL || nonsecure_endpoint == NULL)
{
- cb (user_data, GRPC_SECURITY_ERROR, nonsecure_endpoint, NULL, closure_list);
+ cb (exec_ctx, user_data, GRPC_SECURITY_ERROR, nonsecure_endpoint, NULL);
}
else
{
- sc->vtable->do_handshake (sc, nonsecure_endpoint, cb, user_data, closure_list);
+ sc->vtable->do_handshake (exec_ctx, sc, nonsecure_endpoint, cb, user_data);
}
}
@@ -138,7 +138,7 @@ grpc_channel_security_connector_check_call_host (grpc_exec_ctx * exec_ctx, grpc_
{
if (sc == NULL || sc->check_call_host == NULL)
return GRPC_SECURITY_ERROR;
- return sc->check_call_host (sc, host, cb, user_data, closure_list);
+ return sc->check_call_host (exec_ctx, sc, host, cb, user_data);
}
#ifdef GRPC_SECURITY_CONNECTOR_REFCOUNT_DEBUG
@@ -303,7 +303,7 @@ fake_channel_check_call_host (grpc_exec_ctx * exec_ctx, grpc_channel_security_co
grpc_fake_channel_security_connector *c = (grpc_fake_channel_security_connector *) sc;
if (c->call_host_check_is_async)
{
- cb (user_data, GRPC_SECURITY_OK, closure_list);
+ cb (exec_ctx, user_data, GRPC_SECURITY_OK);
return GRPC_SECURITY_PENDING;
}
else
@@ -315,13 +315,13 @@ fake_channel_check_call_host (grpc_exec_ctx * exec_ctx, grpc_channel_security_co
static void
fake_channel_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data)
{
- grpc_do_security_handshake (tsi_create_fake_handshaker (1), sc, nonsecure_endpoint, cb, user_data, closure_list);
+ grpc_do_security_handshake (tsi_create_fake_handshaker (exec_ctx, 1), sc, nonsecure_endpoint, cb, user_data);
}
static void
fake_server_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data)
{
- grpc_do_security_handshake (tsi_create_fake_handshaker (0), sc, nonsecure_endpoint, cb, user_data, closure_list);
+ grpc_do_security_handshake (tsi_create_fake_handshaker (exec_ctx, 0), sc, nonsecure_endpoint, cb, user_data);
}
static grpc_security_connector_vtable fake_channel_vtable = {
@@ -432,11 +432,11 @@ ssl_channel_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc
&handshaker);
if (status != GRPC_SECURITY_OK)
{
- cb (user_data, status, nonsecure_endpoint, NULL, closure_list);
+ cb (exec_ctx, user_data, status, nonsecure_endpoint, NULL);
}
else
{
- grpc_do_security_handshake (handshaker, sc, nonsecure_endpoint, cb, user_data, closure_list);
+ grpc_do_security_handshake (exec_ctx, handshaker, sc, nonsecure_endpoint, cb, user_data);
}
}
@@ -448,11 +448,11 @@ ssl_server_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc,
grpc_security_status status = ssl_create_handshaker (c->handshaker_factory, 0, NULL, &handshaker);
if (status != GRPC_SECURITY_OK)
{
- cb (user_data, status, nonsecure_endpoint, NULL, closure_list);
+ cb (exec_ctx, user_data, status, nonsecure_endpoint, NULL);
}
else
{
- grpc_do_security_handshake (handshaker, sc, nonsecure_endpoint, cb, user_data, closure_list);
+ grpc_do_security_handshake (exec_ctx, handshaker, sc, nonsecure_endpoint, cb, user_data);
}
}
diff --git a/src/core/security/server_auth_filter.c b/src/core/security/server_auth_filter.c
index 86a5f9cb3e..77239e782e 100644
--- a/src/core/security/server_auth_filter.c
+++ b/src/core/security/server_auth_filter.c
@@ -175,7 +175,7 @@ auth_on_recv (grpc_exec_ctx * exec_ctx, void *user_data, int success)
return;
}
}
- calld->on_done_recv->cb (calld->on_done_recv->cb_arg, success, closure_list);
+ calld->on_done_recv->cb (exec_ctx, calld->on_done_recv->cb_arg, success);
}
static void
@@ -202,7 +202,7 @@ static void
auth_start_transport_op (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, grpc_transport_stream_op * op)
{
set_recv_ops_md_callbacks (elem, op);
- grpc_call_next_op (elem, op, closure_list);
+ grpc_call_next_op (exec_ctx, elem, op);
}
/* Constructor for call_data */
diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c
index b11cf1079a..5b67f51b7d 100644
--- a/src/core/security/server_secure_chttp2.c
+++ b/src/core/security/server_secure_chttp2.c
@@ -104,7 +104,7 @@ setup_transport (grpc_exec_ctx * exec_ctx, void *statep, grpc_transport * transp
args_to_add[0] = grpc_security_connector_to_arg (state->sc);
args_to_add[1] = grpc_auth_metadata_processor_to_arg (&state->creds->processor);
args_copy = grpc_channel_args_copy_and_add (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, args_copy, closure_list);
+ grpc_server_setup_transport (state->server, transport, extra_filters, GPR_ARRAY_SIZE (exec_ctx, extra_filters), mdctx, args_copy);
grpc_channel_args_destroy (args_copy);
}
@@ -146,15 +146,15 @@ on_secure_handshake_done (grpc_exec_ctx * exec_ctx, void *statep, grpc_security_
if (!state->is_shutdown)
{
mdctx = grpc_mdctx_create ();
- transport = grpc_create_chttp2_transport (grpc_server_get_channel_args (state->server), secure_endpoint, mdctx, 0, closure_list);
- setup_transport (state, transport, mdctx, closure_list);
- grpc_chttp2_transport_start_reading (transport, NULL, 0, closure_list);
+ transport = grpc_create_chttp2_transport (grpc_server_get_channel_args (exec_ctx, state->server), secure_endpoint, mdctx, 0);
+ setup_transport (exec_ctx, state, transport, mdctx);
+ grpc_chttp2_transport_start_reading (exec_ctx, transport, NULL, 0);
}
else
{
/* We need to consume this here, because the server may already have gone
* away. */
- grpc_endpoint_destroy (secure_endpoint, closure_list);
+ grpc_endpoint_destroy (exec_ctx, secure_endpoint);
}
gpr_mu_unlock (&state->mu);
}
@@ -180,7 +180,7 @@ on_accept (grpc_exec_ctx * exec_ctx, void *statep, grpc_endpoint * tcp)
node->next = state->handshaking_tcp_endpoints;
state->handshaking_tcp_endpoints = node;
gpr_mu_unlock (&state->mu);
- grpc_security_connector_do_handshake (state->sc, tcp, on_secure_handshake_done, state, closure_list);
+ grpc_security_connector_do_handshake (exec_ctx, state->sc, tcp, on_secure_handshake_done, state);
}
/* Server callback: start listening on our ports */
@@ -188,18 +188,18 @@ static void
start (grpc_exec_ctx * exec_ctx, grpc_server * server, void *statep, grpc_pollset ** pollsets, size_t pollset_count)
{
grpc_server_secure_state *state = statep;
- grpc_tcp_server_start (state->tcp, pollsets, pollset_count, on_accept, state, closure_list);
+ grpc_tcp_server_start (exec_ctx, state->tcp, pollsets, pollset_count, on_accept, state);
}
static void
destroy_done (grpc_exec_ctx * exec_ctx, void *statep, int success)
{
grpc_server_secure_state *state = statep;
- state->destroy_callback->cb (state->destroy_callback->cb_arg, success, closure_list);
+ state->destroy_callback->cb (exec_ctx, state->destroy_callback->cb_arg, success);
gpr_mu_lock (&state->mu);
while (state->handshaking_tcp_endpoints != NULL)
{
- grpc_endpoint_shutdown (state->handshaking_tcp_endpoints->tcp_endpoint, closure_list);
+ grpc_endpoint_shutdown (exec_ctx, state->handshaking_tcp_endpoints->tcp_endpoint);
remove_tcp_from_list_locked (state, state->handshaking_tcp_endpoints->tcp_endpoint);
}
gpr_mu_unlock (&state->mu);
@@ -219,7 +219,7 @@ destroy (grpc_exec_ctx * exec_ctx, grpc_server * server, void *statep, grpc_clos
tcp = state->tcp;
gpr_mu_unlock (&state->mu);
grpc_closure_init (&state->destroy_closure, destroy_done, state);
- grpc_tcp_server_destroy (tcp, &state->destroy_closure, closure_list);
+ grpc_tcp_server_destroy (exec_ctx, tcp, &state->destroy_closure);
}
int