wrapper to choose between a remap next hop strategy or use parent.config remap next hop strategy is preferred
| 300 | // wrapper to choose between a remap next hop strategy or use parent.config |
| 301 | // remap next hop strategy is preferred |
| 302 | inline static void |
| 303 | nextParent(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 | |
| 329 | inline static bool |
| 330 | is_localhost(const char *name, int len) |
no test coverage detected