diff options
author | 2015-10-09 17:07:56 -0700 | |
---|---|---|
committer | 2015-10-09 17:07:56 -0700 | |
commit | 2b15f1e25ae4aec6ef0de92b7e99e50188eb6438 (patch) | |
tree | 4dd4838255a12fd477a00f15062c8b7f8d034ebb /src/core/surface/call.c | |
parent | 8e30e25b14acf9e0fcd62eae96ad1c57280787f2 (diff) | |
parent | b733c74ffce5f6d58a69060c00f23cc6c13e506a (diff) |
Merge github.com:grpc/grpc into latent-see
Diffstat (limited to 'src/core/surface/call.c')
-rw-r--r-- | src/core/surface/call.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 9efcb90a56..b40e74d61b 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -436,8 +436,7 @@ static grpc_cq_completion *allocate_completion(grpc_call *call) { gpr_mu_unlock(&call->completion_mu); return &call->completions[i]; } - gpr_log(GPR_ERROR, "should never reach here"); - abort(); + GPR_UNREACHABLE_CODE(return NULL); return NULL; } @@ -531,9 +530,13 @@ static void set_compression_algorithm(grpc_call *call, call->compression_algorithm = algo; } -grpc_compression_algorithm grpc_call_get_compression_algorithm( - const grpc_call *call) { - return call->compression_algorithm; +grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm( + grpc_call *call) { + grpc_compression_algorithm algorithm; + gpr_mu_lock(&call->mu); + algorithm = call->compression_algorithm; + gpr_mu_unlock(&call->mu); + return algorithm; } static void set_encodings_accepted_by_peer( @@ -567,12 +570,20 @@ static void set_encodings_accepted_by_peer( } } -gpr_uint32 grpc_call_get_encodings_accepted_by_peer(grpc_call *call) { - return call->encodings_accepted_by_peer; +gpr_uint32 grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call *call) { + gpr_uint32 encodings_accepted_by_peer; + gpr_mu_lock(&call->mu); + encodings_accepted_by_peer = call->encodings_accepted_by_peer; + gpr_mu_unlock(&call->mu); + return encodings_accepted_by_peer; } -gpr_uint32 grpc_call_get_message_flags(const grpc_call *call) { - return call->incoming_message_flags; +gpr_uint32 grpc_call_test_only_get_message_flags(grpc_call *call) { + gpr_uint32 flags; + gpr_mu_lock(&call->mu); + flags = call->incoming_message_flags; + gpr_mu_unlock(&call->mu); + return flags; } static void set_status_details(grpc_call *call, status_source source, |