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

Method DefaultInit

src/proxy/ParentSelection.cc:605–629  ·  view source on GitHub ↗

bool ParentRecord::DefaultInit(char* val) Creates the record for a default parent proxy rule established by a config variable matcher_line* line_info - contains the value of proxy.config.http.parent_proxies Returns true on success and false on failure

Source from the content-addressed store, hash-verified

603// Returns true on success and false on failure
604//
605bool
606ParentRecord::DefaultInit(char *val)
607{
608 const char *errPtr;
609 char *errBuf;
610
611 this->go_direct = true;
612 this->ignore_query = false;
613 this->scheme = nullptr;
614 this->parent_is_proxy = true;
615 errPtr = ProcessParents(val, true);
616
617 if (errPtr != nullptr) {
618 errBuf = static_cast<char *>(ats_malloc(1024));
619 snprintf(errBuf, 1024, "%s %s for default parent proxy", modulePrefix, errPtr);
620 Error("%s", errBuf);
621 ats_free(errBuf);
622 return false;
623 } else {
624 ParentRR_t round_robin = P_NO_ROUND_ROBIN;
625 Dbg(dbg_ctl_parent_select, "allocating ParentRoundRobin() lookup strategy.");
626 selection_strategy = new ParentRoundRobin(this, round_robin);
627 return true;
628 }
629}
630
631// Result ParentRecord::Init(matcher_line* line_info)
632//

Callers 1

createDefaultParentFunction · 0.80

Calls 3

ats_mallocFunction · 0.85
ats_freeFunction · 0.85
ErrorClass · 0.50

Tested by

no test coverage detected