From 529aadc6485da81064198740cdb137bd3de32fc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Enrico=20Tr=C3=B6ger?= Date: Tue, 31 Mar 2009 18:20:31 +0200 Subject: [PATCH] Always use WebKit's session in KatzeNet This fixes corruption of expiration dates. --- katze/katze-net.c | 7 ++----- katze/wscript_build | 2 +- midori/main.c | 9 +-------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/katze/katze-net.c b/katze/katze-net.c index b6485344..c699026d 100644 --- a/katze/katze-net.c +++ b/katze/katze-net.c @@ -16,6 +16,7 @@ #include "katze-net.h" #include +#include struct _KatzeNet { @@ -57,16 +58,12 @@ katze_net_object_maybe_unref (gpointer object) static void katze_net_init (KatzeNet* net) { - static SoupSession* session = NULL; - net->memory = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, katze_net_object_maybe_unref); net->cache_path = g_build_filename (g_get_user_cache_dir (), PACKAGE_NAME, NULL); - if (!session) - session = soup_session_async_new (); - net->session = session; + net->session = webkit_get_default_session (); } static void diff --git a/katze/wscript_build b/katze/wscript_build index 52c282dd..9dbf09e3 100644 --- a/katze/wscript_build +++ b/katze/wscript_build @@ -10,5 +10,5 @@ obj.target = 'katze' obj.includes = '. ../.' obj.find_sources_in_dirs ('.') obj.add_marshal_file ('marshal.list', 'katze_cclosure_marshal') -obj.uselib = 'M GMODULE LIBSOUP GTK LIBXML' +obj.uselib = 'M GMODULE LIBSOUP GTK LIBXML WEBKIT' obj.install_path = None diff --git a/midori/main.c b/midori/main.c index 580e54f1..c5e8ccac 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1122,19 +1122,13 @@ midori_load_cookie_jar (gpointer data) { MidoriWebSettings* settings = MIDORI_WEB_SETTINGS (data); SoupSession* webkit_session; - KatzeNet* net; - SoupSession* s_session; SoupCookieJar* jar; webkit_session = webkit_get_default_session (); - net = katze_net_new (); - s_session = katze_net_get_session (net); jar = soup_cookie_jar_new (); g_object_set_data (G_OBJECT (jar), "midori-settings", settings); - midori_soup_session_prepare (s_session, jar, settings); midori_soup_session_prepare (webkit_session, jar, settings); g_object_unref (jar); - g_object_unref (net); return FALSE; } @@ -1373,8 +1367,7 @@ main (int argc, return 1; } - /* libSoup uses threads, therefore if WebKit is built with libSoup - or Midori is using it, we need to initialize threads. */ + /* libSoup uses threads, so we need to initialize threads. */ if (!g_thread_supported ()) g_thread_init (NULL); sokoke_register_stock_items (); g_set_application_name (_("Midori")); -- 2.39.5