aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-02-12 13:55:53 -0800
committerGravatar murgatroid99 <mlumish@google.com>2015-02-12 13:55:53 -0800
commita8c21e8ecfca35e112900e0fc76c55ff702ad9b5 (patch)
treece4154df7532b471bcffe99b30a7720f347d8e98 /src/core/surface
parente0da0f7c29ec3946a5ebb343ce671dc2dda53908 (diff)
Added useful behavior for empty batch
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/call.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index c0f5742c10..58a2436937 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -991,6 +991,12 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
const grpc_op *op;
grpc_ioreq *req;
+ if (nops == 0) {
+ grpc_cq_begin_op(call->cq, call, GRPC_OP_COMPLETE);
+ grpc_cq_end_op_complete(call->cq, tag, call, do_nothing, NULL, GRPC_OP_OK);
+ return GRPC_CALL_OK;
+ }
+
/* rewrite batch ops into ioreq ops */
for (in = 0, out = 0; in < nops; in++) {
op = &ops[in];