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

Method process_srv_info

src/proxy/http/HttpSM.cc:2269–2297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2267}
2268
2269void
2270HttpSM::process_srv_info(HostDBRecord *record)
2271{
2272 SMDbg(dbg_ctl_dns_srv, "beginning process_srv_info");
2273 t_state.dns_info.record = record;
2274
2275 /* we didn't get any SRV records, continue w normal lookup */
2276 if (!record || !record->is_srv()) {
2277 t_state.dns_info.srv_hostname[0] = '\0';
2278 t_state.dns_info.resolved_p = false;
2279 t_state.my_txn_conf().srv_enabled = false;
2280 SMDbg(dbg_ctl_dns_srv, "No SRV records were available, continuing to lookup %s", t_state.dns_info.lookup_name);
2281 } else {
2282 HostDBInfo *srv = record->select_best_srv(t_state.dns_info.srv_hostname, &mutex->thread_holding->generator, ts_clock::now(),
2283 t_state.txn_conf->down_server_timeout);
2284 if (!srv) {
2285 // t_state.dns_info.srv_lookup_success = false;
2286 t_state.dns_info.srv_hostname[0] = '\0';
2287 t_state.my_txn_conf().srv_enabled = false;
2288 SMDbg(dbg_ctl_dns_srv, "SRV records empty for %s", t_state.dns_info.lookup_name);
2289 } else {
2290 t_state.dns_info.resolved_p = false;
2291 t_state.dns_info.srv_port = srv->data.srv.srv_port;
2292 ink_assert(srv->data.srv.key == makeHostHash(t_state.dns_info.srv_hostname));
2293 SMDbg(dbg_ctl_dns_srv, "select SRV records %s", t_state.dns_info.srv_hostname);
2294 }
2295 }
2296 return;
2297}
2298
2299void
2300HttpSM::process_hostdb_info(HostDBRecord *record)

Callers

nothing calls this directly

Calls 4

makeHostHashFunction · 0.85
select_best_srvMethod · 0.80
nowClass · 0.50
is_srvMethod · 0.45

Tested by

no test coverage detected