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

Function nextParent

src/proxy/http/HttpTransact.cc:302–327  ·  view source on GitHub ↗

wrapper to choose between a remap next hop strategy or use parent.config remap next hop strategy is preferred

Source from the content-addressed store, hash-verified

300// wrapper to choose between a remap next hop strategy or use parent.config
301// remap next hop strategy is preferred
302inline static void
303nextParent(HttpTransact::State *s)
304{
305 TxnDbg(dbg_ctl_parent_down, "connection to parent %s failed, conn_state: %s, request to origin: %s", s->parent_result.hostname,
306 HttpDebugNames::get_server_state_name(s->current.state), s->request_data.get_host());
307 url_mapping *mp = s->url_map.getMapping();
308 Metrics::Counter::increment(http_rsb.parent_count);
309 if (s->response_action.handled) {
310 s->parent_result.hostname = s->response_action.action.hostname;
311 s->parent_result.port = s->response_action.action.port;
312 s->parent_result.retry = s->response_action.action.is_retry;
313 if (!s->response_action.action.fail) {
314 s->parent_result.result = PARENT_SPECIFIED;
315 } else if (s->response_action.action.goDirect) {
316 s->parent_result.result = PARENT_DIRECT;
317 } else {
318 s->parent_result.result = PARENT_FAIL;
319 }
320 } else if (mp && mp->strategy) {
321 // NextHop only has a findNextHop() function.
322 mp->strategy->findNextHop(reinterpret_cast<TSHttpTxn>(s->state_machine));
323 } else if (s->parent_params) {
324 s->parent_params->nextParent(&s->request_data, &s->parent_result, s->txn_conf->parent_fail_threshold,
325 s->txn_conf->parent_retry_time);
326 }
327}
328
329inline static bool
330is_localhost(const char *name, int len)

Callers 1

Calls 5

incrementFunction · 0.85
getMappingMethod · 0.80
get_hostMethod · 0.45
findNextHopMethod · 0.45
nextParentMethod · 0.45

Tested by

no test coverage detected