Fix validation, stream window update edge triggering

pull/9511/head
Craig Tiller 8 years ago
parent 95ccbc2d6f
commit adc003a480
  1. 9
      src/core/ext/transport/chttp2/transport/parsing.c

@ -385,14 +385,12 @@ static grpc_error *update_incoming_window(grpc_exec_ctx *exec_ctx,
grpc_chttp2_initiate_write(exec_ctx, t, false, "flow_control"); grpc_chttp2_initiate_write(exec_ctx, t, false, "flow_control");
} }
if (s != NULL) {
if (incoming_frame_size > if (incoming_frame_size >
s->incoming_window_delta + s->incoming_window_delta +
t->settings[GRPC_ACKED_SETTINGS] t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]) { [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]) {
char *msg; char *msg;
gpr_asprintf(&msg, gpr_asprintf(&msg, "frame of size %d overflows incoming window of %" PRId64,
"frame of size %d overflows incoming window of %" PRId64,
t->incoming_frame_size, t->incoming_frame_size,
s->incoming_window_delta + s->incoming_window_delta +
t->settings[GRPC_ACKED_SETTINGS] t->settings[GRPC_ACKED_SETTINGS]
@ -402,8 +400,13 @@ static grpc_error *update_incoming_window(grpc_exec_ctx *exec_ctx,
return err; return err;
} }
if (s != NULL) {
GRPC_CHTTP2_FLOW_DEBIT_STREAM("parse", t, s, incoming_window_delta, GRPC_CHTTP2_FLOW_DEBIT_STREAM("parse", t, s, incoming_window_delta,
incoming_frame_size); incoming_frame_size);
if (s->incoming_window_delta < -target_incoming_window / 2) {
grpc_chttp2_become_writable(exec_ctx, t, s, false,
"window-update-required");
}
s->received_bytes += incoming_frame_size; s->received_bytes += incoming_frame_size;
} }

Loading…
Cancel
Save