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

Method init

src/proxy/http/HttpSM.cc:282–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void
283HttpSM::init(bool from_early_data)
284{
285 milestones[TS_MILESTONE_SM_START] = ink_get_hrtime();
286
287 _from_early_data = from_early_data;
288
289 magic = HTTP_SM_MAGIC_ALIVE;
290
291 server_txn = nullptr;
292
293 // Unique state machine identifier
294 sm_id = next_sm_id++;
295 ATS_PROBE1(milestone_sm_start, sm_id);
296 t_state.state_machine = this;
297
298 t_state.http_config_param = HttpConfig::acquire();
299 // Acquire a lease on the global remap / rewrite table (stupid global name ...)
300 m_remap = rewrite_table->acquire();
301
302 // Simply point to the global config for the time being, no need to copy this
303 // entire struct if nothing is going to change it.
304 t_state.txn_conf = &t_state.http_config_param->oride;
305
306 t_state.init();
307 http_parser_init(&http_parser);
308
309 // Added to skip dns if the document is in cache. DNS will be forced if there is a ip based ACL in
310 // cache control or parent.config or if the doc_in_cache_skip_dns is disabled or if http caching is disabled
311 // TODO: This probably doesn't honor this as a per-transaction overridable config.
312 t_state.force_dns = (ip_rule_in_CacheControlTable() || t_state.parent_params->parent_table->ipMatch ||
313 !(t_state.txn_conf->doc_in_cache_skip_dns) || !(t_state.txn_conf->cache_http));
314
315 SET_HANDLER(&HttpSM::main_handler);
316
317 // Remember where this SM is running so it gets returned correctly
318 this->setThreadAffinity(this_ethread());
319
320#ifdef USE_HTTP_DEBUG_LISTS
321 ink_mutex_acquire(&debug_sm_list_mutex);
322 debug_sm_list.push(this);
323 ink_mutex_release(&debug_sm_list_mutex);
324#endif
325}
326
327void
328HttpSM::set_ua_half_close_flag()

Callers 6

start_sub_smMethod · 0.45
wait_for_full_bodyMethod · 0.45
init_smFunction · 0.45
prep_HttpProxyServerFunction · 0.45

Calls 11

ink_get_hrtimeFunction · 0.85
acquireFunction · 0.85
http_parser_initFunction · 0.85
this_ethreadFunction · 0.85
ink_mutex_acquireFunction · 0.85
ink_mutex_releaseFunction · 0.85
setThreadAffinityMethod · 0.80
alloc_readerMethod · 0.80
acquireMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected