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

Method load_status

plugins/experimental/txn_box/plugin/src/Machinery.cc:2767–2789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2765}
2766
2767Errata
2768Do_proxy_reply::load_status()
2769{
2770 _status_idx = _fg.index_of(STATUS_KEY);
2771
2772 FeatureGroup::ExprInfo &info = _fg[_status_idx];
2773
2774 if (info._expr.is_literal()) {
2775 auto &&[status, errata]{std::get<Feature>(info._expr._raw).as_integer(-1)};
2776 if (!errata.is_ok()) {
2777 errata.note("While load key '{}' for directive '{}'", STATUS_KEY, KEY);
2778 return std::move(errata);
2779 }
2780 if (!(100 <= status && status <= 599)) {
2781 return Errata(S_ERROR, R"(Value for '{}' key in {} directive is not a positive integer 100..599 as required.)", STATUS_KEY,
2782 KEY);
2783 }
2784 _status = status;
2785 } else if (!info._expr.result_type().can_satisfy(MaskFor(STRING, INTEGER))) {
2786 return Errata(S_ERROR, R"({} is not an integer nor string as required.)", STATUS_KEY);
2787 }
2788 return {};
2789}
2790
2791Rv<Directive::Handle>
2792Do_proxy_reply::load(Config &cfg, CfgStaticData const *, YAML::Node drtv_node, swoc::TextView const &, swoc::TextView const &,

Callers 1

loadMethod · 0.95

Calls 9

ErrataClass · 0.85
MaskForFunction · 0.85
as_integerMethod · 0.80
can_satisfyMethod · 0.80
index_ofMethod · 0.45
is_literalMethod · 0.45
is_okMethod · 0.45
noteMethod · 0.45
result_typeMethod · 0.45

Tested by

no test coverage detected