| 280 | } |
| 281 | |
| 282 | void |
| 283 | HttpSM::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 | |
| 327 | void |
| 328 | HttpSM::set_ua_half_close_flag() |
no test coverage detected