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

Method nextHopExists

src/proxy/http/remap/NextHopSelectionStrategy.cc:278–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278bool
279NextHopSelectionStrategy::nextHopExists(TSHttpTxn txnp, void * /* ih ATS_UNUSED */)
280{
281 HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
282 int64_t sm_id = sm->sm_id;
283
284 for (uint32_t gg = 0; gg < groups; gg++) {
285 for (auto &hh : host_groups[gg]) {
286 HostRecord *p = hh.get();
287 if (p->available.load()) {
288 NH_Dbg(NH_DBG_CTL,
289 "[%" PRIu64 "] found available next hop %s (this is NOT necessarily the parent which will be selected, just the "
290 "first available parent found)",
291 sm_id, p->hostname.c_str());
292 return true;
293 }
294 }
295 }
296 return false;
297}
298
299ParentRetry_t
300NextHopSelectionStrategy::responseIsRetryable(int64_t sm_id, HttpTransact::CurrentInfo &current_info, HTTPStatus response_code)

Callers 2

parentExistsFunction · 0.80

Calls 3

getMethod · 0.45
loadMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected