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

Method state_hostdb_lookup

src/proxy/http/HttpSM.cc:2362–2398  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////// HttpSM::state_hostdb_lookup() /////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2360//
2361//////////////////////////////////////////////////////////////////////////////
2362int
2363HttpSM::state_hostdb_lookup(int event, void *data)
2364{
2365 STATE_ENTER(&HttpSM::state_hostdb_lookup, event);
2366
2367 switch (event) {
2368 case EVENT_HOST_DB_LOOKUP:
2369 pending_action = nullptr;
2370 process_hostdb_info(static_cast<HostDBRecord *>(data));
2371 call_transact_and_set_next_state(nullptr);
2372 break;
2373 case EVENT_SRV_LOOKUP: {
2374 pending_action = nullptr;
2375 process_srv_info(static_cast<HostDBRecord *>(data));
2376
2377 char const *host_name = t_state.dns_info.is_srv() ? t_state.dns_info.srv_hostname : t_state.dns_info.lookup_name;
2378 HostDBProcessor::Options opt;
2379 opt.port = t_state.dns_info.is_srv() ? t_state.dns_info.srv_port : t_state.server_info.dst_addr.host_order_port();
2380 opt.flags = (t_state.cache_info.directives.does_client_permit_dns_storing) ? HostDBProcessor::HOSTDB_DO_NOT_FORCE_DNS :
2381 HostDBProcessor::HOSTDB_FORCE_DNS_RELOAD;
2382 opt.timeout = (t_state.api_txn_dns_timeout_value != -1) ? t_state.api_txn_dns_timeout_value : 0;
2383 opt.host_res_style =
2384 ats_host_res_from(_ua.get_txn()->get_netvc()->get_local_addr()->sa_family, t_state.txn_conf->host_res_data.order);
2385
2386 pending_action = hostDBProcessor.getbyname_imm(this, (cb_process_result_pfn)&HttpSM::process_hostdb_info, host_name, 0, opt);
2387 if (pending_action.empty()) {
2388 call_transact_and_set_next_state(nullptr);
2389 }
2390 } break;
2391 case EVENT_HOST_DB_IP_REMOVED:
2392 ink_assert(!"Unexpected event from HostDB");
2393 break;
2394 default:
2395 ink_assert(!"Unexpected event");
2396 }
2397 return 0;
2398}
2399
2400int
2401HttpSM::state_hostdb_reverse_lookup(int event, void *data)

Callers

nothing calls this directly

Calls 8

ats_host_res_fromFunction · 0.85
get_txnMethod · 0.80
getbyname_immMethod · 0.80
is_srvMethod · 0.45
host_order_portMethod · 0.45
get_local_addrMethod · 0.45
get_netvcMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected