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

Method send_settings_frame

src/proxy/http2/Http2ConnectionState.cc:2660–2690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2658}
2659
2660void
2661Http2ConnectionState::send_settings_frame(const Http2ConnectionSettings &new_settings)
2662{
2663 constexpr Http2StreamId stream_id = HTTP2_CONNECTION_CONTROL_STREAM;
2664
2665 Http2StreamDebug(session, stream_id, "Send SETTINGS frame");
2666
2667 Http2SettingsParameter params[HTTP2_SETTINGS_MAX];
2668 size_t params_size = 0;
2669
2670 for (int i = HTTP2_SETTINGS_HEADER_TABLE_SIZE; i < HTTP2_SETTINGS_MAX; ++i) {
2671 Http2SettingsIdentifier id = static_cast<Http2SettingsIdentifier>(i);
2672 unsigned const old_value = local_settings.get(id);
2673 unsigned const new_value = new_settings.get(id);
2674
2675 // Send only difference
2676 if (new_value != old_value) {
2677 Http2StreamDebug(session, stream_id, " %s : %u -> %u", Http2DebugNames::get_settings_param_name(id), old_value, new_value);
2678
2679 params[params_size++] = {static_cast<uint16_t>(id), new_value};
2680
2681 // Update current settings
2682 local_settings.set(id, new_settings.get(id));
2683 }
2684 }
2685
2686 Http2SettingsFrame settings(stream_id, HTTP2_FRAME_NO_FLAG, params, params_size);
2687
2688 this->_outstanding_settings_frames.emplace(new_settings);
2689 this->session->xmit(settings, true);
2690}
2691
2692void
2693Http2ConnectionState::_process_incoming_settings_ack_frame()

Callers

nothing calls this directly

Calls 4

emplaceMethod · 0.80
xmitMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected