Hi all,

thank you for all the great software!

Attached is a patch to turn off cookies in surf.

Thank you,

Tomas

>From 3de76376da8ba7533a9af0559d7594060f2eb606 Mon Sep 17 00:00:00 2001
From: Tomas Hlavaty <t...@logand.com>
Date: Tue, 29 Nov 2011 00:15:28 +0100
Subject: [dev][surf] -c command-line option to turn off cookies


Signed-off-by: Tomas Hlavaty <t...@logand.com>
---
 surf.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/surf.c b/surf.c
index baebe5c..4639e04 100644
--- a/surf.c
+++ b/surf.c
@@ -62,7 +62,7 @@ static GdkNativeWindow embed = 0;
 static gboolean showxid = FALSE;
 static char winid[64];
 static char *progname;
-static gboolean loadimage = 1, plugin = 1, script = 1;
+static gboolean loadimage = 1, plugin = 1, script = 1, cookie = 1;
 
 static char *buildpath(const char *path);
 static void cleanup(void);
@@ -557,9 +557,10 @@ newrequest(SoupSession *s, SoupMessage *msg, gpointer v) {
 
 	soup_message_headers_remove(h, "Cookie");
 	uri = soup_message_get_uri(msg);
-	if((c = getcookies(uri)))
+	if(cookie && (c = getcookies(uri)))
 		soup_message_headers_append(h, "Cookie", c);
-	g_signal_connect_after(G_OBJECT(msg), "got-headers", G_CALLBACK(gotheaders), NULL);
+	if(cookie)
+		g_signal_connect_after(G_OBJECT(msg), "got-headers", G_CALLBACK(gotheaders), NULL);
 }
 
 void
@@ -863,6 +864,9 @@ main(int argc, char *argv[]) {
 		case 's':
 			script = 0;
 			break;
+		case 'c':
+			cookie = 0;
+			break;
 		case 'x':
 			showxid = TRUE;
 			break;
-- 
1.7.0.4

Reply via email to