Merge lp:~kalikiana/midori/cookieswk2 into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: André Stösel
Approved revision: 6268
Merged at revision: 6295
Proposed branch: lp:~kalikiana/midori/cookieswk2
Merge into: lp:midori
Diff against target: 1069 lines (+82/-766)
11 files modified
extensions/cookie-manager/cookie-manager.c (+10/-2)
extensions/wscript_build (+1/-1)
katze/katze-http-cookies-sqlite.c (+0/-292)
katze/katze-http-cookies-sqlite.h (+0/-42)
katze/katze-http-cookies.c (+0/-331)
katze/katze-http-cookies.h (+0/-42)
katze/katze.h (+0/-2)
midori/midori-frontend.c (+0/-5)
midori/midori-privatedata.c (+11/-10)
midori/midori-session.c (+59/-38)
wscript (+1/-1)
To merge this branch: bzr merge lp:~kalikiana/midori/cookieswk2
Reviewer Review Type Date Requested Status
André Stösel Approve
Review via email: mp+174885@code.launchpad.net

Commit message

WebKit2 cookie support

To post a comment you must log in.
lp:~kalikiana/midori/cookieswk2 updated
6267. By Cris Dywan

Move gchar* cache and disable cookie/ session callbacks

6268. By Cris Dywan

Unblock cookie manager from WebKit2 build

Revision history for this message
Cris Dywan (kalikiana) wrote :

As the question come up in IRC: the cookie manager does show cookies. It won't yet update in real-time. I haven't made up my mind what the best approach is since the WebKit2 API has a "changed" signal but doesn't say what happens…

Revision history for this message
André Stösel (ivaldi) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'extensions/cookie-manager/cookie-manager.c'
--- extensions/cookie-manager/cookie-manager.c 2013-02-21 21:36:30 +0000
+++ extensions/cookie-manager/cookie-manager.c 2013-07-29 21:07:25 +0000
@@ -12,6 +12,7 @@
12#include "config.h"12#include "config.h"
13#include <midori/midori.h>13#include <midori/midori.h>
14#include "katze/katze.h"14#include "katze/katze.h"
15#include <libsoup/soup-cookie-jar-sqlite.h>
1516
16#include "cookie-manager.h"17#include "cookie-manager.h"
17#include "cookie-manager-page.h"18#include "cookie-manager-page.h"
@@ -259,6 +260,7 @@
259260
260 g_object_unref(priv->store);261 g_object_unref(priv->store);
261 g_free(priv->filter_text);262 g_free(priv->filter_text);
263 g_object_unref(priv->jar);
262264
263 G_OBJECT_CLASS(cookie_manager_parent_class)->finalize(object);265 G_OBJECT_CLASS(cookie_manager_parent_class)->finalize(object);
264}266}
@@ -267,7 +269,6 @@
267static void cookie_manager_init(CookieManager *self)269static void cookie_manager_init(CookieManager *self)
268{270{
269 CookieManagerPrivate *priv;271 CookieManagerPrivate *priv;
270 SoupSession *session;
271272
272 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,273 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
273 COOKIE_MANAGER_TYPE, CookieManagerPrivate);274 COOKIE_MANAGER_TYPE, CookieManagerPrivate);
@@ -279,8 +280,15 @@
279 COOKIE_MANAGER_COL_NAME, GTK_SORT_ASCENDING);280 COOKIE_MANAGER_COL_NAME, GTK_SORT_ASCENDING);
280281
281 /* setup soup */282 /* setup soup */
282 session = webkit_get_default_session();283#ifdef HAVE_WEBKIT2
284 gchar *filename = midori_paths_get_config_filename_for_writing ("cookies.db");
285 priv->jar = soup_cookie_jar_sqlite_new (filename, FALSE);
286 g_free(filename);
287#else
288 SoupSession *session = webkit_get_default_session();
283 priv->jar = SOUP_COOKIE_JAR(soup_session_get_feature(session, soup_cookie_jar_get_type()));289 priv->jar = SOUP_COOKIE_JAR(soup_session_get_feature(session, soup_cookie_jar_get_type()));
290 g_object_ref(priv->jar);
291#endif
284 g_signal_connect(priv->jar, "changed", G_CALLBACK(cookie_manager_jar_changed_cb), self);292 g_signal_connect(priv->jar, "changed", G_CALLBACK(cookie_manager_jar_changed_cb), self);
285293
286 cookie_manager_refresh_store(self);294 cookie_manager_refresh_store(self);
287295
=== modified file 'extensions/wscript_build'
--- extensions/wscript_build 2013-06-03 19:37:36 +0000
+++ extensions/wscript_build 2013-07-29 21:07:25 +0000
@@ -32,7 +32,7 @@
32 source = extension32 source = extension
3333
34 # FIXME34 # FIXME
35 if bld.env['HAVE_WEBKIT2'] and target in ['external-download-manager', 'nsplugin-manager', 'formhistory', 'adblock', 'cookie-permissions', 'addons', 'cookie-manager']:35 if bld.env['HAVE_WEBKIT2'] and target in ['external-download-manager', 'nsplugin-manager', 'formhistory', 'adblock', 'cookie-permissions', 'addons']:
36 continue36 continue
3737
38 obj = bld.new_task_gen ('cc', 'shlib')38 obj = bld.new_task_gen ('cc', 'shlib')
3939
=== removed file 'katze/katze-http-cookies-sqlite.c'
--- katze/katze-http-cookies-sqlite.c 2012-07-19 19:14:09 +0000
+++ katze/katze-http-cookies-sqlite.c 1970-01-01 00:00:00 +0000
@@ -1,292 +0,0 @@
1/*
2 Copyright (C) 2008-2010 Christian Dywan <christian@twotoasts.de>
3 Copyright (C) 2011 Alexander Butenko <a.butenka@gmail.com>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 See the file COPYING for the full license text.
11*/
12
13#if HAVE_CONFIG_H
14 #include <config.h>
15#endif
16
17#include "katze-http-cookies-sqlite.h"
18
19#include <stdlib.h>
20#ifdef HAVE_UNISTD_H
21 #include <unistd.h>
22#endif
23#include <glib/gi18n.h>
24#include <libsoup/soup.h>
25#include <gtk/gtk.h>
26#include <glib/gstdio.h>
27#include <sqlite3.h>
28
29#define QUERY_ALL "SELECT id, name, value, host, path, expiry, lastAccessed, isSecure, isHttpOnly FROM moz_cookies;"
30#define CREATE_TABLE "CREATE TABLE IF NOT EXISTS moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER)"
31#define QUERY_INSERT "INSERT INTO moz_cookies VALUES(NULL, %Q, %Q, %Q, %Q, %d, NULL, %d, %d);"
32#define QUERY_DELETE "DELETE FROM moz_cookies WHERE name=%Q AND host=%Q;"
33
34enum {
35 COL_ID,
36 COL_NAME,
37 COL_VALUE,
38 COL_HOST,
39 COL_PATH,
40 COL_EXPIRY,
41 COL_LAST_ACCESS,
42 COL_SECURE,
43 COL_HTTP_ONLY,
44 N_COL,
45};
46
47struct _KatzeHttpCookiesSqlite
48{
49 GObject parent_instance;
50 gchar* filename;
51 SoupCookieJar* jar;
52 sqlite3 *db;
53 guint counter;
54};
55
56struct _KatzeHttpCookiesSqliteClass
57{
58 GObjectClass parent_class;
59};
60
61static void
62katze_http_cookies_sqlite_session_feature_iface_init (SoupSessionFeatureInterface *iface,
63 gpointer data);
64
65G_DEFINE_TYPE_WITH_CODE (KatzeHttpCookiesSqlite, katze_http_cookies_sqlite, G_TYPE_OBJECT,
66 G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE,
67 katze_http_cookies_sqlite_session_feature_iface_init));
68
69/* Cookie jar saving into sqlite database
70 Copyright (C) 2008 Diego Escalante Urrelo
71 Copyright (C) 2009 Collabora Ltd.
72 Mostly copied from libSoup 2.30, coding style retained */
73
74/* Follows sqlite3 convention; returns TRUE on error */
75static gboolean
76katze_http_cookies_sqlite_open_db (KatzeHttpCookiesSqlite* http_cookies)
77{
78 char *error = NULL;
79
80 if (sqlite3_open (http_cookies->filename, &http_cookies->db)) {
81 sqlite3_close (http_cookies->db);
82 g_warning ("Can't open %s", http_cookies->filename);
83 return TRUE;
84 }
85
86 if (sqlite3_exec (http_cookies->db, CREATE_TABLE, NULL, NULL, &error)) {
87 g_warning ("Failed to execute query: %s", error);
88 sqlite3_free (error);
89 }
90
91 if (sqlite3_exec (http_cookies->db, "PRAGMA secure_delete = 1;",
92 NULL, NULL, &error)) {
93 g_warning ("Failed to execute query: %s", error);
94 sqlite3_free (error);
95 }
96
97 sqlite3_exec (http_cookies->db,
98 /* Arguably cookies are like a cache, so performance over integrity */
99 "PRAGMA synchronous = OFF; PRAGMA temp_store = MEMORY;"
100 "PRAGMA count_changes = OFF; PRAGMA journal_mode = TRUNCATE;",
101 NULL, NULL, &error);
102
103 return FALSE;
104}
105
106static void
107katze_http_cookies_sqlite_load (KatzeHttpCookiesSqlite* http_cookies)
108{
109 const char *name, *value, *host, *path;
110 sqlite3_stmt* stmt;
111 SoupCookie *cookie = NULL;
112 gint64 expire_time;
113 time_t now;
114 int max_age;
115 gboolean http_only = FALSE, secure = FALSE;
116 char *query;
117 int result;
118
119 if (http_cookies->db == NULL) {
120 if (katze_http_cookies_sqlite_open_db (http_cookies))
121 return;
122 }
123
124 sqlite3_prepare_v2 (http_cookies->db, QUERY_ALL, strlen (QUERY_ALL) + 1, &stmt, NULL);
125 result = sqlite3_step (stmt);
126 if (result != SQLITE_ROW)
127 {
128 if (result == SQLITE_ERROR)
129 g_print (_("Failed to load cookies\n"));
130 sqlite3_reset (stmt);
131 return;
132 }
133
134 while (result == SQLITE_ROW)
135 {
136 now = time (NULL);
137 name = (const char*)sqlite3_column_text (stmt, COL_NAME);
138 value = (const char*)sqlite3_column_text (stmt, COL_VALUE);
139 host = (const char*)sqlite3_column_text (stmt, COL_HOST);
140 path = (const char*)sqlite3_column_text (stmt, COL_PATH);
141 expire_time = sqlite3_column_int64 (stmt,COL_EXPIRY);
142 secure = sqlite3_column_int (stmt, COL_SECURE);
143 http_only = sqlite3_column_int (stmt, COL_HTTP_ONLY);
144
145 if (now >= expire_time)
146 {
147 /* Cookie expired, remove it from database */
148 query = sqlite3_mprintf (QUERY_DELETE, name, host);
149 sqlite3_exec (http_cookies->db, QUERY_DELETE, NULL, NULL, NULL);
150 sqlite3_free (query);
151 result = sqlite3_step (stmt);
152 continue;
153 }
154 max_age = (expire_time - now <= G_MAXINT ? expire_time - now : G_MAXINT);
155 cookie = soup_cookie_new (name, value, host, path, max_age);
156
157 if (secure)
158 soup_cookie_set_secure (cookie, TRUE);
159 if (http_only)
160 soup_cookie_set_http_only (cookie, TRUE);
161
162 soup_cookie_jar_add_cookie (http_cookies->jar, cookie);
163 result = sqlite3_step (stmt);
164 }
165
166 if (stmt)
167 {
168 sqlite3_reset (stmt);
169 sqlite3_clear_bindings (stmt);
170 }
171}
172static void
173katze_http_cookies_sqlite_jar_changed_cb (SoupCookieJar* jar,
174 SoupCookie* old_cookie,
175 SoupCookie* new_cookie,
176 KatzeHttpCookiesSqlite* http_cookies)
177{
178 GObject* settings;
179 char *query;
180 time_t expires = 0; /* Avoid warning */
181
182 if (http_cookies->db == NULL) {
183 if (katze_http_cookies_sqlite_open_db (http_cookies))
184 return;
185 }
186
187 if (new_cookie && new_cookie->expires)
188 {
189 gint age;
190
191 expires = soup_date_to_time_t (new_cookie->expires);
192 settings = g_object_get_data (G_OBJECT (jar), "midori-settings");
193 age = katze_object_get_int (settings, "maximum-cookie-age");
194 if (age > 0)
195 {
196 SoupDate* max_date = soup_date_new_from_now (
197 age * SOUP_COOKIE_MAX_AGE_ONE_DAY);
198 if (soup_date_to_time_t (new_cookie->expires)
199 > soup_date_to_time_t (max_date))
200 soup_cookie_set_expires (new_cookie, max_date);
201 }
202 else
203 {
204 /* An age of 0 to SoupCookie means already-expired
205 A user choosing 0 days probably expects 1 hour. */
206 soup_cookie_set_max_age (new_cookie, SOUP_COOKIE_MAX_AGE_ONE_HOUR);
207 }
208 }
209
210 if (!g_strcmp0 (g_getenv ("MIDORI_DEBUG"), "cookies"))
211 http_cookies->counter++;
212
213 if (old_cookie) {
214 query = sqlite3_mprintf (QUERY_DELETE,
215 old_cookie->name,
216 old_cookie->domain);
217 sqlite3_exec (http_cookies->db, query, NULL, NULL, NULL);
218 sqlite3_free (query);
219 }
220
221 if (new_cookie && new_cookie->expires) {
222
223 query = sqlite3_mprintf (QUERY_INSERT,
224 new_cookie->name,
225 new_cookie->value,
226 new_cookie->domain,
227 new_cookie->path,
228 expires,
229 new_cookie->secure,
230 new_cookie->http_only);
231 sqlite3_exec (http_cookies->db, query, NULL, NULL, NULL);
232 sqlite3_free (query);
233 }
234}
235
236static void
237katze_http_cookies_sqlite_attach (SoupSessionFeature* feature,
238 SoupSession* session)
239{
240 KatzeHttpCookiesSqlite* http_cookies = (KatzeHttpCookiesSqlite*)feature;
241 const gchar* filename = g_object_get_data (G_OBJECT (feature), "filename");
242 SoupSessionFeature* jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
243 g_return_if_fail (jar != NULL);
244 g_return_if_fail (filename != NULL);
245 katze_assign (http_cookies->filename, g_strdup (filename));
246 http_cookies->jar = g_object_ref (jar);
247 katze_http_cookies_sqlite_open_db (http_cookies);
248 katze_http_cookies_sqlite_load (http_cookies);
249 g_signal_connect (jar, "changed",
250 G_CALLBACK (katze_http_cookies_sqlite_jar_changed_cb), feature);
251
252}
253
254static void
255katze_http_cookies_sqlite_detach (SoupSessionFeature* feature,
256 SoupSession* session)
257{
258 KatzeHttpCookiesSqlite* http_cookies = (KatzeHttpCookiesSqlite*)feature;
259 katze_assign (http_cookies->filename, NULL);
260 katze_object_assign (http_cookies->jar, NULL);
261 sqlite3_close (http_cookies->db);
262}
263
264static void
265katze_http_cookies_sqlite_session_feature_iface_init (SoupSessionFeatureInterface *iface,
266 gpointer data)
267{
268 iface->attach = katze_http_cookies_sqlite_attach;
269 iface->detach = katze_http_cookies_sqlite_detach;
270}
271
272static void
273katze_http_cookies_sqlite_finalize (GObject* object)
274{
275 katze_http_cookies_sqlite_detach ((SoupSessionFeature*)object, NULL);
276}
277
278static void
279katze_http_cookies_sqlite_class_init (KatzeHttpCookiesSqliteClass* class)
280{
281 GObjectClass* gobject_class = (GObjectClass*)class;
282 gobject_class->finalize = katze_http_cookies_sqlite_finalize;
283}
284
285static void
286katze_http_cookies_sqlite_init (KatzeHttpCookiesSqlite* http_cookies)
287{
288 http_cookies->filename = NULL;
289 http_cookies->jar = NULL;
290 http_cookies->db = NULL;
291 http_cookies->counter = 0;
292}
2930
=== removed file 'katze/katze-http-cookies-sqlite.h'
--- katze/katze-http-cookies-sqlite.h 2011-10-10 21:22:27 +0000
+++ katze/katze-http-cookies-sqlite.h 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1/*
2 Copyright (C) 2009 Christian Dywan <christian@twotoasts.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 See the file COPYING for the full license text.
10*/
11
12#ifndef __KATZE_HTTP_COOKIES_SQLITE_H__
13#define __KATZE_HTTP_COOKIES_SQLITE_H__
14
15#include "katze-utils.h"
16
17#include <glib-object.h>
18
19G_BEGIN_DECLS
20
21#define KATZE_TYPE_HTTP_COOKIES_SQLITE \
22 (katze_http_cookies_sqlite_get_type ())
23#define KATZE_HTTP_COOKIES_SQLITE(obj) \
24 (G_TYPE_CHECK_INSTANCE_CAST ((obj), KATZE_TYPE_HTTP_COOKIES_SQLITE, KatzeHttpCookiesSqlite))
25#define KATZE_HTTP_COOKIES_SQLITE_CLASS(klass) \
26 (G_TYPE_CHECK_CLASS_CAST ((klass), KATZE_TYPE_HTTP_COOKIES_SQLITE, KatzeHttpCookiesSqliteClass))
27#define KATZE_IS_HTTP_COOKIES_SQLITE(obj) \
28 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KATZE_TYPE_HTTP_COOKIES_SQLITE))
29#define KATZE_IS_HTTP_COOKIES_SQLITE_CLASS(klass) \
30 (G_TYPE_CHECK_CLASS_TYPE ((klass), KATZE_TYPE_HTTP_COOKIES_SQLITE))
31#define KATZE_HTTP_COOKIES_SQLITE_GET_CLASS(obj) \
32 (G_TYPE_INSTANCE_GET_CLASS ((obj), KATZE_TYPE_HTTP_COOKIES_SQLITE, KatzeHttpCookiesSqliteClass))
33
34typedef struct _KatzeHttpCookiesSqlite KatzeHttpCookiesSqlite;
35typedef struct _KatzeHttpCookiesSqliteClass KatzeHttpCookiesSqliteClass;
36
37GType
38katze_http_cookies_sqlite_get_type (void) G_GNUC_CONST;
39
40G_END_DECLS
41
42#endif /* __KATZE_HTTP_COOKIES_SQLITE_H__ */
430
=== removed file 'katze/katze-http-cookies.c'
--- katze/katze-http-cookies.c 2013-04-16 23:16:24 +0000
+++ katze/katze-http-cookies.c 1970-01-01 00:00:00 +0000
@@ -1,331 +0,0 @@
1/*
2 Copyright (C) 2008-2010 Christian Dywan <christian@twotoasts.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 See the file COPYING for the full license text.
10*/
11
12#if HAVE_CONFIG_H
13 #include <config.h>
14#endif
15
16#include "katze-http-cookies.h"
17#include "midori/midori-core.h"
18
19#include <stdlib.h>
20#ifdef HAVE_UNISTD_H
21 #include <unistd.h>
22#endif
23#include <glib/gi18n.h>
24#include <libsoup/soup.h>
25#include <gtk/gtk.h>
26#include <glib/gstdio.h>
27
28struct _KatzeHttpCookies
29{
30 GObject parent_instance;
31 gchar* filename;
32 SoupCookieJar* jar;
33 guint timeout;
34 guint counter;
35};
36
37struct _KatzeHttpCookiesClass
38{
39 GObjectClass parent_class;
40};
41
42static void
43katze_http_cookies_session_feature_iface_init (SoupSessionFeatureInterface *iface,
44 gpointer data);
45
46G_DEFINE_TYPE_WITH_CODE (KatzeHttpCookies, katze_http_cookies, G_TYPE_OBJECT,
47 G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE,
48 katze_http_cookies_session_feature_iface_init));
49
50/* Cookie jar saving to Mozilla format
51 Copyright (C) 2008 Xan Lopez <xan@gnome.org>
52 Copyright (C) 2008 Dan Winship <danw@gnome.org>
53 Mostly copied from libSoup 2.24, coding style adjusted */
54static SoupCookie*
55parse_cookie (gchar* line,
56 time_t now)
57{
58 gchar** result;
59 SoupCookie *cookie = NULL;
60 gboolean http_only;
61 time_t max_age;
62 gchar* host/*, *is_domain*/, *path, *secure, *expires, *name, *value;
63
64 if (g_str_has_prefix (line, "#HttpOnly_"))
65 {
66 http_only = TRUE;
67 line += strlen ("#HttpOnly_");
68 }
69 else if (*line == '#' || g_ascii_isspace (*line))
70 return cookie;
71 else
72 http_only = FALSE;
73
74 result = g_strsplit (line, "\t", -1);
75 if (g_strv_length (result) != 7)
76 goto out;
77
78 /* Check this first */
79 expires = result[4];
80 max_age = strtoul (expires, NULL, 10) - now;
81 if (max_age <= 0)
82 goto out;
83
84 host = result[0];
85 /* is_domain = result[1]; */
86 path = result[2];
87 secure = result[3];
88
89 name = result[5];
90 value = result[6];
91
92 cookie = soup_cookie_new (name, value, host, path, max_age);
93
94 if (strcmp (secure, "FALSE"))
95 soup_cookie_set_secure (cookie, TRUE);
96 if (http_only)
97 soup_cookie_set_http_only (cookie, TRUE);
98
99 out:
100 g_strfreev (result);
101
102 return cookie;
103}
104
105/* Cookie jar saving to Mozilla format
106 Copyright (C) 2008 Xan Lopez <xan@gnome.org>
107 Copyright (C) 2008 Dan Winship <danw@gnome.org>
108 Mostly copied from libSoup 2.24, coding style adjusted */
109static void
110parse_line (SoupCookieJar* jar,
111 gchar* line,
112 time_t now)
113{
114 SoupCookie* cookie;
115
116 if ((cookie = parse_cookie (line, now)))
117 soup_cookie_jar_add_cookie (jar, cookie);
118}
119
120/* Cookie jar saving to Mozilla format
121 Copyright (C) 2008 Xan Lopez <xan@gnome.org>
122 Copyright (C) 2008 Dan Winship <danw@gnome.org>
123 Mostly copied from libSoup 2.24, coding style adjusted */
124static void
125cookie_jar_load (SoupCookieJar* jar,
126 const gchar* filename)
127{
128 char* contents = NULL;
129 gchar* line;
130 gchar* p;
131 gsize length = 0;
132 time_t now;
133
134 if (!g_file_get_contents (filename, &contents, &length, NULL))
135 return;
136
137 now = time (NULL);
138 line = contents;
139 for (p = contents; *p; p++)
140 {
141 /* \r\n comes out as an extra empty line and gets ignored */
142 if (*p == '\r' || *p == '\n')
143 {
144 *p = '\0';
145 parse_line (jar, line, now);
146 line = p + 1;
147 }
148 }
149 parse_line (jar, line, now);
150
151 g_free (contents);
152}
153
154/* Cookie jar saving to Mozilla format
155 Copyright (C) 2008 Xan Lopez <xan@gnome.org>
156 Copyright (C) 2008 Dan Winship <danw@gnome.org>
157 Copied from libSoup 2.24, coding style preserved */
158static gboolean
159write_cookie (FILE *out, SoupCookie *cookie)
160{
161 if (fprintf (out, "%s%s\t%s\t%s\t%s\t%lu\t%s\t%s\n",
162 cookie->http_only ? "#HttpOnly_" : "",
163 cookie->domain,
164 *cookie->domain == '.' ? "TRUE" : "FALSE",
165 cookie->path,
166 cookie->secure ? "TRUE" : "FALSE",
167 (gulong)soup_date_to_time_t (cookie->expires),
168 cookie->name,
169 cookie->value) < 0)
170 return FALSE;
171 return TRUE;
172}
173
174static gboolean
175katze_http_cookies_update_jar (KatzeHttpCookies* http_cookies)
176{
177 gint fn = 0;
178 FILE* f = NULL;
179 gchar* temporary_filename = NULL;
180 GSList* cookies;
181
182 if (http_cookies->timeout > 0)
183 {
184 g_source_remove (http_cookies->timeout);
185 http_cookies->timeout = 0;
186 }
187
188 temporary_filename = g_strconcat (http_cookies->filename, ".XXXXXX", NULL);
189 if ((fn = g_mkstemp (temporary_filename)) == -1)
190 goto failed;
191 if (!((f = fdopen (fn, "wb"))))
192 goto failed;
193
194 cookies = soup_cookie_jar_all_cookies (http_cookies->jar);
195 for (; cookies != NULL; cookies = g_slist_next (cookies))
196 {
197 SoupCookie* cookie = cookies->data;
198 if (cookie->expires && !soup_date_is_past (cookie->expires))
199 write_cookie (f, cookie);
200 soup_cookie_free (cookie);
201 }
202 g_slist_free (cookies);
203
204 if (fclose (f) != 0)
205 {
206 f = NULL;
207 goto failed;
208 }
209 f = NULL;
210
211 if (g_rename (temporary_filename, http_cookies->filename) == -1)
212 goto failed;
213 g_free (temporary_filename);
214
215 if (!g_strcmp0 (g_getenv ("MIDORI_DEBUG"), "cookies"))
216 {
217 g_print ("KatzeHttpCookies: %d cookies changed\n", http_cookies->counter);
218 http_cookies->counter = 0;
219 }
220 return FALSE;
221
222failed:
223 if (f)
224 fclose (f);
225 g_unlink (temporary_filename);
226 g_free (temporary_filename);
227 if (!g_strcmp0 (g_getenv ("MIDORI_DEBUG"), "cookies"))
228 g_print ("KatzeHttpCookies: Failed to write '%s'\n",
229 http_cookies->filename);
230 return FALSE;
231}
232
233static void
234katze_http_cookies_jar_changed_cb (SoupCookieJar* jar,
235 SoupCookie* old_cookie,
236 SoupCookie* new_cookie,
237 KatzeHttpCookies* http_cookies)
238{
239 GObject* settings;
240
241 if (old_cookie)
242 soup_cookie_set_max_age (old_cookie, 0);
243
244 if (new_cookie)
245 {
246 settings = g_object_get_data (G_OBJECT (jar), "midori-settings");
247 if (new_cookie->expires)
248 {
249 gint age = katze_object_get_int (settings, "maximum-cookie-age");
250 if (age > 0)
251 {
252 SoupDate* max_date = soup_date_new_from_now (
253 age * SOUP_COOKIE_MAX_AGE_ONE_DAY);
254 if (soup_date_to_time_t (new_cookie->expires)
255 > soup_date_to_time_t (max_date))
256 soup_cookie_set_expires (new_cookie, max_date);
257 }
258 else
259 {
260 /* An age of 0 to SoupCookie means already-expired
261 A user choosing 0 days probably expects 1 hour. */
262 soup_cookie_set_max_age (new_cookie, SOUP_COOKIE_MAX_AGE_ONE_HOUR);
263 }
264 }
265 }
266
267 if (!g_strcmp0 (g_getenv ("MIDORI_DEBUG"), "cookies"))
268 http_cookies->counter++;
269
270 if (!http_cookies->timeout && (old_cookie || (new_cookie && new_cookie->expires)))
271 http_cookies->timeout = midori_timeout_add_seconds (
272 5, (GSourceFunc)katze_http_cookies_update_jar, http_cookies, NULL);
273}
274
275static void
276katze_http_cookies_attach (SoupSessionFeature* feature,
277 SoupSession* session)
278{
279 KatzeHttpCookies* http_cookies = (KatzeHttpCookies*)feature;
280 const gchar* filename = g_object_get_data (G_OBJECT (feature), "filename");
281 SoupSessionFeature* jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
282 g_return_if_fail (jar != NULL);
283 g_return_if_fail (filename != NULL);
284 katze_assign (http_cookies->filename, g_strdup (filename));
285 http_cookies->jar = g_object_ref (jar);
286 cookie_jar_load (http_cookies->jar, http_cookies->filename);
287 g_signal_connect (jar, "changed",
288 G_CALLBACK (katze_http_cookies_jar_changed_cb), feature);
289
290}
291
292static void
293katze_http_cookies_detach (SoupSessionFeature* feature,
294 SoupSession* session)
295{
296 KatzeHttpCookies* http_cookies = (KatzeHttpCookies*)feature;
297 if (http_cookies->timeout > 0)
298 katze_http_cookies_update_jar (http_cookies);
299 katze_assign (http_cookies->filename, NULL);
300 katze_object_assign (http_cookies->jar, NULL);
301}
302
303static void
304katze_http_cookies_session_feature_iface_init (SoupSessionFeatureInterface *iface,
305 gpointer data)
306{
307 iface->attach = katze_http_cookies_attach;
308 iface->detach = katze_http_cookies_detach;
309}
310
311static void
312katze_http_cookies_finalize (GObject* object)
313{
314 katze_http_cookies_detach ((SoupSessionFeature*)object, NULL);
315}
316
317static void
318katze_http_cookies_class_init (KatzeHttpCookiesClass* class)
319{
320 GObjectClass* gobject_class = (GObjectClass*)class;
321 gobject_class->finalize = katze_http_cookies_finalize;
322}
323
324static void
325katze_http_cookies_init (KatzeHttpCookies* http_cookies)
326{
327 http_cookies->filename = NULL;
328 http_cookies->jar = NULL;
329 http_cookies->timeout = 0;
330 http_cookies->counter = 0;
331}
3320
=== removed file 'katze/katze-http-cookies.h'
--- katze/katze-http-cookies.h 2010-01-17 17:14:48 +0000
+++ katze/katze-http-cookies.h 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1/*
2 Copyright (C) 2009 Christian Dywan <christian@twotoasts.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 See the file COPYING for the full license text.
10*/
11
12#ifndef __KATZE_HTTP_COOKIES_H__
13#define __KATZE_HTTP_COOKIES_H__
14
15#include "katze-utils.h"
16
17#include <glib-object.h>
18
19G_BEGIN_DECLS
20
21#define KATZE_TYPE_HTTP_COOKIES \
22 (katze_http_cookies_get_type ())
23#define KATZE_HTTP_COOKIES(obj) \
24 (G_TYPE_CHECK_INSTANCE_CAST ((obj), KATZE_TYPE_HTTP_COOKIES, KatzeHttpCookies))
25#define KATZE_HTTP_COOKIES_CLASS(klass) \
26 (G_TYPE_CHECK_CLASS_CAST ((klass), KATZE_TYPE_HTTP_COOKIES, KatzeHttpCookiesClass))
27#define KATZE_IS_HTTP_COOKIES(obj) \
28 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KATZE_TYPE_HTTP_COOKIES))
29#define KATZE_IS_HTTP_COOKIES_CLASS(klass) \
30 (G_TYPE_CHECK_CLASS_TYPE ((klass), KATZE_TYPE_HTTP_COOKIES))
31#define KATZE_HTTP_COOKIES_GET_CLASS(obj) \
32 (G_TYPE_INSTANCE_GET_CLASS ((obj), KATZE_TYPE_HTTP_COOKIES, KatzeHttpCookiesClass))
33
34typedef struct _KatzeHttpCookies KatzeHttpCookies;
35typedef struct _KatzeHttpCookiesClass KatzeHttpCookiesClass;
36
37GType
38katze_http_cookies_get_type (void) G_GNUC_CONST;
39
40G_END_DECLS
41
42#endif /* __KATZE_HTTP_COOKIES_H__ */
430
=== modified file 'katze/katze.h'
--- katze/katze.h 2013-07-27 12:35:55 +0000
+++ katze/katze.h 2013-07-29 21:07:25 +0000
@@ -13,8 +13,6 @@
13#define __KATZE_H__13#define __KATZE_H__
1414
15#include "katze-http-auth.h"15#include "katze-http-auth.h"
16#include "katze-http-cookies.h"
17#include "katze-http-cookies-sqlite.h"
18#include "katze-throbber.h"16#include "katze-throbber.h"
19#include "katze-utils.h"17#include "katze-utils.h"
20#include "katze-item.h"18#include "katze-item.h"
2119
=== modified file 'midori/midori-frontend.c'
--- midori/midori-frontend.c 2013-06-30 14:58:59 +0000
+++ midori/midori-frontend.c 2013-07-29 21:07:25 +0000
@@ -600,11 +600,6 @@
600 midori_bookmarks_on_quit (bookmarks);600 midori_bookmarks_on_quit (bookmarks);
601 midori_history_on_quit (history, settings);601 midori_history_on_quit (history, settings);
602 midori_private_data_on_quit (settings);602 midori_private_data_on_quit (settings);
603 /* Removing KatzeHttpCookies makes it save outstanding changes */
604#ifndef HAVE_WEBKIT2
605 soup_session_remove_feature_by_type (webkit_get_default_session (),
606 KATZE_TYPE_HTTP_COOKIES);
607#endif
608603
609 MidoriStartup load_on_startup = katze_object_get_int (settings, "load-on-startup");604 MidoriStartup load_on_startup = katze_object_get_int (settings, "load-on-startup");
610 if (load_on_startup < MIDORI_STARTUP_LAST_OPEN_PAGES)605 if (load_on_startup < MIDORI_STARTUP_LAST_OPEN_PAGES)
611606
=== modified file 'midori/midori-privatedata.c'
--- midori/midori-privatedata.c 2013-06-19 20:23:55 +0000
+++ midori/midori-privatedata.c 2013-07-29 21:07:25 +0000
@@ -221,13 +221,17 @@
221static void221static void
222midori_clear_web_cookies_cb (void)222midori_clear_web_cookies_cb (void)
223{223{
224#ifndef HAVE_WEBKIT2224#ifdef HAVE_WEBKIT2
225 WebKitWebContext* context = webkit_web_context_get_default ();
226 WebKitCookieManager* cookie_manager = webkit_web_context_get_cookie_manager (context);
227 webkit_cookie_manager_delete_all_cookies (cookie_manager);
228 /* FIXME: site data policy */
229#else
225 SoupSession* session = webkit_get_default_session ();230 SoupSession* session = webkit_get_default_session ();
226 MidoriWebSettings* settings = g_object_get_data (G_OBJECT (session), "midori-settings");231 MidoriWebSettings* settings = g_object_get_data (G_OBJECT (session), "midori-settings");
227 SoupSessionFeature* jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);232 SoupSessionFeature* jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
228 GSList* cookies = soup_cookie_jar_all_cookies (SOUP_COOKIE_JAR (jar));233 GSList* cookies = soup_cookie_jar_all_cookies (SOUP_COOKIE_JAR (jar));
229 SoupSessionFeature* feature;234 SoupSessionFeature* feature;
230 gchar* cache;
231235
232 /* HTTP Cookies/ Web Cookies */236 /* HTTP Cookies/ Web Cookies */
233 for (; cookies != NULL; cookies = g_slist_next (cookies))237 for (; cookies != NULL; cookies = g_slist_next (cookies))
@@ -239,18 +243,12 @@
239 soup_cookie_jar_delete_cookie ((SoupCookieJar*)jar, cookies->data);243 soup_cookie_jar_delete_cookie ((SoupCookieJar*)jar, cookies->data);
240 }244 }
241 soup_cookies_free (cookies);245 soup_cookies_free (cookies);
242 /* Removing KatzeHttpCookies makes it save outstanding changes */246#endif
243 if ((feature = soup_session_get_feature (session, KATZE_TYPE_HTTP_COOKIES)))
244 {
245 g_object_ref (feature);
246 soup_session_remove_feature (session, feature);
247 soup_session_add_feature (session, feature);
248 g_object_unref (feature);
249 }
250247
251 /* Local shared objects/ Flash cookies */248 /* Local shared objects/ Flash cookies */
252 if (midori_web_settings_has_plugin_support ())249 if (midori_web_settings_has_plugin_support ())
253 {250 {
251 gchar* cache;
254 #ifdef GDK_WINDOWING_X11252 #ifdef GDK_WINDOWING_X11
255 cache = g_build_filename (g_get_home_dir (), ".macromedia", "Flash_Player", NULL);253 cache = g_build_filename (g_get_home_dir (), ".macromedia", "Flash_Player", NULL);
256 midori_paths_remove_path (cache);254 midori_paths_remove_path (cache);
@@ -267,6 +265,9 @@
267 #endif265 #endif
268 }266 }
269267
268#ifdef HAVE_WEBKIT2
269 /* TODO: clear databases and offline app caches */
270#else
270 /* HTML5 databases */271 /* HTML5 databases */
271 webkit_remove_all_web_databases ();272 webkit_remove_all_web_databases ();
272273
273274
=== modified file 'midori/midori-session.c'
--- midori/midori-session.c 2013-07-11 08:40:04 +0000
+++ midori/midori-session.c 2013-07-29 21:07:25 +0000
@@ -17,10 +17,12 @@
17#include "sokoke.h"17#include "sokoke.h"
1818
19#include <glib/gi18n-lib.h>19#include <glib/gi18n-lib.h>
20#include <libsoup/soup-cookie-jar-sqlite.h>
2021
21 #define LIBSOUP_USE_UNSTABLE_REQUEST_API22 #define LIBSOUP_USE_UNSTABLE_REQUEST_API
22 #include <libsoup/soup-cache.h>23 #include <libsoup/soup-cache.h>
2324
25#ifndef HAVE_WEBKIT2
24static void26static void
25midori_soup_session_set_proxy_uri (SoupSession* session,27midori_soup_session_set_proxy_uri (SoupSession* session,
26 const gchar* uri)28 const gchar* uri)
@@ -83,18 +85,28 @@
83 else85 else
84 midori_soup_session_set_proxy_uri (session, NULL);86 midori_soup_session_set_proxy_uri (session, NULL);
85}87}
88#endif
8689
87#ifdef HAVE_LIBSOUP_2_29_9190#if defined(HAVE_LIBSOUP_2_29_91) && WEBKIT_CHECK_VERSION (1, 1, 21)
88static void91static void
89soup_session_settings_notify_first_party_cb (MidoriWebSettings* settings,92soup_session_settings_notify_first_party_cb (MidoriWebSettings* settings,
90 GParamSpec* pspec,93 GParamSpec* pspec,
91 SoupSession* session)94 gpointer user_data)
92{95{
96 gboolean yes = katze_object_get_boolean (settings, "first-party-cookies-only");
97#ifdef HAVE_WEBKIT2
98 WebKitWebContext* context = webkit_web_context_get_default ();
99 WebKitCookieManager* cookie_manager = webkit_web_context_get_cookie_manager (context);
100 webkit_cookie_manager_set_accept_policy (cookie_manager,
101 yes ? WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY
102 : WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS);
103#else
104 SoupSession* session = webkit_get_default_session ();
93 gpointer jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);105 gpointer jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
94 gboolean yes = katze_object_get_boolean (settings, "first-party-cookies-only");
95 g_object_set (jar, "accept-policy",106 g_object_set (jar, "accept-policy",
96 yes ? SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY107 yes ? SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY
97 : SOUP_COOKIE_JAR_ACCEPT_ALWAYS, NULL);108 : SOUP_COOKIE_JAR_ACCEPT_ALWAYS, NULL);
109#endif
98}110}
99#endif111#endif
100112
@@ -116,17 +128,14 @@
116#ifndef HAVE_WEBKIT2128#ifndef HAVE_WEBKIT2
117const gchar*129const gchar*
118midori_web_settings_get_accept_language (MidoriWebSettings* settings);130midori_web_settings_get_accept_language (MidoriWebSettings* settings);
119#endif
120131
121static void132static void
122midori_soup_session_settings_accept_language_cb (SoupSession* session,133midori_soup_session_settings_accept_language_cb (SoupSession* session,
123 SoupMessage* msg,134 SoupMessage* msg,
124 MidoriWebSettings* settings)135 MidoriWebSettings* settings)
125{136{
126 #ifndef HAVE_WEBKIT2
127 const gchar* accept = midori_web_settings_get_accept_language (settings);137 const gchar* accept = midori_web_settings_get_accept_language (settings);
128 soup_message_headers_append (msg->request_headers, "Accept-Language", accept);138 soup_message_headers_append (msg->request_headers, "Accept-Language", accept);
129 #endif
130139
131 if (katze_object_get_boolean (settings, "strip-referer"))140 if (katze_object_get_boolean (settings, "strip-referer"))
132 {141 {
@@ -157,10 +166,16 @@
157 soup_message_headers_remove (msg->request_headers, "Host");166 soup_message_headers_remove (msg->request_headers, "Host");
158 }167 }
159}168}
169#endif
160170
161gboolean171gboolean
162midori_load_soup_session (gpointer settings)172midori_load_soup_session (gpointer settings)
163{173{
174 #if defined(HAVE_LIBSOUP_2_29_91) && WEBKIT_CHECK_VERSION (1, 1, 21)
175 g_signal_connect (settings, "notify::first-party-cookies-only",
176 G_CALLBACK (soup_session_settings_notify_first_party_cb), NULL);
177 #endif
178
164#ifndef HAVE_WEBKIT2179#ifndef HAVE_WEBKIT2
165 SoupSession* session = webkit_get_default_session ();180 SoupSession* session = webkit_get_default_session ();
166181
@@ -213,12 +228,6 @@
213 G_CALLBACK (soup_session_settings_notify_http_proxy_cb), session);228 G_CALLBACK (soup_session_settings_notify_http_proxy_cb), session);
214 g_signal_connect (settings, "notify::proxy-type",229 g_signal_connect (settings, "notify::proxy-type",
215 G_CALLBACK (soup_session_settings_notify_http_proxy_cb), session);230 G_CALLBACK (soup_session_settings_notify_http_proxy_cb), session);
216 #ifdef HAVE_LIBSOUP_2_29_91
217 if (g_object_class_find_property (G_OBJECT_GET_CLASS (settings),
218 "enable-file-access-from-file-uris")) /* WebKitGTK+ >= 1.1.21 */
219 g_signal_connect (settings, "notify::first-party-cookies-only",
220 G_CALLBACK (soup_session_settings_notify_first_party_cb), session);
221 #endif
222231
223 #if defined (HAVE_LIBSOUP_2_34_0)232 #if defined (HAVE_LIBSOUP_2_34_0)
224 g_signal_connect (session, "request-started",233 g_signal_connect (session, "request-started",
@@ -247,10 +256,42 @@
247 return FALSE;256 return FALSE;
248}257}
249258
259#ifndef HAVE_WEBKIT2
260static void
261midori_session_cookie_jar_changed_cb (SoupCookieJar* jar,
262 SoupCookie* old_cookie,
263 SoupCookie* new_cookie,
264 MidoriWebSettings* settings)
265{
266 if (new_cookie && new_cookie->expires)
267 {
268 time_t expires = soup_date_to_time_t (new_cookie->expires);
269 gint age = katze_object_get_int (settings, "maximum-cookie-age");
270 if (age > 0)
271 {
272 SoupDate* max_date = soup_date_new_from_now (
273 age * SOUP_COOKIE_MAX_AGE_ONE_DAY);
274 if (soup_date_to_time_t (new_cookie->expires)
275 > soup_date_to_time_t (max_date))
276 soup_cookie_set_expires (new_cookie, max_date);
277 }
278 else
279 {
280 /* An age of 0 to SoupCookie means already-expired
281 A user choosing 0 days probably expects 1 hour. */
282 soup_cookie_set_max_age (new_cookie, SOUP_COOKIE_MAX_AGE_ONE_HOUR);
283 }
284 }
285
286 if (midori_debug ("cookies"))
287 g_print ("cookie changed: old %p new %p\n", old_cookie, new_cookie);
288}
289#endif
290
250gboolean291gboolean
251midori_load_soup_session_full (gpointer settings)292midori_load_soup_session_full (gpointer settings)
252{293{
253#ifndef HAVE_WEBKIT2294 #ifndef HAVE_WEBKIT2
254 SoupSession* session = webkit_get_default_session ();295 SoupSession* session = webkit_get_default_session ();
255 SoupCookieJar* jar;296 SoupCookieJar* jar;
256 gchar* config_file;297 gchar* config_file;
@@ -265,33 +306,13 @@
265 soup_session_add_feature (session, feature);306 soup_session_add_feature (session, feature);
266 g_object_unref (feature);307 g_object_unref (feature);
267308
268 jar = soup_cookie_jar_new ();309 katze_assign (config_file, midori_paths_get_config_filename_for_writing ("cookies.db"));
269 g_object_set_data (G_OBJECT (jar), "midori-settings", settings);310 jar = soup_cookie_jar_sqlite_new (config_file, FALSE);
270 soup_session_add_feature (session, SOUP_SESSION_FEATURE (jar));311 soup_session_add_feature (session, SOUP_SESSION_FEATURE (jar));
312 g_signal_connect (jar, "changed",
313 G_CALLBACK (midori_session_cookie_jar_changed_cb), settings);
271 g_object_unref (jar);314 g_object_unref (jar);
272315
273 katze_assign (config_file, midori_paths_get_config_filename_for_writing ("cookies.db"));
274 have_new_cookies = g_access (config_file, F_OK) == 0;
275 feature = g_object_new (KATZE_TYPE_HTTP_COOKIES_SQLITE, NULL);
276 g_object_set_data_full (G_OBJECT (feature), "filename",
277 config_file, (GDestroyNotify)g_free);
278 soup_session_add_feature (session, feature);
279 g_object_unref (feature);
280
281 if (!have_new_cookies)
282 {
283 katze_assign (config_file, midori_paths_get_config_filename_for_writing ("cookies.txt"));
284 if (g_access (config_file, F_OK) == 0)
285 {
286 g_message ("Importing cookies from txt to sqlite3");
287 feature_import = g_object_new (KATZE_TYPE_HTTP_COOKIES, NULL);
288 g_object_set_data_full (G_OBJECT (feature_import), "filename",
289 config_file, (GDestroyNotify)g_free);
290 soup_session_add_feature (session, SOUP_SESSION_FEATURE (feature_import));
291 soup_session_remove_feature (session, SOUP_SESSION_FEATURE (feature_import));
292 }
293 }
294
295 katze_assign (config_file, g_build_filename (midori_paths_get_cache_dir (), "web", NULL));316 katze_assign (config_file, g_build_filename (midori_paths_get_cache_dir (), "web", NULL));
296 feature = SOUP_SESSION_FEATURE (soup_cache_new (config_file, 0));317 feature = SOUP_SESSION_FEATURE (soup_cache_new (config_file, 0));
297 soup_session_add_feature (session, feature);318 soup_session_add_feature (session, feature);
@@ -299,7 +320,7 @@
299 katze_object_get_int (settings, "maximum-cache-size") * 1024 * 1024);320 katze_object_get_int (settings, "maximum-cache-size") * 1024 * 1024);
300 soup_cache_load (SOUP_CACHE (feature));321 soup_cache_load (SOUP_CACHE (feature));
301 g_free (config_file);322 g_free (config_file);
302#endif323 #endif
303 return FALSE;324 return FALSE;
304}325}
305326
306327
=== modified file 'wscript'
--- wscript 2013-07-16 14:20:37 +0000
+++ wscript 2013-07-29 21:07:25 +0000
@@ -278,7 +278,7 @@
278 conf.check_message_custom ('unique', '', 'disabled')278 conf.check_message_custom ('unique', '', 'disabled')
279 conf.define ('HAVE_UNIQUE', [0,1][conf.env['UNIQUE_VERSION'] != 'No'])279 conf.define ('HAVE_UNIQUE', [0,1][conf.env['UNIQUE_VERSION'] != 'No'])
280280
281 check_pkg ('libsoup-2.4', '2.27.90', var='LIBSOUP')281 check_pkg ('libsoup-gnome-2.4', '2.27.90', var='LIBSOUP')
282 if check_version (conf.env['LIBSOUP_VERSION'], 2, 29, 91):282 if check_version (conf.env['LIBSOUP_VERSION'], 2, 29, 91):
283 conf.define ('HAVE_LIBSOUP_2_29_91', 1)283 conf.define ('HAVE_LIBSOUP_2_29_91', 1)
284 if check_version (conf.env['LIBSOUP_VERSION'], 2, 34, 0):284 if check_version (conf.env['LIBSOUP_VERSION'], 2, 34, 0):

Subscribers

People subscribed via source and target branches

to all changes: