[hackers] [surf] session gets set properly in setup() || Enno Boland (tox)

From: <hg_AT_suckless.org>
Date: Wed, 10 Mar 2010 20:38:14 +0000 (UTC)

changeset: 178:36f57673edf0
tag: tip
user: Enno Boland (tox) <tox_AT_s01.de>
date: Wed Mar 10 21:38:07 2010 +0100
files: surf.c
description:
session gets set properly in setup()

diff -r 688bf1f96927 -r 36f57673edf0 surf.c
--- a/surf.c Mon Mar 08 10:06:32 2010 +0100
+++ b/surf.c Wed Mar 10 21:38:07 2010 +0100
@@ -56,7 +56,6 @@
 
 static Display *dpy;
 static Atom uriprop, findprop;
-static SoupSession *session;
 static Client *clients = NULL;
 static GdkNativeWindow embed = 0;
 static gboolean showxid = FALSE;
@@ -553,13 +552,18 @@
         return c;
 }
 
+void func(const char *name, const char *value, void *dummy) {
+printf("%s = %s\n", name, value);
+}
+
+
 static void newrequest(WebKitWebView *v, WebKitWebFrame *f, WebKitWebResource *r, WebKitNetworkRequest *req, WebKitNetworkResponse *res, Client *c) {
         SoupMessage *msg = webkit_network_request_get_message(req);
         SoupMessageHeaders *h;
         if(!msg)
                 return;
         h = msg->request_headers;
- soup_message_headers_remove(h, "Cookies");
+ soup_message_headers_foreach(h, func, NULL);
 }
 
 void
@@ -675,10 +679,10 @@
 
 void
 setup(void) {
- SoupSession *s;
         char *proxy;
         char *new_proxy;
         SoupURI *puri;
+ SoupSession *s;
 
         /* clean up any zombies immediately */
         sigchld(0);
@@ -687,7 +691,7 @@
                 g_thread_init(NULL);
 
         dpy = GDK_DISPLAY();
- session = webkit_get_default_session();
+ s = webkit_get_default_session();
         uriprop = XInternAtom(dpy, "_SURF_URI", False);
         findprop = XInternAtom(dpy, "_SURF_FIND", False);
 
@@ -697,6 +701,10 @@
         scriptfile = buildpath(scriptfile);
         stylefile = buildpath(stylefile);
 
+ s = webkit_get_default_session();
+
+ soup_session_remove_feature_by_type(s, soup_cookie_get_type());
+
         /* proxy */
         if((proxy = getenv("http_proxy")) && strcmp(proxy, "")) {
                 new_proxy = g_strrstr(proxy, "http://") ? g_strdup(proxy) :
Received on Wed Mar 10 2010 - 20:38:14 UTC

This archive was generated by hypermail 2.2.0 : Wed Mar 10 2010 - 20:48:17 UTC