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

Method _processWhenTag

plugins/esi/lib/EsiParser.cc:470–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470bool
471EsiParser::_processWhenTag(const string &data, size_t curr_pos, size_t end_pos, DocNodeList &node_list) const
472{
473 Attribute test_expr;
474 size_t term_pos;
475 if (!Utils::getAttribute(data, TEST_ATTR_STR, curr_pos, end_pos, test_expr, &term_pos, '>')) {
476 TSError("[%s] Could not find test attribute", __FUNCTION__);
477 return false;
478 }
479 ++term_pos; // go past the terminator
480 const char *data_start_ptr = data.data() + term_pos;
481 int data_size = end_pos - term_pos;
482 if (!_processSimpleContentTag(DocNode::TYPE_WHEN, data_start_ptr, data_size, node_list)) {
483 TSError("[%s] Could not parse when node's content", __FUNCTION__);
484 return false;
485 }
486 node_list.back().attr_list.push_back(test_expr);
487 Dbg(dbg_ctl, "[%s] Added when tag with expression [%.*s] and data starting with [%.5s]", __FUNCTION__, test_expr.value_len,
488 test_expr.value, data_start_ptr);
489 return true;
490}
491
492bool
493EsiParser::_processTryTag(const string &data, size_t curr_pos, size_t end_pos, DocNodeList &node_list) const

Callers

nothing calls this directly

Calls 4

getAttributeFunction · 0.85
TSErrorFunction · 0.50
dataMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected