diff options
author | 2015-02-05 09:33:30 -0800 | |
---|---|---|
committer | 2015-02-05 09:33:30 -0800 | |
commit | 119dcf0098e9ff0053024f116f3a89ac02cafd13 (patch) | |
tree | ac5cf19a45f780a574ca4410bf1bf75d61113814 /src/core/surface/call.c | |
parent | de64862323d8349fa252c787010df5e21dc52ffe (diff) | |
parent | b5ba155cf81cc89b5f17d2bb95ed37d94a669d38 (diff) |
Merge branch 'buffer' of github.com:ctiller/grpc into buffer
Diffstat (limited to 'src/core/surface/call.c')
-rw-r--r-- | src/core/surface/call.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 8b1507eaf9..feb3926281 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -497,7 +497,7 @@ static void finish_start_step(void *pc, grpc_op_error error) { static send_action choose_send_action(grpc_call *call) { switch (call->write_state) { case WRITE_STATE_INITIAL: - if (call->request_set[GRPC_IOREQ_SEND_INITIAL_METADATA] != REQSET_EMPTY) { + if (is_op_live(call, GRPC_IOREQ_SEND_INITIAL_METADATA)) { call->write_state = WRITE_STATE_STARTED; if (is_op_live(call, GRPC_IOREQ_SEND_MESSAGE) || is_op_live(call, GRPC_IOREQ_SEND_CLOSE)) { return SEND_BUFFERED_INITIAL_METADATA; @@ -507,14 +507,13 @@ static send_action choose_send_action(grpc_call *call) { } return SEND_NOTHING; case WRITE_STATE_STARTED: - if (call->request_set[GRPC_IOREQ_SEND_MESSAGE] != REQSET_EMPTY) { + if (is_op_live(call, GRPC_IOREQ_SEND_MESSAGE)) { if (is_op_live(call, GRPC_IOREQ_SEND_CLOSE)) { return SEND_BUFFERED_MESSAGE; } else { return SEND_MESSAGE; } - } - if (call->request_set[GRPC_IOREQ_SEND_CLOSE] != REQSET_EMPTY) { + } else if (is_op_live(call, GRPC_IOREQ_SEND_CLOSE)) { call->write_state = WRITE_STATE_WRITE_CLOSED; finish_ioreq_op(call, GRPC_IOREQ_SEND_TRAILING_METADATA, GRPC_OP_OK); finish_ioreq_op(call, GRPC_IOREQ_SEND_STATUS, GRPC_OP_OK); |