Dont request more data until the first message is received

pull/357/head
Craig Tiller 10 years ago
parent f5c914694d
commit e6b92e62f1
  1. 4
      src/core/surface/call.c

@ -118,6 +118,7 @@ struct grpc_call {
gpr_uint8 got_status_code;
gpr_uint8 sending;
gpr_uint8 num_completed_requests;
gpr_uint8 got_any_data;
gpr_uint8 need_more_data;
reqinfo requests[GRPC_IOREQ_OP_COUNT];
@ -575,7 +576,7 @@ static grpc_call_error start_ioreq(grpc_call *call, const grpc_ioreq *reqs,
call->buffered_messages);
finish_ioreq_op(call, GRPC_IOREQ_RECV_MESSAGES, GRPC_OP_OK);
} else {
call->need_more_data = 1;
call->need_more_data = call->got_any_data;
}
if (call->stream_closed) {
finish_ioreq_op(call, GRPC_IOREQ_RECV_STATUS, GRPC_OP_OK);
@ -1053,6 +1054,7 @@ void grpc_call_recv_message(grpc_call_element *elem,
grpc_call *call = CALL_FROM_TOP_ELEM(elem);
grpc_byte_buffer_array *dest;
lock(call);
call->got_any_data = 1;
if (call->requests[GRPC_IOREQ_RECV_MESSAGES].master != NULL) {
dest = call->requests[GRPC_IOREQ_RECV_MESSAGES].data.recv_messages;
} else {

Loading…
Cancel
Save