about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--about.c5
-rw-r--r--xombrero.c14
-rw-r--r--xombrero.h9
3 files changed, 5 insertions, 23 deletions
diff --git a/about.c b/about.c
index 6fb9ef0..9e957f3 100644
--- a/about.c
+++ b/about.c
@@ -849,7 +849,6 @@ xtp_handle_sv(struct tab *t, uint8_t cmd, int id, const char *query)
 	SoupURI			*soupuri = NULL;
 	struct karg		args = {0};
 	struct secviolation	find, *sv;
-	struct sv_ignore	*svi = NULL;
 
 	find.xtp_arg = id;
 	if ((sv = RB_FIND(secviolation_list, &svl, &find)) == NULL)
@@ -875,9 +874,7 @@ xtp_handle_sv(struct tab *t, uint8_t cmd, int id, const char *query)
 		break;
 	case XT_XTP_SV_ALLOW_SESSION:
 		soupuri = soup_uri_new(sv->uri);
-		svi = malloc(sizeof(struct sv_ignore));
-		svi->domain = g_strdup(soupuri->host);
-		RB_INSERT(sv_ignore_list, &svil, svi);
+		wl_add(soupuri->host, &svil, 0);
 		load_uri(t, sv->uri);
 		focus_webview(t);
 		break;
diff --git a/xombrero.c b/xombrero.c
index b2acbdd..298050a 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -217,6 +217,7 @@ struct domain_list	c_wl;
 struct domain_list	js_wl;
 struct domain_list	pl_wl;
 struct domain_list	force_https;
+struct domain_list	svil;
 struct strict_transport_tree	st_tree;
 struct undo_tailq	undos;
 struct keybinding_list	kbl;
@@ -230,7 +231,6 @@ struct command_list	shl;
 struct command_entry	*history_at;
 struct command_entry	*search_at;
 struct secviolation_list	svl;
-struct sv_ignore_list	svil;
 struct set_reject_list	srl;
 int			undo_count;
 int			cmd_history_count = 0;
@@ -707,13 +707,6 @@ secviolation_rb_cmp(struct secviolation *s1, struct secviolation *s2)
 RB_GENERATE(secviolation_list, secviolation, entry, secviolation_rb_cmp);
 
 int
-sv_ignore_rb_cmp(struct sv_ignore *s1, struct sv_ignore *s2)
-{
-	return (strcmp(s1->domain, s2->domain));
-}
-RB_GENERATE(sv_ignore_list, sv_ignore, entry, sv_ignore_rb_cmp);
-
-int
 user_agent_rb_cmp(struct user_agent *ua1, struct user_agent *ua2)
 {
 	return (ua1->id < ua2->id ? -1 : ua1->id > ua2->id);
@@ -2166,7 +2159,7 @@ check_cert_changes(struct tab *t, const char *uri)
 {
 	SoupURI			*soupuri = NULL;
 	struct karg		args = {0};
-	struct sv_ignore	find;
+	struct domain		*d = NULL;
 	const char		*errstr = NULL;
 	struct karg		*argsp;
 
@@ -2187,8 +2180,7 @@ check_cert_changes(struct tab *t, const char *uri)
 		if ((soupuri = soup_uri_new(uri)) == NULL ||
 		    soupuri->host == NULL)
 			break;
-		find.domain = soupuri->host;
-		if (RB_FIND(sv_ignore_list, &svil, &find))
+		if ((d = wl_find(soupuri->host, &svil)) != NULL)
 			break;
 		t->xtp_meaning = XT_XTP_TAB_MEANING_SV;
 		argsp = g_malloc0(sizeof(struct karg));
diff --git a/xombrero.h b/xombrero.h
index 827eb07..a48bcf2 100644
--- a/xombrero.h
+++ b/xombrero.h
@@ -342,13 +342,6 @@ struct secviolation {
 RB_HEAD(secviolation_list, secviolation);
 RB_PROTOTYPE(secviolation_list, secviolation, entry, secviolation_rb_cmp);
 
-struct sv_ignore {
-	RB_ENTRY(sv_ignore)	entry;
-	char			*domain;
-};
-RB_HEAD(sv_ignore_list, sv_ignore);
-RB_PROTOTYPE(sv_ignore_list, sv_ignore, entry, sv_ignore_rb_cmp);
-
 struct user_agent {
 	RB_ENTRY(user_agent)	entry;
 	int			id;
@@ -948,6 +941,7 @@ extern struct domain_list	c_wl;
 extern struct domain_list	js_wl;
 extern struct domain_list	pl_wl;
 extern struct domain_list	force_https;
+extern struct domain_list	svil;
 extern struct strict_transport_tree	st_tree;
 extern struct alias_list	aliases;
 extern struct mime_type_list	mtl;
@@ -958,7 +952,6 @@ extern struct http_accept_list	ha_list;
 extern struct cmd_alias_list	cal;
 extern struct custom_uri_list	cul;
 extern struct secviolation_list	svl;
-extern struct sv_ignore_list	svil;
 extern struct set_reject_list	srl;
 extern struct settings		rs[];