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

Method attach_client_session

src/proxy/http/HttpSM.cc:379–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void
380HttpSM::attach_client_session(ProxyTransaction *txn)
381{
382 ATS_PROBE1(milestone_ua_begin, sm_id);
383 milestones[TS_MILESTONE_UA_BEGIN] = ink_get_hrtime();
384 ink_assert(txn != nullptr);
385
386 NetVConnection *netvc = txn->get_netvc();
387 if (!netvc) {
388 return;
389 }
390 _ua.set_txn(txn, milestones);
391
392 // Collect log & stats information. We've already verified that the netvc is !nullptr above,
393 // and netvc == _ua.get_txn()->get_netvc().
394
395 is_internal = netvc->get_is_internal_request();
396 mptcp_state = netvc->get_mptcp_state();
397
398 ink_release_assert(_ua.get_txn()->get_half_close_flag() == false);
399 mutex = txn->mutex;
400 if (_ua.get_txn()->debug()) {
401 debug_on = true;
402 }
403
404 t_state.setup_per_txn_configs();
405 t_state.api_skip_all_remapping = netvc->get_is_unmanaged_request();
406
407 ink_assert(_ua.get_txn()->get_proxy_ssn());
408 ink_assert(_ua.get_txn()->get_proxy_ssn()->accept_options);
409
410 // default the upstream IP style host resolution order from inbound
411 t_state.my_txn_conf().host_res_data.order = _ua.get_txn()->get_proxy_ssn()->accept_options->host_res_preference;
412
413 start_sub_sm();
414
415 // Allocate a user agent entry in the state machine's
416 // vc table
417 _ua.set_entry(vc_table.new_entry());
418 _ua.get_entry()->vc = txn;
419 _ua.get_entry()->vc_type = HTTP_UA_VC;
420
421 ats_ip_copy(&t_state.client_info.src_addr, netvc->get_remote_addr());
422 ats_ip_copy(&t_state.client_info.dst_addr, netvc->get_local_addr());
423 ats_ip_copy(&t_state.effective_client_addr, netvc->get_effective_remote_addr());
424 t_state.client_info.is_transparent = netvc->get_is_transparent();
425 t_state.client_info.port_attribute = static_cast<HttpProxyPort::TransportType>(netvc->attributes);
426
427 // Record api hook set state
428 hooks_set = txn->has_hooks();
429
430 // Setup for parsing the header
431 _ua.get_entry()->vc_read_handler = &HttpSM::state_read_client_request_header;
432 t_state.hdr_info.client_request.destroy();
433 t_state.hdr_info.client_request.create(HTTP_TYPE_REQUEST);
434
435 // Prepare raw reader which will live until we are sure this is HTTP indeed
436 auto tts = netvc->get_service<TLSTunnelSupport>();

Callers 1

new_transactionMethod · 0.45

Calls 15

ink_get_hrtimeFunction · 0.85
ats_ip_copyFunction · 0.85
set_txnMethod · 0.80
get_mptcp_stateMethod · 0.80
get_txnMethod · 0.80
setup_per_txn_configsMethod · 0.80
get_proxy_ssnMethod · 0.80
set_entryMethod · 0.80
new_entryMethod · 0.80
get_entryMethod · 0.80

Tested by

no test coverage detected