Always use WebKit's session in KatzeNet
This fixes corruption of expiration dates.
This commit is contained in:
parent
dbc4c3f743
commit
529aadc648
3 changed files with 4 additions and 14 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include "katze-net.h"
|
#include "katze-net.h"
|
||||||
|
|
||||||
#include <libsoup/soup.h>
|
#include <libsoup/soup.h>
|
||||||
|
#include <webkit/webkit.h>
|
||||||
|
|
||||||
struct _KatzeNet
|
struct _KatzeNet
|
||||||
{
|
{
|
||||||
|
@ -57,16 +58,12 @@ katze_net_object_maybe_unref (gpointer object)
|
||||||
static void
|
static void
|
||||||
katze_net_init (KatzeNet* net)
|
katze_net_init (KatzeNet* net)
|
||||||
{
|
{
|
||||||
static SoupSession* session = NULL;
|
|
||||||
|
|
||||||
net->memory = g_hash_table_new_full (g_str_hash, g_str_equal,
|
net->memory = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||||
g_free, katze_net_object_maybe_unref);
|
g_free, katze_net_object_maybe_unref);
|
||||||
net->cache_path = g_build_filename (g_get_user_cache_dir (),
|
net->cache_path = g_build_filename (g_get_user_cache_dir (),
|
||||||
PACKAGE_NAME, NULL);
|
PACKAGE_NAME, NULL);
|
||||||
|
|
||||||
if (!session)
|
net->session = webkit_get_default_session ();
|
||||||
session = soup_session_async_new ();
|
|
||||||
net->session = session;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -10,5 +10,5 @@ obj.target = 'katze'
|
||||||
obj.includes = '. ../.'
|
obj.includes = '. ../.'
|
||||||
obj.find_sources_in_dirs ('.')
|
obj.find_sources_in_dirs ('.')
|
||||||
obj.add_marshal_file ('marshal.list', 'katze_cclosure_marshal')
|
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
|
obj.install_path = None
|
||||||
|
|
|
@ -1122,19 +1122,13 @@ midori_load_cookie_jar (gpointer data)
|
||||||
{
|
{
|
||||||
MidoriWebSettings* settings = MIDORI_WEB_SETTINGS (data);
|
MidoriWebSettings* settings = MIDORI_WEB_SETTINGS (data);
|
||||||
SoupSession* webkit_session;
|
SoupSession* webkit_session;
|
||||||
KatzeNet* net;
|
|
||||||
SoupSession* s_session;
|
|
||||||
SoupCookieJar* jar;
|
SoupCookieJar* jar;
|
||||||
|
|
||||||
webkit_session = webkit_get_default_session ();
|
webkit_session = webkit_get_default_session ();
|
||||||
net = katze_net_new ();
|
|
||||||
s_session = katze_net_get_session (net);
|
|
||||||
jar = soup_cookie_jar_new ();
|
jar = soup_cookie_jar_new ();
|
||||||
g_object_set_data (G_OBJECT (jar), "midori-settings", settings);
|
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);
|
midori_soup_session_prepare (webkit_session, jar, settings);
|
||||||
g_object_unref (jar);
|
g_object_unref (jar);
|
||||||
g_object_unref (net);
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1373,8 +1367,7 @@ main (int argc,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* libSoup uses threads, therefore if WebKit is built with libSoup
|
/* libSoup uses threads, so we need to initialize threads. */
|
||||||
or Midori is using it, we need to initialize threads. */
|
|
||||||
if (!g_thread_supported ()) g_thread_init (NULL);
|
if (!g_thread_supported ()) g_thread_init (NULL);
|
||||||
sokoke_register_stock_items ();
|
sokoke_register_stock_items ();
|
||||||
g_set_application_name (_("Midori"));
|
g_set_application_name (_("Midori"));
|
||||||
|
|
Loading…
Reference in a new issue