diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-08 17:09:02 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-02-08 17:09:02 -0800 |
commit | 2a11ad1529833d0faaa0d2b03f19fd0c06286991 (patch) | |
tree | 6d4bee6769496b7030ea96deabf2eb46da2a6be8 /src/core/lib/surface/call.c | |
parent | 89d33790d168740bad8fafdaf29577f8c28cb5c8 (diff) |
Fix allocation bug
Diffstat (limited to 'src/core/lib/surface/call.c')
-rw-r--r-- | src/core/lib/surface/call.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index c7631c7d32..77ee6b7753 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -989,7 +989,24 @@ static bool are_initial_metadata_flags_valid(uint32_t flags, bool is_client) { return !(flags & invalid_positions); } -static int batch_slot_for_op(grpc_op_type type) { return (int)type; } +static int batch_slot_for_op(grpc_op_type type) { + switch (type) { + case GRPC_OP_SEND_INITIAL_METADATA: + return 0; + case GRPC_OP_SEND_MESSAGE: + return 1; + case GRPC_OP_SEND_CLOSE_FROM_CLIENT: + case GRPC_OP_SEND_STATUS_FROM_SERVER: + return 2; + case GRPC_OP_RECV_INITIAL_METADATA: + return 3; + case GRPC_OP_RECV_MESSAGE: + return 4; + case GRPC_OP_RECV_CLOSE_ON_SERVER: + case GRPC_OP_RECV_STATUS_ON_CLIENT: + return 5; + } +} static batch_control *allocate_batch_control(grpc_call *call, const grpc_op *ops, |