MCPcopy Create free account
hub / github.com/acl-dev/acl / get_cookie

Method get_cookie

lib_acl_cpp/src/http/http_request.cpp:1014–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012}
1013
1014const HttpCookie* http_request::get_cookie(const char* name,
1015 bool case_insensitive /* = true */) const
1016{
1017 if (!cookie_inited_) {
1018 const_cast<http_request*>(this)->create_cookies();
1019 }
1020 if (cookies_ == NULL) {
1021 return NULL;
1022 }
1023
1024 std::vector<HttpCookie*>::const_iterator cit = cookies_->begin();
1025 for (; cit != cookies_->end(); ++cit) {
1026 if (case_insensitive) {
1027 if (strcasecmp((*cit)->getName(), name) == 0) {
1028 return *cit;
1029 }
1030 } else if (strcmp((*cit)->getName(), name) == 0) {
1031 return *cit;
1032 }
1033 }
1034 return NULL;
1035}
1036
1037void http_request::create_cookies()
1038{

Callers

nothing calls this directly

Calls 4

create_cookiesMethod · 0.80
beginMethod · 0.80
endMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected