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

Method Search

src/proxy/http/remap/UrlMappingPathIndex.cc:67–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67url_mapping *
68UrlMappingPathIndex::Search(URL *request_url, int request_port, bool normal_search /* = true */) const
69{
70 url_mapping *retval = nullptr;
71 int scheme_idx;
72 UrlMappingTrie *trie;
73 int path_len;
74 const char *path;
75
76 trie = _GetTrie(request_url, scheme_idx, request_port, normal_search);
77
78 if (!trie) {
79 Dbg(dbg_ctl_UrlMappingPathIndex_Search, "No mappings exist for scheme index, port combo <%d, %d>", scheme_idx, request_port);
80 goto lFail;
81 }
82
83 path = request_url->path_get(&path_len);
84 if (!(retval = trie->Search(path, path_len))) {
85 Dbg(dbg_ctl_UrlMappingPathIndex_Search, "Couldn't find entry for url with path [%.*s]", path_len, path);
86 goto lFail;
87 }
88 return retval;
89
90lFail:
91 return nullptr;
92}
93
94void
95UrlMappingPathIndex::Print() const

Callers 1

_tableLookupMethod · 0.45

Calls 1

path_getMethod · 0.45

Tested by

no test coverage detected