diff options
author | Craig Tiller <ctiller@google.com> | 2017-01-27 14:26:32 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-01-27 14:26:32 -0800 |
commit | adc003a4809ac5f3fe9c83291167320a43935c81 (patch) | |
tree | 050127236a2c6b1bc0179d83384174ee60a72ae8 | |
parent | 95ccbc2d6f7762ed27fb28d29355b60e2e7eb538 (diff) |
Fix validation, stream window update edge triggering
-rw-r--r-- | src/core/ext/transport/chttp2/transport/parsing.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index a5eda66e0d..71161f77a0 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -385,25 +385,28 @@ static grpc_error *update_incoming_window(grpc_exec_ctx *exec_ctx, grpc_chttp2_initiate_write(exec_ctx, t, false, "flow_control"); } - if (s != NULL) { - if (incoming_frame_size > - s->incoming_window_delta + - t->settings[GRPC_ACKED_SETTINGS] - [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]) { - char *msg; - gpr_asprintf(&msg, - "frame of size %d overflows incoming window of %" PRId64, - t->incoming_frame_size, - s->incoming_window_delta + - t->settings[GRPC_ACKED_SETTINGS] - [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]); - grpc_error *err = GRPC_ERROR_CREATE(msg); - gpr_free(msg); - return err; - } + if (incoming_frame_size > + s->incoming_window_delta + + t->settings[GRPC_ACKED_SETTINGS] + [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]) { + char *msg; + gpr_asprintf(&msg, "frame of size %d overflows incoming window of %" PRId64, + t->incoming_frame_size, + s->incoming_window_delta + + t->settings[GRPC_ACKED_SETTINGS] + [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]); + grpc_error *err = GRPC_ERROR_CREATE(msg); + gpr_free(msg); + return err; + } + if (s != NULL) { GRPC_CHTTP2_FLOW_DEBIT_STREAM("parse", t, s, incoming_window_delta, 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; } |