Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions proxy/http2/Http2ConnectionState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ rcv_data_frame(Http2ConnectionState &cstate, const Http2Frame &frame)

Http2StreamDebug(cstate.session, id, "Received DATA frame");

// Update connection window size, before any stream specific handling
cstate.decrement_server_rwnd(payload_length);

if (cstate.get_zombie_event()) {
Warning("Data frame for zombied session %" PRId64, cstate.session->get_connection_id());
}
Expand Down Expand Up @@ -162,7 +165,8 @@ rcv_data_frame(Http2ConnectionState &cstate, const Http2Frame &frame)
}

// Check whether Window Size is acceptable
if (!cstate.server_rwnd_is_shrinking && cstate.server_rwnd() < payload_length) {
// compare to 0 because we already decreased the connection rwnd with payload_length
if (!cstate.server_rwnd_is_shrinking && cstate.server_rwnd() < 0) {
return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_FLOW_CONTROL_ERROR,
"recv data cstate.server_rwnd < payload_length");
}
Expand All @@ -171,8 +175,7 @@ rcv_data_frame(Http2ConnectionState &cstate, const Http2Frame &frame)
"recv data stream->server_rwnd < payload_length");
}

// Update Window size
cstate.decrement_server_rwnd(payload_length);
// Update stream window size
stream->decrement_server_rwnd(payload_length);

if (is_debug_tag_set("http2_con")) {
Expand Down