aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-09-03 16:43:34 -0700
committerGravatar Yang Gao <yangg@google.com>2015-09-03 16:43:34 -0700
commit2b5255e3dafb970c2ad6b9a8382d2a7d8165a9e6 (patch)
treeb3da9bff35bf0c26304b459544bf7326a8a45e4f /src/core/surface
parent51bfda063a903c15429cede9ab9dab4c355b7c9a (diff)
parent93ddc61c1084e2c312edf00ac7c7cf6d5f8d8aa3 (diff)
Merge pull request #3190 from ctiller/daisy-dukes
Fix flow control issues
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/call.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 4426bbbce9..a8b4d65fbc 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -630,9 +630,6 @@ static void unlock(grpc_call *call) {
call->cancel_alarm = 0;
if (!call->receiving && need_more_data(call)) {
- op.recv_ops = &call->recv_ops;
- op.recv_state = &call->recv_state;
- op.on_done_recv = &call->on_done_recv;
if (grpc_bbq_empty(&call->incoming_queue) && call->reading_message) {
op.max_recv_bytes = call->incoming_message_length -
call->incoming_message.length + MAX_RECV_PEEK_AHEAD;
@@ -644,9 +641,16 @@ static void unlock(grpc_call *call) {
op.max_recv_bytes = MAX_RECV_PEEK_AHEAD - buffered_bytes;
}
}
- call->receiving = 1;
- GRPC_CALL_INTERNAL_REF(call, "receiving");
- start_op = 1;
+ /* TODO(ctiller): 1024 is basically to cover a bug
+ I don't understand yet */
+ if (op.max_recv_bytes > 1024) {
+ op.recv_ops = &call->recv_ops;
+ op.recv_state = &call->recv_state;
+ op.on_done_recv = &call->on_done_recv;
+ call->receiving = 1;
+ GRPC_CALL_INTERNAL_REF(call, "receiving");
+ start_op = 1;
+ }
}
if (!call->sending) {