aboutsummaryrefslogtreecommitdiffstats
path: root/cookie.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-03 18:29:37 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-03 18:29:37 +0000
commit8024528a098d246c9c6f3355e28d4daf91c1eeee (patch)
tree905e756a5fd648c13a0d848b334d6c311d887dba /cookie.c
parent[w3m-dev 02609] (diff)
downloadw3m-8024528a098d246c9c6f3355e28d4daf91c1eeee.tar.gz
w3m-8024528a098d246c9c6f3355e28d4daf91c1eeee.zip
[w3m-dev 02611] a improvement of find_cookie()
From: Tsutomu Okada <okada@furuno.co.jp>
Diffstat (limited to 'cookie.c')
-rw-r--r--cookie.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cookie.c b/cookie.c
index 18bb304..1548255 100644
--- a/cookie.c
+++ b/cookie.c
@@ -1,4 +1,4 @@
-/* $Id: cookie.c,v 1.5 2001/11/24 02:01:26 ukai Exp $ */
+/* $Id: cookie.c,v 1.6 2001/12/03 18:29:37 ukai Exp $ */
/*
* References for version 0 cookie:
@@ -161,10 +161,8 @@ make_cookie(struct cookie *cookie)
}
static int
-match_cookie(ParsedURL *pu, struct cookie *cookie)
+match_cookie(ParsedURL *pu, struct cookie *cookie, char *domainname)
{
- char *domainname = (cookie->version == 0) ? FQDN(pu->host) : pu->host;
-
if (!domainname)
return 0;
@@ -204,10 +202,13 @@ find_cookie(ParsedURL *pu)
Str tmp;
struct cookie *p, *p1, *fco = NULL;
int version = 0;
+ char *fq_domainname, *domainname;
+ fq_domainname = FQDN(pu->host);
check_expired_cookies();
for (p = First_cookie; p; p = p->next) {
- if (p->flag & COO_USE && match_cookie(pu, p)) {
+ domainname = (p->version == 0) ? fq_domainname : pu->host;
+ if (p->flag & COO_USE && match_cookie(pu, p, domainname)) {
for (p1 = fco; p1 && Strcasecmp(p1->name, p->name);
p1 = p1->next) ;
if (p1)