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

Method _parseSubCookies

plugins/esi/lib/Variables.cc:280–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280void
281Variables::_parseSubCookies()
282{
283 StringHash &cookies = _dict_data[HTTP_COOKIE];
284 for (StringHash::const_iterator it_cookie = cookies.begin(); it_cookie != cookies.end(); ++it_cookie) {
285 const std::string &name = it_cookie->first;
286 const std::string &value = it_cookie->second;
287 if (strchr(value.c_str(), '=') == nullptr) {
288 continue;
289 }
290
291 StringHash &subcookies = _sub_cookies[name];
292 AttributeList attr_list;
293 Utils::parseAttributes(value.c_str(), value.length(), attr_list, "&");
294 for (auto &iter : attr_list) {
295 DBG("[%s] Inserting query string variable [%.*s] with value [%.*s]", __FUNCTION__, iter.name_len, iter.name, iter.value_len,
296 iter.value);
297 _insert(subcookies, string(iter.name, iter.name_len), string(iter.value, iter.value_len));
298 }
299 }
300}
301
302const string &
303Variables::_getSubCookieValue(const string &cookie_str, size_t cookie_part_divider) const

Callers 1

Variables.ccFile · 0.80

Calls 6

parseAttributesFunction · 0.85
stringClass · 0.85
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected