diff options
author | 2015-02-04 12:47:58 -0800 | |
---|---|---|
committer | 2015-02-04 12:47:58 -0800 | |
commit | dcde31fad75d4daf7f103fcff5992843a8d7dce8 (patch) | |
tree | d445388d7bdba5030ae3f98edca2ca9f2e1e9ce0 /src/core/surface/call.c | |
parent | d77c92bd98d6622d346bb8d97f2d259624393247 (diff) |
Fix check for whether we should write to prevent infinite loop
Diffstat (limited to 'src/core/surface/call.c')
-rw-r--r-- | src/core/surface/call.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index b9a2aa5434..e0bfec0018 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -515,16 +515,16 @@ 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; return SEND_INITIAL_METADATA; } 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)) { return SEND_MESSAGE; } - if (call->request_set[GRPC_IOREQ_SEND_CLOSE] != REQSET_EMPTY) { + 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); |