NetSurf
|
Unified URL information database internal interface. More...
Go to the source code of this file.
Functions | |
void | urldb_destroy (void) |
Destroy urldb. More... | |
nserror | urldb_set_url_persistence (struct nsurl *url, bool persist) |
Set the cross-session persistence of the entry for an URL. More... | |
bool | urldb_add_url (struct nsurl *url) |
Insert an URL into the database. More... | |
nserror | urldb_set_url_title (struct nsurl *url, const char *title) |
Set an URL's title string, replacing any existing one. More... | |
nserror | urldb_set_url_content_type (struct nsurl *url, content_type type) |
Set an URL's content type. More... | |
void | urldb_set_auth_details (struct nsurl *url, const char *realm, const char *auth) |
Set authentication data for an URL. More... | |
const char * | urldb_get_auth_details (struct nsurl *url, const char *realm) |
Look up authentication details in database. More... | |
nserror | urldb_update_url_visit_data (struct nsurl *url) |
Update an URL's visit data. More... | |
void | urldb_reset_url_visit_data (struct nsurl *url) |
Reset an URL's visit statistics. More... | |
struct nsurl * | urldb_get_url (struct nsurl *url) |
Extract an URL from the db. More... | |
bool | urldb_get_cert_permissions (struct nsurl *url) |
Retrieve certificate verification permissions from database. More... | |
bool | urldb_set_cookie (const char *header, struct nsurl *url, struct nsurl *referrer) |
Parse Set-Cookie header and insert cookie(s) into database. More... | |
char * | urldb_get_cookie (struct nsurl *url, bool include_http_only) |
Retrieve cookies for an URL. More... | |
bool | urldb_set_hsts_policy (struct nsurl *url, const char *header) |
Set HSTS policy for an URL. More... | |
bool | urldb_get_hsts_enabled (struct nsurl *url) |
Determine if HSTS policy is enabled for an URL. More... | |
Unified URL information database internal interface.
Definition in file urldb.h.
bool urldb_add_url | ( | struct nsurl * | url | ) |
Insert an URL into the database.
url | Absolute URL to insert |
Definition at line 3140 of file urldb.c.
References bloom_create(), bloom_insert_hash(), BLOOM_SIZE, path_data::fragment, NSERROR_OK, NSURL_FRAGMENT, nsurl_get(), nsurl_get_component(), nsurl_hash(), NSURL_HOST, NSURL_PATH, NSURL_PORT, NSURL_QUERY, NSURL_SCHEME, path_data::port, path_data::scheme, path_data::url, url_bloom, urldb_add_host(), and urldb_add_path().
Referenced by browser_window_callback(), browser_window_content_ready(), hotlist_create_entry(), hotlist_update_url_walk_cb(), urldb_get_auth_details(), urldb_get_cookie(), urldb_get_hsts_enabled(), urldb_set_auth_details(), urldb_set_cert_permissions(), and urldb_set_hsts_policy().
void urldb_destroy | ( | void | ) |
Destroy urldb.
Definition at line 2847 of file urldb.c.
References bloom_destroy(), host_part::children, db_root, empty, host_part::next, NUM_SEARCH_TREES, search_trees, url_bloom, urldb_destroy_host_tree(), and urldb_destroy_search_tree().
Referenced by netsurf_exit().
const char * urldb_get_auth_details | ( | struct nsurl * | url, |
const char * | realm | ||
) |
Look up authentication details in database.
url | Absolute URL to search for |
realm | When non-NULL, it is realm which can be used to determine the protection space when that's not been done before for given URL. |
Definition at line 3405 of file urldb.c.
References prot_space_data::auth, prot_space_data::next, path_data::parent, prot_space_data::port, path_data::port, path_data::prot_space, host_part::prot_space, prot_space_data::realm, prot_space_data::scheme, path_data::scheme, path_data::url, urldb_add_url(), and urldb_find_url().
Referenced by browser_window__handle_login(), fetch_curl_set_options(), and llcache_fetch_auth().
bool urldb_get_cert_permissions | ( | struct nsurl * | url | ) |
Retrieve certificate verification permissions from database.
url | Absolute URL to search for |
Definition at line 3480 of file urldb.c.
References path_data::parent, host_part::permit_invalid_certs, and urldb_find_url().
Referenced by browser_window_get_page_info_state(), content_saw_insecure_objects(), and fetch_curl_set_options().
char * urldb_get_cookie | ( | struct nsurl * | url, |
bool | include_http_only | ||
) |
Retrieve cookies for an URL.
url | URL being fetched |
include_http_only | Whether to include HTTP(S) only cookies. |
Definition at line 3997 of file urldb.c.
References path_data::children, cookie_manager_add(), COOKIE_NETSCAPE, COOKIE_RFC2965, path_data::cookies, count(), db_root, cookie_internal_data::expires, GROW_MATCHED_COOKIES, cookie_internal_data::http_only, cookie_internal_data::last_used, cookie_internal_data::next, path_data::next, nsurl_get_component(), NSURL_PATH, path_data::parent, host_part::parent, cookie_internal_data::path, path(), host_part::paths, path_data::scheme, cookie_internal_data::secure, path_data::segment, urldb_add_url(), urldb_concat_cookie(), urldb_find_url(), cookie_internal_data::version, and version.
Referenced by browser_window_get_cookie_count(), and fetch_curl_set_options().
bool urldb_get_hsts_enabled | ( | struct nsurl * | url | ) |
Determine if HSTS policy is enabled for an URL.
url | URL being fetched |
Definition at line 3573 of file urldb.c.
References db_root, hsts_data::expires, host_part::hsts, hsts_data::include_sub_domains, nsurl_get_component(), NSURL_HOST, path_data::parent, host_part::parent, urldb__host_is_ip_address(), urldb_add_url(), and urldb_find_url().
Referenced by llcache_hsts_transform_url().
Extract an URL from the db.
url | URL to extract |
Definition at line 3327 of file urldb.c.
References path_data::url, and urldb_find_url().
Referenced by browser_window_content_ready().
void urldb_reset_url_visit_data | ( | struct nsurl * | url | ) |
Reset an URL's visit statistics.
url | The URL to reset |
Definition at line 3293 of file urldb.c.
References url_internal_data::last_visit, path_data::url, path_data::urld, urldb_find_url(), and url_internal_data::visits.
Referenced by global_history_delete_entry_internal().
void urldb_set_auth_details | ( | struct nsurl * | url, |
const char * | realm, | ||
const char * | auth | ||
) |
Set authentication data for an URL.
url | The URL to consider |
realm | The authentication realm |
auth | The authentication details (in form username:password) |
Definition at line 3342 of file urldb.c.
References prot_space_data::auth, prot_space_data::next, path_data::parent, prot_space_data::port, path_data::port, path_data::prot_space, host_part::prot_space, prot_space_data::realm, prot_space_data::scheme, path_data::scheme, urldb_add_url(), and urldb_find_url().
Referenced by browser_window__handle_userpass_response(), and navigate_internal_query_auth().
Parse Set-Cookie header and insert cookie(s) into database.
header | Header to parse, with Set-Cookie: stripped |
url | URL being fetched |
referrer | Referring resource, or 0 for verifiable transaction |
Definition at line 3734 of file urldb.c.
References cookie_internal_data::domain, cookie_internal_data::name, NSERROR_OK, NSLOG, nsurl_defragment(), nsurl_get_component(), NSURL_HOST, NSURL_PATH, NSURL_SCHEME, nsurl_unref(), cookie_internal_data::path, path(), urldb__host_is_ip_address(), urldb_free_cookie(), urldb_insert_cookie(), urldb_parse_cookie(), and cookie_internal_data::value.
Referenced by fetch_set_cookie().
bool urldb_set_hsts_policy | ( | struct nsurl * | url, |
const char * | header | ||
) |
Set HSTS policy for an URL.
url | URL being fetched |
header | Strict-Transport-Security header value |
Definition at line 3502 of file urldb.c.
References hsts_data::expires, host_part::hsts, http_parse_strict_transport_security(), http_strict_transport_security_destroy(), http_strict_transport_security_include_subdomains(), http_strict_transport_security_max_age(), hsts_data::include_sub_domains, NSERROR_OK, nsurl_get_component(), NSURL_HOST, path_data::parent, host_part::permit_invalid_certs, urldb__host_is_ip_address(), urldb_add_url(), and urldb_find_url().
Referenced by llcache_hsts_update_policy().
nserror urldb_set_url_content_type | ( | struct nsurl * | url, |
content_type | type | ||
) |
Set an URL's content type.
url | The URL to look for |
type | The type to set |
Definition at line 3256 of file urldb.c.
References NSERROR_NOT_FOUND, NSERROR_OK, url_internal_data::type, type, path_data::url, path_data::urld, and urldb_find_url().
Referenced by browser_window_content_ready().
Set the cross-session persistence of the entry for an URL.
url | Absolute URL to persist |
persist | True to persist, false otherwise |
Definition at line 3122 of file urldb.c.
References NSERROR_NOT_FOUND, NSERROR_OK, path_data::persistent, path_data::url, and urldb_find_url().
Referenced by hotlist_add_entry_internal().
Set an URL's title string, replacing any existing one.
url | The URL to look for |
title | The title string to use (copied) |
Definition at line 3226 of file urldb.c.
References NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, url_internal_data::title, path_data::url, path_data::urld, and urldb_find_url().
Referenced by browser_window_content_ready().
Update an URL's visit data.
url | The URL to update |
Definition at line 3274 of file urldb.c.
References url_internal_data::last_visit, NSERROR_NOT_FOUND, NSERROR_OK, path_data::url, path_data::urld, urldb_find_url(), and url_internal_data::visits.
Referenced by browser_window_callback(), and browser_window_content_ready().