Copilot commented on code in PR #12531:
URL: https://github.com/apache/trafficserver/pull/12531#discussion_r2389658876
##########
src/proxy/http2/Http2ConnectionState.cc:
##########
@@ -1368,14 +1368,18 @@ Http2ConnectionState::send_connection_preface()
configured_settings.set(HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS,
_adjust_concurrent_stream());
- uint32_t const configured_initial_window_size =
this->_get_configured_receive_session_window_size();
+ uint32_t configured_initial_window_size = 0;
if (this->_has_dynamic_stream_window()) {
- // Since this is the beginning of the connection and there are no streams
- // yet, we can just set the stream window size to fill the entire session
- // window size.
- configured_settings.set(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
configured_initial_window_size);
+ configured_initial_window_size =
this->_get_configured_receive_session_window_size();
+ } else {
+ configured_initial_window_size =
this->_get_configured_initial_window_size();
}
Review Comment:
[nitpick] The variable initialization to 0 is unnecessary since both
branches of the if-else statement assign a value. Consider declaring the
variable without initialization or using a ternary operator for better
readability.
##########
src/proxy/http2/Http2ConnectionState.cc:
##########
@@ -1368,14 +1368,18 @@ Http2ConnectionState::send_connection_preface()
configured_settings.set(HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS,
_adjust_concurrent_stream());
- uint32_t const configured_initial_window_size =
this->_get_configured_receive_session_window_size();
+ uint32_t configured_initial_window_size = 0;
if (this->_has_dynamic_stream_window()) {
- // Since this is the beginning of the connection and there are no streams
- // yet, we can just set the stream window size to fill the entire session
- // window size.
- configured_settings.set(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
configured_initial_window_size);
+ configured_initial_window_size =
this->_get_configured_receive_session_window_size();
+ } else {
+ configured_initial_window_size =
this->_get_configured_initial_window_size();
}
+ // Since this is the beginning of the connection and there are no streams
+ // yet, we can just set the stream window size to fill the entire session
+ // window size.
+ configured_settings.set(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
configured_initial_window_size);
Review Comment:
[nitpick] The variable initialization to 0 is unnecessary since both
branches of the if-else statement assign a value. Consider declaring the
variable without initialization or using a ternary operator for better
readability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]