about summary refs log tree commit diff stats
path: root/xxxterm.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2010-12-23 19:44:25 +0000
committerMarco Peereboom <marco@conformal.com>2010-12-23 19:44:25 +0000
commit8ecbd6e22b341c5cff81721f78971596469755d7 (patch)
tree08c6d290a4ada62cce0d036e1689cd17a0a15f3b /xxxterm.c
parent0d80a4257c2fab32ef8781081a81b1083eb2255a (diff)
downloadxombrero-8ecbd6e22b341c5cff81721f78971596469755d7.tar.gz
add some xtp bits for cookielist
Diffstat (limited to 'xxxterm.c')
-rw-r--r--xxxterm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 55a3efa..38f19a9 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -366,6 +366,7 @@ int			cookie_policy = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
 	"%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
 char			*dl_session_key;	/* downloads */
 char			*hl_session_key;	/* history list */
+char			*cl_session_key;	/* cookie list */
 
 char			*home = "http://www.peereboom.us";
 char			*search_string = NULL;
@@ -1660,7 +1661,7 @@ show_cookies(struct tab *t, struct karg *args)
 
 	/* Generate a new session key */
 	if (!updating_hl_tabs)
-		generate_xtp_session_key(&hl_session_key);
+		generate_xtp_session_key(&cl_session_key);
 
 	/* header */
 	header = g_strdup_printf(XT_DOCTYPE XT_HTML_TAG "\n<head>"
@@ -1711,7 +1712,7 @@ show_cookies(struct tab *t, struct karg *args)
 
 		    XT_XTP_STR,
 		    XT_XTP_CL,
-		    hl_session_key,
+		    cl_session_key,
 		    XT_XTP_CL_REMOVE,
 		    i++
 		    );
@@ -2371,9 +2372,17 @@ parse_xtp_url(struct tab *t, const char *url)
 		hl_ctrl(t, atoi(tokens[2]), atoi(tokens[3]));
 
 		break;
+	case XT_XTP_CL:
+		/* validate session key */
+		if (!validate_xtp_session_key(cl_session_key, tokens[1])) {
+			warn("%s: invalid history session key", __func__);
+			return (1);
+		}
 
+		fprintf(stderr, "omg do something to a cookie\n");
+		break;
 	default:/* unsupported class */
-		warn("%s: unsupported class: %s", __func__, tokens[0]);
+		warnx("%s: unsupported class: %s", __func__, tokens[0]);
 		break;
 	}
 
@@ -3661,6 +3670,7 @@ main(int argc, char *argv[])
 	/* generate session keys for xtp pages */
 	generate_xtp_session_key(&dl_session_key);
 	generate_xtp_session_key(&hl_session_key);
+	generate_xtp_session_key(&cl_session_key);
 
 	/* prepare gtk */
 	gtk_init(&argc, &argv);