|
|
|
@ -97,19 +97,19 @@ grpc_channel *grpc_channel_create_from_filters( |
|
|
|
|
/* decremented by grpc_channel_destroy */ |
|
|
|
|
gpr_ref_init(&channel->refs, 1); |
|
|
|
|
channel->metadata_context = mdctx; |
|
|
|
|
channel->grpc_status_string = grpc_mdstr_from_string(mdctx, "grpc-status"); |
|
|
|
|
channel->grpc_status_string = grpc_mdstr_from_string(mdctx, "grpc-status", 0); |
|
|
|
|
channel->grpc_compression_algorithm_string = |
|
|
|
|
grpc_mdstr_from_string(mdctx, "grpc-encoding"); |
|
|
|
|
channel->grpc_message_string = grpc_mdstr_from_string(mdctx, "grpc-message"); |
|
|
|
|
grpc_mdstr_from_string(mdctx, "grpc-encoding", 0); |
|
|
|
|
channel->grpc_message_string = grpc_mdstr_from_string(mdctx, "grpc-message", 0); |
|
|
|
|
for (i = 0; i < NUM_CACHED_STATUS_ELEMS; i++) { |
|
|
|
|
char buf[GPR_LTOA_MIN_BUFSIZE]; |
|
|
|
|
gpr_ltoa(i, buf); |
|
|
|
|
channel->grpc_status_elem[i] = grpc_mdelem_from_metadata_strings( |
|
|
|
|
mdctx, GRPC_MDSTR_REF(channel->grpc_status_string), |
|
|
|
|
grpc_mdstr_from_string(mdctx, buf)); |
|
|
|
|
grpc_mdstr_from_string(mdctx, buf, 0)); |
|
|
|
|
} |
|
|
|
|
channel->path_string = grpc_mdstr_from_string(mdctx, ":path"); |
|
|
|
|
channel->authority_string = grpc_mdstr_from_string(mdctx, ":authority"); |
|
|
|
|
channel->path_string = grpc_mdstr_from_string(mdctx, ":path", 0); |
|
|
|
|
channel->authority_string = grpc_mdstr_from_string(mdctx, ":authority", 0); |
|
|
|
|
gpr_mu_init(&channel->registered_call_mu); |
|
|
|
|
channel->registered_calls = NULL; |
|
|
|
|
|
|
|
|
@ -159,10 +159,10 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel, |
|
|
|
|
channel, cq, |
|
|
|
|
grpc_mdelem_from_metadata_strings( |
|
|
|
|
channel->metadata_context, GRPC_MDSTR_REF(channel->path_string), |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, method)), |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, method, 0)), |
|
|
|
|
grpc_mdelem_from_metadata_strings( |
|
|
|
|
channel->metadata_context, GRPC_MDSTR_REF(channel->authority_string), |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, host)), |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, host, 0)), |
|
|
|
|
deadline); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -171,10 +171,10 @@ void *grpc_channel_register_call(grpc_channel *channel, const char *method, |
|
|
|
|
registered_call *rc = gpr_malloc(sizeof(registered_call)); |
|
|
|
|
rc->path = grpc_mdelem_from_metadata_strings( |
|
|
|
|
channel->metadata_context, GRPC_MDSTR_REF(channel->path_string), |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, method)); |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, method, 0)); |
|
|
|
|
rc->authority = grpc_mdelem_from_metadata_strings( |
|
|
|
|
channel->metadata_context, GRPC_MDSTR_REF(channel->authority_string), |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, host)); |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, host, 0)); |
|
|
|
|
gpr_mu_lock(&channel->registered_call_mu); |
|
|
|
|
rc->next = channel->registered_calls; |
|
|
|
|
channel->registered_calls = rc; |
|
|
|
@ -275,7 +275,7 @@ grpc_mdelem *grpc_channel_get_reffed_status_elem(grpc_channel *channel, int i) { |
|
|
|
|
gpr_ltoa(i, tmp); |
|
|
|
|
return grpc_mdelem_from_metadata_strings( |
|
|
|
|
channel->metadata_context, GRPC_MDSTR_REF(channel->grpc_status_string), |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, tmp)); |
|
|
|
|
grpc_mdstr_from_string(channel->metadata_context, tmp, 0)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|