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

Method get_template_by_name

src/proxy/http/HttpBodyFactory.cc:1031–1051  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1029}
1030
1031HttpBodyTemplate *
1032HttpBodySet::get_template_by_name(const char *name)
1033{
1034 Dbg(dbg_ctl_body_factory, " calling get_template_by_name(%s)", name);
1035
1036 if (table_of_pages == nullptr) {
1037 return nullptr;
1038 }
1039
1040 if (auto it = table_of_pages->find(name); it != table_of_pages->end()) {
1041 HttpBodyTemplate *t = it->second;
1042 if ((t == nullptr) || (!t->is_sane())) {
1043 return nullptr;
1044 }
1045 Dbg(dbg_ctl_body_factory, " get_template_by_name(%s) -> (file %s, length %" PRId64 ")", name, t->template_pathname,
1046 t->byte_count);
1047 return t;
1048 }
1049 Dbg(dbg_ctl_body_factory, " get_template_by_name(%s) -> NULL", name);
1050 return nullptr;
1051}
1052
1053void
1054HttpBodySet::set_template_by_name(const char *name, HttpBodyTemplate *t)

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
is_saneMethod · 0.45

Tested by

no test coverage detected