Lines Matching refs:domain

102   free(co->domain);  in freecookie()
217 static const char *get_top_domain(const char * const domain, size_t *outlen) in get_top_domain() argument
222 if(domain) { in get_top_domain()
223 len = strlen(domain); in get_top_domain()
224 last = memrchr(domain, '.', len); in get_top_domain()
226 first = memrchr(domain, '.', (last - domain)); in get_top_domain()
228 len -= (++first - domain); in get_top_domain()
235 return first ? first : domain; in get_top_domain()
246 static size_t cookie_hash_domain(const char *domain, const size_t len) in cookie_hash_domain() argument
248 const char *end = domain + len; in cookie_hash_domain()
251 while(domain < end) { in cookie_hash_domain()
252 size_t j = (size_t)Curl_raw_toupper(*domain++); in cookie_hash_domain()
267 static size_t cookiehash(const char * const domain) in cookiehash() argument
272 if(!domain || Curl_host_is_ipnum(domain)) in cookiehash()
275 top = get_top_domain(domain, &len); in cookiehash()
414 static bool bad_domain(const char *domain, size_t len) in bad_domain() argument
416 if((len == 9) && strncasecompare(domain, "localhost", 9)) in bad_domain()
420 char *dot = memchr(domain, '.', len); in bad_domain()
422 size_t i = dot - domain; in bad_domain()
477 const char *domain, /* default domain */ in parse_cookie_header() argument
645 domain = ":"; in parse_cookie_header()
648 is_ip = Curl_host_is_ipnum(domain ? domain : valuep); in parse_cookie_header()
650 if(!domain in parse_cookie_header()
651 || (is_ip && !strncmp(valuep, domain, vlen) && in parse_cookie_header()
652 (vlen == strlen(domain))) in parse_cookie_header()
653 || (!is_ip && cookie_tailmatch(valuep, vlen, domain))) { in parse_cookie_header()
654 strstore(&co->domain, valuep, vlen); in parse_cookie_header()
655 if(!co->domain) in parse_cookie_header()
749 if(!co->domain && domain) { in parse_cookie_header()
751 co->domain = strdup(domain); in parse_cookie_header()
752 if(!co->domain) in parse_cookie_header()
850 co->domain = strdup(ptr); in parse_netscape()
851 if(!co->domain) in parse_netscape()
936 const char *domain) in is_public_suffix() argument
945 co->name, co->domain, domain)); in is_public_suffix()
946 if(data && (domain && co->domain && !Curl_host_is_ipnum(co->domain))) { in is_public_suffix()
950 size_t dlen = strlen(domain); in is_public_suffix()
951 size_t clen = strlen(co->domain); in is_public_suffix()
956 Curl_strntolower(lcase, domain, dlen + 1); in is_public_suffix()
957 Curl_strntolower(lcookie, co->domain, clen + 1); in is_public_suffix()
967 "set cookies for '%s'", co->name, domain, co->domain); in is_public_suffix()
974 (void)domain; in is_public_suffix()
976 co->name, co->domain, domain)); in is_public_suffix()
991 size_t myhash = cookiehash(co->domain); in replace_existing()
998 if(clist->domain && co->domain) { in replace_existing()
999 if(strcasecompare(clist->domain, co->domain)) in replace_existing()
1003 else if(!clist->domain && !co->domain) in replace_existing()
1028 "overlay an existing cookie", co->name, co->domain); in replace_existing()
1037 if(clist->domain && co->domain) { in replace_existing()
1038 if(strcasecompare(clist->domain, co->domain) && in replace_existing()
1043 else if(!clist->domain && !co->domain) in replace_existing()
1101 const char *domain, /* default domain */ in Curl_cookie_add() argument
1123 rc = parse_cookie_header(data, co, ci, lineptr, domain, path, secure); in Curl_cookie_add()
1163 if(is_public_suffix(data, co, domain)) in Curl_cookie_add()
1170 myhash = cookiehash(co->domain); in Curl_cookie_add()
1178 co->domain, co->path, co->expires); in Curl_cookie_add()
1309 l1 = c1->domain ? strlen(c1->domain) : 0; in cookie_sort()
1310 l2 = c2->domain ? strlen(c2->domain) : 0; in cookie_sort()
1380 if(!co->domain || in Curl_cookie_getlist()
1382 cookie_tailmatch(co->domain, strlen(co->domain), host)) || in Curl_cookie_getlist()
1383 ((!co->tailmatch || is_ip) && strcasecompare(host, co->domain)) ) { in Curl_cookie_getlist()
1536 (co->tailmatch && co->domain && co->domain[0] != '.') ? "." : "", in get_netscape_format()
1537 co->domain ? co->domain : "unknown", in get_netscape_format()
1603 if(!co->domain) in cookie_output()
1665 if(!c->domain) in cookie_list()