diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-05-08 17:04:13 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-05-08 17:04:13 -0700 |
commit | f662aa4d6fa77aea771c1164c52d94c5266f0731 (patch) | |
tree | 691a5c65c7790d8406507b491c1c50d24bdd76fc /src/core/surface | |
parent | c4440d913ea5635d233139d862e1d49e5afbb2f1 (diff) | |
parent | fcdf33b39f2ccaa69a301810b321dc77b6bcb174 (diff) |
Merge github.com:grpc/grpc into bye-bye-completion-queue-pie
Diffstat (limited to 'src/core/surface')
-rw-r--r-- | src/core/surface/call.c | 12 | ||||
-rw-r--r-- | src/core/surface/call.h | 8 |
2 files changed, 9 insertions, 11 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 647c0ab63c..50df36cae9 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -374,18 +374,10 @@ void grpc_call_internal_unref(grpc_call *c, int allow_immediate_deletion) { static void set_status_code(grpc_call *call, status_source source, gpr_uint32 status) { - int flush; - call->status[source].is_set = 1; call->status[source].code = status; - if (call->is_client) { - flush = status == GRPC_STATUS_CANCELLED; - } else { - flush = status != GRPC_STATUS_OK; - } - - if (flush && !grpc_bbq_empty(&call->incoming_queue)) { + if (status != GRPC_STATUS_OK && !grpc_bbq_empty(&call->incoming_queue)) { grpc_bbq_flush(&call->incoming_queue); } } @@ -1307,3 +1299,5 @@ void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *value void *grpc_call_context_get(grpc_call *call, grpc_context_index elem) { return call->context[elem]; } + +gpr_uint8 grpc_call_is_client(grpc_call *call) { return call->is_client; } diff --git a/src/core/surface/call.h b/src/core/surface/call.h index 7d3e661bf3..60222bf389 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -97,12 +97,14 @@ grpc_completion_queue *grpc_call_get_completion_queue(grpc_call *call); void grpc_call_internal_ref(grpc_call *call, const char *reason); void grpc_call_internal_unref(grpc_call *call, const char *reason, int allow_immediate_deletion); #define GRPC_CALL_INTERNAL_REF(call, reason) grpc_call_internal_ref(call, reason) -#define GRPC_CALL_INTERNAL_UNREF(call, reason, allow_immediate_deletion) grpc_call_internal_unref(call, reason, allow_immediate_deletion) +#define GRPC_CALL_INTERNAL_UNREF(call, reason, allow_immediate_deletion) \ + grpc_call_internal_unref(call, reason, allow_immediate_deletion) #else void grpc_call_internal_ref(grpc_call *call); void grpc_call_internal_unref(grpc_call *call, int allow_immediate_deletion); #define GRPC_CALL_INTERNAL_REF(call, reason) grpc_call_internal_ref(call) -#define GRPC_CALL_INTERNAL_UNREF(call, reason, allow_immediate_deletion) grpc_call_internal_unref(call, allow_immediate_deletion) +#define GRPC_CALL_INTERNAL_UNREF(call, reason, allow_immediate_deletion) \ + grpc_call_internal_unref(call, allow_immediate_deletion) #endif grpc_call_error grpc_call_start_ioreq_and_call_back( @@ -130,4 +132,6 @@ void *grpc_call_context_get(grpc_call *call, grpc_context_index elem); #define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \ if (grpc_trace_batch) grpc_call_log_batch(sev, call, ops, nops, tag) +gpr_uint8 grpc_call_is_client(grpc_call *call); + #endif /* GRPC_INTERNAL_CORE_SURFACE_CALL_H */ |