Index: HTCookie.c =================================================================== RCS file: /sources/public/libwww/Library/src/HTCookie.c,v retrieving revision 2.4 diff -r2.4 HTCookie.c 335c335 < if (CookieMode & HT_COOKIE_SAME_HOST) { --- > if (CookieMode & (HT_COOKIE_SAME_HOST|HT_COOKIE_SAME_DOMAIN)) { 337a338 > int res; 340c341,347 < if (strcasecomp(host, cookie_host)) { --- > > if (CookieMode & HT_COOKIE_SAME_DOMAIN) > res = tailcasecomp(cookie_host, host); > else > res = strcasecomp(cookie_host, host); > > if (res != 0) { Index: HTCookie.html =================================================================== RCS file: /sources/public/libwww/Library/src/HTCookie.html,v retrieving revision 2.2 diff -r2.2 HTCookie.html 136,139c136,140 < HT_COOKIE_ACCEPT = 0x1, /* Accept cookies */ < HT_COOKIE_SEND = 0x2, /* Send cookies when fit */ < HT_COOKIE_SAME_HOST = 0x4, /* Don't accept cookies for other hosts */ < HT_COOKIE_PROMPT = 0x8 /* Prompt before accepting cookies */ --- > HT_COOKIE_ACCEPT = 0x1, /* Accept cookies */ > HT_COOKIE_SEND = 0x2, /* Send cookies when fit */ > HT_COOKIE_SAME_HOST = 0x4, /* Don't accept cookies for other hosts */ > HT_COOKIE_SAME_DOMAIN = 0x8, /* Don't accept cookies for other domains */ > HT_COOKIE_PROMPT = 0x10 /* Prompt before accepting cookies */ Index: HTString.c =================================================================== RCS file: /sources/public/libwww/Library/src/HTString.c,v retrieving revision 2.44 diff -r2.44 HTString.c 82a83,90 > /* > ** tailcomp(s1,s2) -- like strcmp(s1,s2) but match s1 with the tail of s2 > ** (used for cookie domain comparison) > */ > int tailcomp(const char * s1, const char * s2) > { > int l1 = strlen(s1); > int l2 = strlen(s2); 83a92,107 > if (l1 < l2) > s2 += (l2 - l1); > > return strcmp(s1, s2); > } > > int tailcasecomp(const char * s1, const char * s2) > { > int l1 = strlen(s1); > int l2 = strlen(s2); > > if (l1 < l2) > s2 += (l2 - l1); > > return strcasecomp(s1, s2); > } Index: HTString.html =================================================================== RCS file: /sources/public/libwww/Library/src/HTString.html,v retrieving revision 2.37 diff -r2.37 HTString.html 66a67,75 > Tail String Comparison > >
> Like strcmp, but match the tail of s2 (used for cookie domain comparison) >
> extern int tailcomp(const char * s1, const char * s2); > extern int tailcasecomp(const char * s1, const char * s2); >>