| 92 | } |
| 93 | |
| 94 | void |
| 95 | Http2ClientSession::new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOBufferReader *reader) |
| 96 | { |
| 97 | ink_assert(new_vc->mutex->thread_holding == this_ethread()); |
| 98 | Metrics::Gauge::increment(http2_rsb.current_client_session_count); |
| 99 | Metrics::Counter::increment(http2_rsb.total_client_connection_count); |
| 100 | this->_milestones.mark(Http2SsnMilestone::OPEN); |
| 101 | |
| 102 | // Unique client session identifier. |
| 103 | this->con_id = ProxySession::next_connection_id(); |
| 104 | this->_vc = new_vc; |
| 105 | _vc->set_inactivity_timeout(HRTIME_SECONDS(Http2::accept_no_activity_timeout)); |
| 106 | this->schedule_event = nullptr; |
| 107 | this->mutex = new_vc->mutex; |
| 108 | |
| 109 | this->connection_state.mutex = this->mutex; |
| 110 | |
| 111 | if (auto eds = new_vc->get_service<TLSEarlyDataSupport>(); eds) { |
| 112 | this->read_from_early_data = eds->get_early_data_len(); |
| 113 | Dbg(dbg_ctl_ssl_early_data, "read_from_early_data = %" PRId64, this->read_from_early_data); |
| 114 | } |
| 115 | |
| 116 | Http2SsnDebug("session born, netvc %p", this->_vc); |
| 117 | |
| 118 | this->_vc->set_tcp_congestion_control(NetVConnection::tcp_congestion_control_side::CLIENT_SIDE); |
| 119 | |
| 120 | this->read_buffer = iobuf ? iobuf : new_MIOBuffer(HTTP2_HEADER_BUFFER_SIZE_INDEX); |
| 121 | this->read_buffer->water_mark = connection_state.local_settings.get(HTTP2_SETTINGS_MAX_FRAME_SIZE); |
| 122 | this->_read_buffer_reader = reader ? reader : this->read_buffer->alloc_reader(); |
| 123 | |
| 124 | this->write_buffer = new_MIOBuffer(HTTP2_HEADER_BUFFER_SIZE_INDEX); |
| 125 | |
| 126 | uint32_t buffer_water_mark; |
| 127 | if (auto snis = this->_vc->get_service<TLSSNISupport>(); snis && snis->hints_from_sni.http2_buffer_water_mark.has_value()) { |
| 128 | buffer_water_mark = snis->hints_from_sni.http2_buffer_water_mark.value(); |
| 129 | } else { |
| 130 | buffer_water_mark = Http2::buffer_water_mark; |
| 131 | } |
| 132 | this->write_buffer->water_mark = buffer_water_mark; |
| 133 | |
| 134 | this->_write_buffer_reader = this->write_buffer->alloc_reader(); |
| 135 | this->_write_size_threshold = index_to_buffer_size(Http2::write_buffer_block_size_index) * Http2::write_size_threshold; |
| 136 | |
| 137 | this->_handle_if_ssl(new_vc); |
| 138 | |
| 139 | do_api_callout(TS_HTTP_SSN_START_HOOK); |
| 140 | } |
| 141 | |
| 142 | // XXX Currently, we don't have a half-closed state, but we will need to |
| 143 | // implement that. After we send a GOAWAY, there |
nothing calls this directly
no test coverage detected