aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-08-19 09:59:48 -0700
committerGravatar Yang Gao <yangg@google.com>2015-08-19 09:59:48 -0700
commit4836492061381701f15c4a121f44e6377786a07d (patch)
tree1ef3a3ddc92503f236df00b894e67354e2287e89 /src/core
parent5068fa45a2d888f85ebc7ac0cf0a4ac722e54d98 (diff)
parentb815fb234f0be81b73fb678f7dee8eaeb8448bcd (diff)
Merge pull request #2972 from ctiller/get-reserved-things-right
Add some reserved checks that need to be present
Diffstat (limited to 'src/core')
-rw-r--r--src/core/surface/call.c4
-rw-r--r--src/core/surface/server.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index a6153b479d..33f277da46 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -1573,7 +1573,8 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
const grpc_op *op;
grpc_ioreq *req;
void (*finish_func)(grpc_call *, int, void *) = finish_batch;
- GPR_ASSERT(!reserved);
+
+ if (reserved != NULL) return GRPC_CALL_ERROR;
GRPC_CALL_LOG_BATCH(GPR_INFO, call, ops, nops, tag);
@@ -1588,6 +1589,7 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
/* rewrite batch ops into ioreq ops */
for (in = 0, out = 0; in < nops; in++) {
op = &ops[in];
+ if (op->reserved != NULL) return GRPC_CALL_ERROR;
switch (op->op) {
case GRPC_OP_SEND_INITIAL_METADATA:
/* Flag validation: currently allow no flags */
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index f399aa69f2..4990e6583a 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -1135,6 +1135,7 @@ grpc_call_error grpc_server_request_call(
return GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE;
}
grpc_cq_begin_op(cq_for_notification);
+ details->reserved = NULL;
rc->type = BATCH_CALL;
rc->server = server;
rc->tag = tag;