MCPcopy Create free account
hub / github.com/apache/trafficserver / send_connection_preface

Method send_connection_preface

src/proxy/http2/Http2ConnectionState.cc:1355–1386  ·  view source on GitHub ↗

Send connection preface The client connection preface is HTTP2_CONNECTION_PREFACE. The server connection preface consists of a potentially empty SETTINGS frame. Details in [RFC 7540] 3.5. HTTP/2 Connection Preface TODO: send client connection preface if the connection is outbound */

Source from the content-addressed store, hash-verified

1353 TODO: send client connection preface if the connection is outbound
1354 */
1355void
1356Http2ConnectionState::send_connection_preface()
1357{
1358 REMEMBER(NO_EVENT, this->recursion)
1359
1360 Http2ConnectionSettings configured_settings;
1361 configured_settings.settings_from_configs(session->is_outbound());
1362
1363 // We do not have PUSH_PROMISE implemented, so we communicate to the peer
1364 // that they should not send such frames to us. RFC 9113 6.5.2 says that
1365 // servers can send this too, but they must always set a value of 0. Thus we
1366 // send a value of 0 for both inbound and outbound connections.
1367 configured_settings.set(HTTP2_SETTINGS_ENABLE_PUSH, 0);
1368
1369 configured_settings.set(HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, _adjust_concurrent_stream());
1370
1371 uint32_t const configured_initial_window_size = this->_get_configured_receive_session_window_size();
1372 if (configured_initial_window_size > HTTP2_INITIAL_WINDOW_SIZE) {
1373 configured_settings.set(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE, configured_initial_window_size);
1374 }
1375
1376 send_settings_frame(configured_settings);
1377
1378 // If the session window size is non-default, send a WINDOW_UPDATE right
1379 // away. Note that there is no session window size setting in HTTP/2. The
1380 // session window size is controlled entirely by WINDOW_UPDATE frames.
1381 if (configured_initial_window_size > HTTP2_INITIAL_WINDOW_SIZE) {
1382 auto const diff = configured_initial_window_size - HTTP2_INITIAL_WINDOW_SIZE;
1383 Http2ConDebug(session, "Updating the session window with a WINDOW_UPDATE frame: %u", diff);
1384 send_window_update_frame(HTTP2_CONNECTION_CONTROL_STREAM, diff);
1385 }
1386}
1387
1388void
1389Http2ConnectionState::destroy()

Callers 2

startMethod · 0.80
startMethod · 0.80

Calls 4

settings_from_configsMethod · 0.80
is_outboundMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected