Always use WebKit's session in KatzeNet

This fixes corruption of expiration dates.
This commit is contained in:
Enrico Tröger 2009-03-31 18:20:31 +02:00 committed by Christian Dywan
parent dbc4c3f743
commit 529aadc648
3 changed files with 4 additions and 14 deletions

View file

@ -16,6 +16,7 @@
#include "katze-net.h"
#include <libsoup/soup.h>
#include <webkit/webkit.h>
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

View file

@ -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

View file

@ -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"));