summaryrefslogtreecommitdiff
path: root/content/urldb.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/urldb.c')
-rw-r--r--content/urldb.c60
1 files changed, 35 insertions, 25 deletions
diff --git a/content/urldb.c b/content/urldb.c
index 313ec316d..add2a1d80 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -662,7 +662,8 @@ static bool urldb__host_is_ip_address(const char *host)
c[slash - host] = '\0';
sane_host = c;
host_len = slash - host;
- LOG("WARNING: called with non-host '%s'", host);
+ NSLOG(netsurf, INFO, "WARNING: called with non-host '%s'",
+ host);
}
if (strspn(sane_host, "0123456789abcdefABCDEF[].:") < host_len)
@@ -1292,7 +1293,7 @@ urldb_match_path(const struct path_data *parent,
assert(parent->segment == NULL);
if (path[0] != '/') {
- LOG("path is %s", path);
+ NSLOG(netsurf, INFO, "path is %s", path);
}
assert(path[0] == '/');
@@ -1422,12 +1423,14 @@ static void urldb_dump_paths(struct path_data *parent)
do {
if (p->segment != NULL) {
- LOG("\t%s : %u", lwc_string_data(p->scheme), p->port);
+ NSLOG(netsurf, INFO, "\t%s : %u",
+ lwc_string_data(p->scheme), p->port);
- LOG("\t\t'%s'", p->segment);
+ NSLOG(netsurf, INFO, "\t\t'%s'", p->segment);
for (i = 0; i != p->frag_cnt; i++) {
- LOG("\t\t\t#%s", p->fragment[i]);
+ NSLOG(netsurf, INFO, "\t\t\t#%s",
+ p->fragment[i]);
}
}
@@ -1457,10 +1460,10 @@ static void urldb_dump_hosts(struct host_part *parent)
struct host_part *h;
if (parent->part) {
- LOG("%s", parent->part);
+ NSLOG(netsurf, INFO, "%s", parent->part);
- LOG("\t%s invalid SSL certs",
- parent->permit_invalid_certs ? "Permits" : "Denies");
+ NSLOG(netsurf, INFO, "\t%s invalid SSL certs",
+ parent->permit_invalid_certs ? "Permits" : "Denies");
}
/* Dump path data */
@@ -1512,7 +1515,7 @@ static void urldb_dump_search(struct search_node *parent, int depth)
}
s[i]= 0;
- LOG("%s", s);
+ NSLOG(netsurf, INFO, "%s", s);
urldb_dump_search(parent->right, depth + 1);
}
@@ -2866,14 +2869,15 @@ nserror urldb_load(const char *filename)
assert(filename);
- LOG("Loading URL file %s", filename);
+ NSLOG(netsurf, INFO, "Loading URL file %s", filename);
if (url_bloom == NULL)
url_bloom = bloom_create(BLOOM_SIZE);
fp = fopen(filename, "r");
if (!fp) {
- LOG("Failed to open file '%s' for reading", filename);
+ NSLOG(netsurf, INFO, "Failed to open file '%s' for reading",
+ filename);
return NSERROR_NOT_FOUND;
}
@@ -2884,12 +2888,12 @@ nserror urldb_load(const char *filename)
version = atoi(s);
if (version < MIN_URL_FILE_VERSION) {
- LOG("Unsupported URL file version.");
+ NSLOG(netsurf, INFO, "Unsupported URL file version.");
fclose(fp);
return NSERROR_INVALID;
}
if (version > URL_FILE_VERSION) {
- LOG("Unknown URL file version.");
+ NSLOG(netsurf, INFO, "Unknown URL file version.");
fclose(fp);
return NSERROR_INVALID;
}
@@ -2919,13 +2923,13 @@ nserror urldb_load(const char *filename)
/* no URLs => try next host */
if (urls == 0) {
- LOG("No URLs for '%s'", host);
+ NSLOG(netsurf, INFO, "No URLs for '%s'", host);
continue;
}
h = urldb_add_host(host);
if (!h) {
- LOG("Failed adding host: '%s'", host);
+ NSLOG(netsurf, INFO, "Failed adding host: '%s'", host);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -2976,7 +2980,8 @@ nserror urldb_load(const char *filename)
* Need a nsurl_save too.
*/
if (nsurl_create(url, &nsurl) != NSERROR_OK) {
- LOG("Failed inserting '%s'", url);
+ NSLOG(netsurf, INFO, "Failed inserting '%s'",
+ url);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -2989,7 +2994,8 @@ nserror urldb_load(const char *filename)
/* Copy and merge path/query strings */
if (nsurl_get(nsurl, NSURL_PATH | NSURL_QUERY,
&path_query, &len) != NSERROR_OK) {
- LOG("Failed inserting '%s'", url);
+ NSLOG(netsurf, INFO, "Failed inserting '%s'",
+ url);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -3000,7 +3006,8 @@ nserror urldb_load(const char *filename)
p = urldb_add_path(scheme_lwc, port, h, path_query,
fragment_lwc, nsurl);
if (!p) {
- LOG("Failed inserting '%s'", url);
+ NSLOG(netsurf, INFO, "Failed inserting '%s'",
+ url);
fclose(fp);
return NSERROR_NOMEM;
}
@@ -3044,7 +3051,7 @@ nserror urldb_load(const char *filename)
}
fclose(fp);
- LOG("Successfully loaded URL file");
+ NSLOG(netsurf, INFO, "Successfully loaded URL file");
#undef MAXIMUM_URL_LENGTH
return NSERROR_OK;
@@ -3060,7 +3067,8 @@ nserror urldb_save(const char *filename)
fp = fopen(filename, "w");
if (!fp) {
- LOG("Failed to open file '%s' for writing", filename);
+ NSLOG(netsurf, INFO, "Failed to open file '%s' for writing",
+ filename);
return NSERROR_SAVE_FAILED;
}
@@ -3472,7 +3480,7 @@ bool urldb_set_thumbnail(nsurl *url, struct bitmap *bitmap)
return false;
}
- LOG("Setting bitmap on %s", nsurl_access(url));
+ NSLOG(netsurf, INFO, "Setting bitmap on %s", nsurl_access(url));
if ((p->thumb) && (p->thumb != bitmap)) {
guit->bitmap->destroy(p->thumb);
@@ -3754,7 +3762,8 @@ bool urldb_set_cookie(const char *header, nsurl *url, nsurl *referer)
}
suffix = nspsl_getpublicsuffix(dot);
if (suffix == NULL) {
- LOG("domain %s was a public suffix domain", dot);
+ NSLOG(netsurf, INFO,
+ "domain %s was a public suffix domain", dot);
urldb_free_cookie(c);
goto error;
}
@@ -4161,7 +4170,7 @@ void urldb_load_cookies(const char *filename)
for (; *p && *p != '\t'; p++) \
; /* do nothing */ \
if (p >= end) { \
- LOG("Overran input"); \
+ NSLOG(netsurf, INFO, "Overran input"); \
continue; \
} \
*p++ = '\0'; \
@@ -4171,7 +4180,7 @@ void urldb_load_cookies(const char *filename)
for (; *p && *p == '\t'; p++) \
; /* do nothing */ \
if (p >= end) { \
- LOG("Overran input"); \
+ NSLOG(netsurf, INFO, "Overran input"); \
continue; \
} \
}
@@ -4200,7 +4209,8 @@ void urldb_load_cookies(const char *filename)
if (loaded_cookie_file_version <
MIN_COOKIE_FILE_VERSION) {
- LOG("Unsupported Cookie file version");
+ NSLOG(netsurf, INFO,
+ "Unsupported Cookie file version");
break;
}