Fix sanity: core_banned_functions

reviewable/pr8842/r4
Craig Tiller 8 years ago
parent aa16d3f47d
commit 3e8deb188f
  1. 2
      src/core/ext/transport/chttp2/transport/hpack_encoder.c
  2. 5
      src/core/lib/channel/http_server_filter.c
  3. 4
      src/core/lib/security/credentials/plugin/plugin_credentials.c
  4. 2
      src/core/lib/slice/slice_hash_table.c
  5. 4
      src/core/lib/surface/call_details.c
  6. 8
      src/core/lib/surface/channel.c
  7. 4
      src/core/lib/surface/server.c
  8. 6
      src/core/lib/transport/metadata_batch.c

@ -296,7 +296,7 @@ static grpc_slice get_wire_value(grpc_mdelem elem, uint8_t *huffman_prefix) {
} }
/* TODO(ctiller): opportunistically compress non-binary headers */ /* TODO(ctiller): opportunistically compress non-binary headers */
*huffman_prefix = 0x00; *huffman_prefix = 0x00;
return grpc_slice_ref(GRPC_MDVALUE(elem)); return grpc_slice_ref_internal(GRPC_MDVALUE(elem));
} }
static void emit_lithdr_incidx(grpc_chttp2_hpack_compressor *c, static void emit_lithdr_incidx(grpc_chttp2_hpack_compressor *c,

@ -199,12 +199,13 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
} }
if (b->idx.named.host != NULL) { if (b->idx.named.host != NULL) {
add_error(error_name, &error, add_error(
error_name, &error,
grpc_metadata_batch_substitute( grpc_metadata_batch_substitute(
exec_ctx, b, b->idx.named.host, exec_ctx, b, b->idx.named.host,
grpc_mdelem_from_slices( grpc_mdelem_from_slices(
exec_ctx, GRPC_MDSTR_AUTHORITY, exec_ctx, GRPC_MDSTR_AUTHORITY,
grpc_slice_ref(GRPC_MDVALUE(b->idx.named.host->md))))); grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.host->md)))));
} }
if (b->idx.named.authority == NULL) { if (b->idx.named.authority == NULL) {

@ -97,8 +97,8 @@ static void plugin_md_request_metadata_ready(void *request,
} else if (num_md > 0) { } else if (num_md > 0) {
md_array = gpr_malloc(num_md * sizeof(grpc_credentials_md)); md_array = gpr_malloc(num_md * sizeof(grpc_credentials_md));
for (i = 0; i < num_md; i++) { for (i = 0; i < num_md; i++) {
md_array[i].key = grpc_slice_ref(md[i].key); md_array[i].key = grpc_slice_ref_internal(md[i].key);
md_array[i].value = grpc_slice_ref(md[i].value); md_array[i].value = grpc_slice_ref_internal(md[i].value);
} }
r->cb(&exec_ctx, r->user_data, md_array, num_md, GRPC_CREDENTIALS_OK, r->cb(&exec_ctx, r->user_data, md_array, num_md, GRPC_CREDENTIALS_OK,
NULL); NULL);

@ -75,7 +75,7 @@ static void grpc_slice_hash_table_add(
grpc_slice_hash_table_find_index(table, key, true /* find_empty */); grpc_slice_hash_table_find_index(table, key, true /* find_empty */);
GPR_ASSERT(idx != table->size); // Table should never be full. GPR_ASSERT(idx != table->size); // Table should never be full.
grpc_slice_hash_table_entry* entry = &table->entries[idx]; grpc_slice_hash_table_entry* entry = &table->entries[idx];
entry->key = grpc_slice_ref(key); entry->key = grpc_slice_ref_internal(key);
entry->value = vtable->copy_value(value); entry->value = vtable->copy_value(value);
entry->vtable = vtable; entry->vtable = vtable;
} }

@ -47,6 +47,6 @@ void grpc_call_details_init(grpc_call_details* cd) {
void grpc_call_details_destroy(grpc_call_details* cd) { void grpc_call_details_destroy(grpc_call_details* cd) {
GRPC_API_TRACE("grpc_call_details_destroy(cd=%p)", 1, (cd)); GRPC_API_TRACE("grpc_call_details_destroy(cd=%p)", 1, (cd));
grpc_slice_unref(cd->method); grpc_slice_unref_internal(exec_ctx, cd->method);
grpc_slice_unref(cd->host); grpc_slice_unref_internal(exec_ctx, cd->host);
} }

@ -234,9 +234,9 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel,
grpc_call *call = grpc_channel_create_call_internal( grpc_call *call = grpc_channel_create_call_internal(
&exec_ctx, channel, parent_call, propagation_mask, cq, NULL, &exec_ctx, channel, parent_call, propagation_mask, cq, NULL,
grpc_mdelem_from_slices(&exec_ctx, GRPC_MDSTR_PATH, grpc_mdelem_from_slices(&exec_ctx, GRPC_MDSTR_PATH,
grpc_slice_ref(method)), grpc_slice_ref_internal(method)),
host != NULL ? grpc_mdelem_from_slices(&exec_ctx, GRPC_MDSTR_AUTHORITY, host != NULL ? grpc_mdelem_from_slices(&exec_ctx, GRPC_MDSTR_AUTHORITY,
grpc_slice_ref(*host)) grpc_slice_ref_internal(*host))
: GRPC_MDNULL, : GRPC_MDNULL,
deadline); deadline);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
@ -251,9 +251,9 @@ grpc_call *grpc_channel_create_pollset_set_call(
return grpc_channel_create_call_internal( return grpc_channel_create_call_internal(
exec_ctx, channel, parent_call, propagation_mask, NULL, pollset_set, exec_ctx, channel, parent_call, propagation_mask, NULL, pollset_set,
grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_PATH, grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_PATH,
grpc_slice_ref(method)), grpc_slice_ref_internal(method)),
host != NULL ? grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_AUTHORITY, host != NULL ? grpc_mdelem_from_slices(exec_ctx, GRPC_MDSTR_AUTHORITY,
grpc_slice_ref(*host)) grpc_slice_ref_internal(*host))
: GRPC_MDNULL, : GRPC_MDNULL,
deadline); deadline);
} }

@ -748,9 +748,9 @@ static void server_on_recv_initial_metadata(grpc_exec_ctx *exec_ctx, void *ptr,
if (error == GRPC_ERROR_NONE) { if (error == GRPC_ERROR_NONE) {
GPR_ASSERT(calld->recv_initial_metadata->idx.named.path != NULL); GPR_ASSERT(calld->recv_initial_metadata->idx.named.path != NULL);
GPR_ASSERT(calld->recv_initial_metadata->idx.named.authority != NULL); GPR_ASSERT(calld->recv_initial_metadata->idx.named.authority != NULL);
calld->path = grpc_slice_ref( calld->path = grpc_slice_ref_internal(
GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.path->md)); GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.path->md));
calld->host = grpc_slice_ref( calld->host = grpc_slice_ref_internal(
GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.authority->md)); GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.authority->md));
calld->path_set = true; calld->path_set = true;
calld->host_set = true; calld->host_set = true;

@ -74,7 +74,7 @@ static void assert_valid_callouts(grpc_metadata_batch *batch) {
if (callout_idx != GRPC_BATCH_CALLOUTS_COUNT) { if (callout_idx != GRPC_BATCH_CALLOUTS_COUNT) {
GPR_ASSERT(batch->idx.array[callout_idx] == l); GPR_ASSERT(batch->idx.array[callout_idx] == l);
} }
grpc_slice_unref(key_interned); grpc_slice_unref_internal(exec_ctx, key_interned);
} }
#endif #endif
} }
@ -242,8 +242,8 @@ void grpc_metadata_batch_set_value(grpc_exec_ctx *exec_ctx,
grpc_linked_mdelem *storage, grpc_linked_mdelem *storage,
grpc_slice value) { grpc_slice value) {
grpc_mdelem old = storage->md; grpc_mdelem old = storage->md;
grpc_mdelem new = grpc_mdelem new = grpc_mdelem_from_slices(
grpc_mdelem_from_slices(exec_ctx, grpc_slice_ref(GRPC_MDKEY(old)), value); exec_ctx, grpc_slice_ref_internal(GRPC_MDKEY(old)), value);
storage->md = new; storage->md = new;
GRPC_MDELEM_UNREF(exec_ctx, old); GRPC_MDELEM_UNREF(exec_ctx, old);
} }

Loading…
Cancel
Save