aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface/call.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-05 21:41:23 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-05 21:41:23 -0800
commit8b976d0c244e516c2195c699bf396cf1dac2baa5 (patch)
treef6e3a69f2fb200cb3d036844cf691eebbd7eb36f /src/core/surface/call.c
parentc230a7451dbfc0627bdd3173118a91b075856619 (diff)
Fixes
Diffstat (limited to 'src/core/surface/call.c')
-rw-r--r--src/core/surface/call.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index bcb7c87733..b3f272e068 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -295,10 +295,19 @@ 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 (status != GRPC_OP_OK) {
+ if (call->is_client) {
+ flush = status == GRPC_STATUS_CANCELLED;
+ } else {
+ flush = status != GRPC_STATUS_OK;
+ }
+
+ if (flush && !grpc_bbq_empty(&call->incoming_queue)) {
+ gpr_log(GPR_ERROR, "Flushing unread messages due to error status %d", status);
grpc_bbq_flush(&call->incoming_queue);
}
}