pull/12915/head
Craig Tiller 7 years ago
parent cc0354a4ae
commit e3b4d4a8d8
  1. 6
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  2. 1
      src/core/ext/transport/chttp2/transport/flow_control.cc
  3. 5
      src/core/ext/transport/chttp2/transport/flow_control.h
  4. 10
      src/core/ext/transport/chttp2/transport/frame_window_update.cc
  5. 4
      src/core/ext/transport/chttp2/transport/internal.h

@ -2501,8 +2501,8 @@ static void read_action_locked(grpc_exec_ctx *exec_ctx, void *tp,
GPR_TIMER_END("reading_action.parse", 0);
GPR_TIMER_BEGIN("post_parse_locked", 0);
if (t->flow_control.initial_window_update != 0) {
if (t->flow_control.initial_window_update > 0) {
if (t->initial_window_update != 0) {
if (t->initial_window_update > 0) {
grpc_chttp2_stream *s;
while (grpc_chttp2_list_pop_stalled_by_stream(t, &s)) {
grpc_chttp2_mark_stream_writable(exec_ctx, t, s);
@ -2511,7 +2511,7 @@ static void read_action_locked(grpc_exec_ctx *exec_ctx, void *tp,
GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING);
}
}
t->flow_control.initial_window_update = 0;
t->initial_window_update = 0;
}
GPR_TIMER_END("post_parse_locked", 0);
}

@ -222,6 +222,7 @@ grpc_error* StreamFlowControl::RecvData(int64_t incoming_frame_size) {
UpdateAnnouncedWindowDelta(tfc_, -incoming_frame_size);
local_window_delta_ -= incoming_frame_size;
tfc_->CommitRecvData(incoming_frame_size);
return GRPC_ERROR_NONE;
}
uint32_t StreamFlowControl::MaybeSendUpdate() {

@ -207,11 +207,6 @@ class TransportFlowControl {
const grpc_chttp2_transport* const t_;
/** initial window change. This is tracked as we parse settings frames from
* the remote peer. If there is a positive delta, then we will make all
* streams readable since they may have become unstalled */
int64_t initial_window_update_ = 0;
/** Our bookkeeping for the remote peer's available window */
int64_t remote_window_ = kDefaultWindow;

@ -96,8 +96,7 @@ grpc_error *grpc_chttp2_window_update_parser_parse(
if (t->incoming_stream_id != 0) {
if (s != NULL) {
grpc_chttp2_flowctl_recv_stream_update(
&t->flow_control, &s->flow_control, received_update);
s->flow_control->RecvUpdate(received_update);
if (grpc_chttp2_list_remove_stalled_by_stream(t, s)) {
grpc_chttp2_mark_stream_writable(exec_ctx, t, s);
grpc_chttp2_initiate_write(
@ -106,10 +105,9 @@ grpc_error *grpc_chttp2_window_update_parser_parse(
}
}
} else {
bool was_zero = t->flow_control.remote_window <= 0;
grpc_chttp2_flowctl_recv_transport_update(&t->flow_control,
received_update);
bool is_zero = t->flow_control.remote_window <= 0;
bool was_zero = t->flow_control->remote_window() <= 0;
t->flow_control->RecvUpdate(received_update);
bool is_zero = t->flow_control->remote_window() <= 0;
if (was_zero && !is_zero) {
grpc_chttp2_initiate_write(
exec_ctx, t,

@ -354,6 +354,10 @@ struct grpc_chttp2_transport {
grpc_core::ManualConstructor<grpc_core::chttp2::TransportFlowControl>
flow_control;
/** initial window change. This is tracked as we parse settings frames from
* the remote peer. If there is a positive delta, then we will make all
* streams readable since they may have become unstalled */
int64_t initial_window_update = 0;
/* deframing */
grpc_chttp2_deframe_transport_state deframe_state;

Loading…
Cancel
Save