r3337 jmb - /trunk/netsurf/content/urldb.c
by netsurf@semichrome.net
Author: jmb
Date: Sun Jun 10 20:59:29 2007
New Revision: 3337
URL: http://svn.semichrome.net?rev=3D3337&view=3Drev
Log:
Fix cookie domain matching in unverifiable transactions.
Minor tidying.
Modified:
trunk/netsurf/content/urldb.c
Modified: trunk/netsurf/content/urldb.c
URL: http://svn.semichrome.net/trunk/netsurf/content/urldb.c?rev=3D3337&r1=
=3D3336&r2=3D3337&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/netsurf/content/urldb.c (original)
+++ trunk/netsurf/content/urldb.c Sun Jun 10 20:59:29 2007
@@ -2640,7 +2640,7 @@
* 2) host =3D A.B; rhost =3D C.B (i.e. strip first
* segment off both hosts and compare) */
const char *dot =3D strchr(host, '.');
- const char *rdot =3D strchr(host, '.');
+ const char *rdot =3D strchr(rhost, '.');
=
if (!dot || !rdot) {
free(rhost);
@@ -3147,7 +3147,8 @@
* \param buf Pointer to Pointer to buffer (updated)
* \return true on success, false on memory exhaustion
*/
-bool urldb_concat_cookie(struct cookie_internal_data *c, int *used, int *a=
lloc, char **buf)
+bool urldb_concat_cookie(struct cookie_internal_data *c, int *used,
+ int *alloc, char **buf)
{
int clen;
=
@@ -3308,8 +3309,8 @@
}
}
=
-#undef SKIP_WS
-#undef FIND_WS
+#undef SKIP_T
+#undef FIND_T
=
fclose(fp);
}
@@ -3321,12 +3322,14 @@
* \param path The cookie's path
* \param name The cookie's name
*/
-void urldb_delete_cookie(const char *domain, const char *path, const char =
*name)
+void urldb_delete_cookie(const char *domain, const char *path,
+ const char *name)
{
urldb_delete_cookie_hosts(domain, path, name, &db_root);
}
=
-void urldb_delete_cookie_hosts(const char *domain, const char *path, const=
char *name, struct host_part *parent)
+void urldb_delete_cookie_hosts(const char *domain, const char *path,
+ const char *name, struct host_part *parent)
{
assert(parent);
=
@@ -3336,9 +3339,10 @@
urldb_delete_cookie_hosts(domain, path, name, h);
}
=
-void urldb_delete_cookie_paths(const char *domain, const char *path, const=
char *name, struct path_data *parent)
-{
- struct cookie_internal_data *c;
+void urldb_delete_cookie_paths(const char *domain, const char *path,
+ const char *name, struct path_data *parent)
+{
+ struct cookie_internal_data *c;
=
assert(parent);
=
@@ -3426,8 +3430,8 @@
assert(fp && parent);
=
if (parent->cookies) {
- for (struct cookie_internal_data *c =3D parent->cookies; c; c =3D c->nex=
t) {
-
+ for (struct cookie_internal_data *c =3D parent->cookies; c;
+ c =3D c->next) {
if (c->expires < now)
/* Skip expired cookies */
continue;
@@ -3470,14 +3474,14 @@
=
/* new filename needed */
if (p->cache.filename[0] =3D=3D 0) {
- filename =3D filename_request();
- if (!filename)
- return false;
- sprintf(p->cache.filename, filename);
+ filename =3D filename_request();
+ if (!filename)
+ return false;
+ sprintf(p->cache.filename, filename);
}
=
/* todo: save content, set cache data etc */
- return true;
+ return true;
}
=
=