summaryrefslogtreecommitdiffstats
path: root/patches/libtranslate/soup24/libtranslate-ds8-soup24inc.patch
blob: 8de7c07ca41c93b4c33fd0c4e64a50037d791ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
diff -dPNur libtranslate-0.99/config.h.in libtranslate-0.99-1/config.h.in
--- libtranslate-0.99/config.h.in	2005-01-17 18:06:58.000000000 +0100
+++ libtranslate-0.99-1/config.h.in	2010-02-14 03:55:56.000000000 +0100
@@ -24,6 +24,12 @@
 /* Define if your <locale.h> file defines LC_MESSAGES. */
 #undef HAVE_LC_MESSAGES
 
+/* Building with libsoup 2.2 */
+#undef HAVE_LIBSOUP22
+
+/* Building with libsoup 2.4 */
+#undef HAVE_LIBSOUP24
+
 /* Define to 1 if you have the <locale.h> header file. */
 #undef HAVE_LOCALE_H
 
diff -dPNur libtranslate-0.99/configure.ac libtranslate-0.99-1/configure.ac
--- libtranslate-0.99/configure.ac	2005-01-15 17:24:12.000000000 +0100
+++ libtranslate-0.99-1/configure.ac	2010-02-14 03:55:56.000000000 +0100
@@ -50,7 +50,11 @@
 ### optional libraries
 
 if TRANSLATE_FEATURE_ENABLED(generic); then
-	PKG_CHECK_MODULES(SOUP, [libsoup-2.2],, [TRANSLATE_FEATURE_DISABLE(generic, [libsoup not found])])
+	PKG_CHECK_MODULES(SOUP, [libsoup-2.4],
+		[AC_DEFINE(HAVE_LIBSOUP24, 1, [Building with libsoup 2.4])],
+		[PKG_CHECK_MODULES(SOUP, [libsoup-2.2],
+			[AC_DEFINE(HAVE_LIBSOUP22, 1, [Building with libsoup 2.2])],
+			[TRANSLATE_FEATURE_DISABLE(generic, [libsoup not found])])])
 fi
 if TRANSLATE_FEATURE_ENABLED(generic); then
 	PKG_CHECK_MODULES(LIBXML, [libxml-2.0],, [TRANSLATE_FEATURE_DISABLE(generic, [libxml not found])])
diff -dPNur libtranslate-0.99/src/modules/translate-generic-service.c libtranslate-0.99-1/src/modules/translate-generic-service.c
--- libtranslate-0.99/src/modules/translate-generic-service.c	2010-02-14 03:55:34.000000000 +0100
+++ libtranslate-0.99-1/src/modules/translate-generic-service.c	2010-02-14 04:04:56.000000000 +0100
@@ -35,7 +35,9 @@
 #include <stdlib.h>
 #include <glib/gi18n-lib.h>
 #include <libsoup/soup.h>
+#ifdef HAVE_LIBSOUP22
 #include <libsoup/soup-message-filter.h>
+#endif
 #include <libxml/HTMLparser.h>
 #include "translate.h"
 #include "translate-generic-service.h"
@@ -43,6 +45,17 @@
 #include "translate-generic-parser.h"
 #include "translate-generic-soup-cookie-jar.h"
 
+#ifdef HAVE_LIBSOUP22
+#define soup_message_headers_get soup_message_get_header
+#define soup_message_headers_append soup_message_add_header
+#define SoupURI SoupUri
+#define SOUP_MESSAGE_RESPONSE_BODY(msg) ((msg)->response.body)
+#define SOUP_MESSAGE_RESPONSE_LENGTH(msg) ((msg)->response.length)
+#else
+#define SOUP_MESSAGE_RESPONSE_BODY(msg) ((msg)->response_body->data)
+#define SOUP_MESSAGE_RESPONSE_LENGTH(msg) ((msg)->response_body->length)
+#endif
+
 #define MAKE_WARNING_PREFIX(service, group_pos, attribute, element) \
   g_strdup_printf(_("in %s, group %i, \"%s\" attribute of \"%s\" element"), \
 		  translate_service_get_name((service)), \
@@ -142,6 +155,7 @@
 							 const char *name);
 
 static void translate_generic_service_log_connect (SoupMessage *message);
+#ifdef HAVE_LIBSOUP22
 static void translate_generic_service_log_wrote_headers_h (SoupMessage *message,
 							   gpointer user_data);
 static void translate_generic_service_log_wrote_body_h (SoupMessage *message,
@@ -153,10 +167,20 @@
 static void translate_generic_service_log_headers_cb (const char *key,
 						      const char *value,
 						      gpointer user_data);
+#else
+static void translate_generic_service_log_printer (SoupLogger *logger,
+						   SoupLoggerLogLevel level,
+						   char direction,
+						   const char *data,
+						   gpointer user_data);
+#endif
 
 static void translate_generic_service_progress_got_headers_h (SoupMessage *message,
 							      gpointer user_data);
 static void translate_generic_service_progress_got_chunk_h (SoupMessage *message,
+#ifdef HAVE_LIBSOUP24
+							    SoupBuffer *chunk,
+#endif
 							    gpointer user_data);
 
 static void translate_generic_service_html_got_headers_h (SoupMessage *message,
@@ -172,8 +196,10 @@
 static void translate_generic_service_refresh_got_body_h (SoupMessage *message,
 							  gpointer user_data);
 
+#ifdef HAVE_LIBSOUP22
 static void translate_generic_service_redirect_handler (SoupMessage *message,
 							gpointer user_data);
+#endif
 
 static char *translate_generic_service_translate_text (TranslateService *service,
 						       const char *text,
@@ -440,7 +466,11 @@
       g_return_val_if_fail(post_content_type != NULL, NULL);
       soup_message_set_request(message,
 			       post_content_type,
+#ifdef HAVE_LIBSOUP22
 			       SOUP_BUFFER_USER_OWNED,
+#else
+			       SOUP_MEMORY_TEMPORARY,
+#endif
 			       (char *) post,
 			       strlen(post));
     }
@@ -448,7 +478,7 @@
   for (l = headers; l != NULL; l = l->next)
     {
       TranslateGenericHttpHeader *header = l->data;
-      soup_message_add_header(message->request_headers, header->name, header->value);
+      soup_message_headers_append(message->request_headers, header->name, header->value);
     }
   
   info.session = translate_generic_service_soup_session_sync_new();
@@ -456,12 +486,21 @@
   info.html_http_equiv = NULL;
 
   if (translate_generic_debug_flags & TRANSLATE_GENERIC_DEBUG_LOG_TRANSFERS)
-    g_object_connect(message,
-		     "signal::wrote-headers", translate_generic_service_log_wrote_headers_h, &info,
-		     "signal::wrote-body", translate_generic_service_log_wrote_body_h, &info,
-		     "signal::got-headers", translate_generic_service_log_got_headers_h, &info,
-		     "signal::got-body", translate_generic_service_log_got_body_h, &info,
-		     NULL);
+    {
+#ifdef HAVE_LIBSOUP22
+      g_object_connect(message,
+		       "signal::wrote-headers", translate_generic_service_log_wrote_headers_h, &info,
+		       "signal::wrote-body", translate_generic_service_log_wrote_body_h, &info,
+		       "signal::got-headers", translate_generic_service_log_got_headers_h, &info,
+		       "signal::got-body", translate_generic_service_log_got_body_h, &info,
+		       NULL);
+#else
+      SoupLogger *logger = soup_logger_new (SOUP_LOGGER_LOG_BODY, -1);
+      soup_logger_set_printer (logger, translate_generic_service_log_printer, NULL, NULL);
+      soup_logger_attach (logger, info.session);
+      g_object_unref (logger);
+#endif
+    }
 
   if (progress_func)
     {
@@ -489,6 +528,7 @@
   if (flags & TRANSFER_FOLLOW_REFRESH)
     g_signal_connect(message, "got-body", G_CALLBACK(translate_generic_service_refresh_got_body_h), &info);
 
+#ifdef HAVE_LIBSOUP22
   /* http://bugzilla.ximian.com/show_bug.cgi?id=70688 */
   soup_message_set_flags(message, SOUP_MESSAGE_NO_REDIRECT);
   soup_message_add_status_class_handler(message,
@@ -496,6 +536,7 @@
 					SOUP_HANDLER_POST_BODY,
 					translate_generic_service_redirect_handler,
 					info.session);
+#endif
 
   if (translate_generic_debug_flags & TRANSLATE_GENERIC_DEBUG_LOG_TRANSFERS)
     translate_generic_service_log_connect(message);
@@ -554,18 +595,18 @@
 
       if ((charset)||(response_charset))
 	{
-	  response = g_convert(message->response.body, message->response.length, "UTF-8", response_charset?response_charset:charset, NULL, NULL, err);
+	  response = g_convert(SOUP_MESSAGE_RESPONSE_BODY (message), SOUP_MESSAGE_RESPONSE_LENGTH (message), "UTF-8", charset, NULL, NULL, err);
 	  g_free(charset);
 	}
       else
 	{
-	  if ((flags & TRANSFER_CONVERT) && ! g_utf8_validate(message->response.body, message->response.length, NULL))
+  	  if ((flags & TRANSFER_CONVERT) && ! g_utf8_validate(SOUP_MESSAGE_RESPONSE_BODY (message), SOUP_MESSAGE_RESPONSE_LENGTH (message), NULL))
 	    g_set_error(err,
 			TRANSLATE_GENERIC_SERVICE_ERROR,
 			TRANSLATE_GENERIC_SERVICE_ERROR_TRANSFER,
 			_("invalid UTF-8"));
 	  else
-	    response = g_strndup(message->response.body, message->response.length);
+  	    response = g_strndup(SOUP_MESSAGE_RESPONSE_BODY (message), SOUP_MESSAGE_RESPONSE_LENGTH (message));
 	}
     }
   else
@@ -606,7 +647,7 @@
     : NULL;
 
   if (! value)
-    value = soup_message_get_header(message->response_headers, name);
+    value = soup_message_headers_get(message->response_headers, name);
 
   return value;
 }
@@ -614,12 +655,14 @@
 static void
 translate_generic_service_log_connect (SoupMessage *message)
 {
-  const SoupUri *uri;
+  const SoupURI *uri;
 
   uri = soup_message_get_uri(message);
   g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, _("connecting to %s:%i"), uri->host, uri->port);
 }
 
+#ifdef HAVE_LIBSOUP22
+
 static void
 translate_generic_service_log_wrote_headers_h (SoupMessage *message,
 					       gpointer user_data)
@@ -674,6 +717,20 @@
   g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s %s: %s", prefix, key, value);
 }
 
+#else /* !HAVE_LIBSOUP22 */
+
+static void
+translate_generic_service_log_printer (SoupLogger *logger,
+				       SoupLoggerLogLevel level,
+				       char direction,
+				       const char *data,
+				       gpointer user_data)
+{
+  g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%c %s", direction, data);
+}
+
+#endif /* HAVE_LIBSOUP22 */
+
 static void
 translate_generic_service_progress_got_headers_h (SoupMessage *message,
 						  gpointer user_data)
@@ -681,7 +738,7 @@
   TransferInfo *info = user_data;
   const char *content_length;
 
-  content_length = soup_message_get_header(message->response_headers, "Content-Length");
+  content_length = soup_message_headers_get(message->response_headers, "Content-Length");
   info->length = (content_length
 		  && *content_length
 		  && strspn(content_length, "0123456789") == strlen(content_length))
@@ -691,6 +748,9 @@
 
 static void
 translate_generic_service_progress_got_chunk_h (SoupMessage *message,
+#ifdef HAVE_LIBSOUP24
+						SoupBuffer *chunk,
+#endif
 						gpointer user_data)
 {
   TransferInfo *info = user_data;
@@ -700,7 +760,11 @@
     progress = -1;
   else
     {
+#ifdef HAVE_LIBSOUP22
       info->received += message->response.length;
+#else
+      info->received += chunk->length;
+#endif
       progress = (double) info->received / info->length;
       progress = CLAMP(progress, 0.0, 1.0);
     }
@@ -716,7 +780,7 @@
   TransferInfo *info = user_data;
   const char *content_type;
 
-  content_type = soup_message_get_header(message->response_headers, "Content-Type");
+  content_type = soup_message_headers_get(message->response_headers, "Content-Type");
   info->parse_html = content_type
     && (g_str_has_prefix(content_type, "text/html")
 	|| g_str_has_prefix(content_type, "application/xhtml+xml")
@@ -736,7 +800,7 @@
       info->html_http_equiv = NULL;
     }
 
-  if (info->parse_html && message->response.length > 0)
+  if (info->parse_html && SOUP_MESSAGE_RESPONSE_LENGTH (message) > 0)
     {
       char *body;
       xmlSAXHandler sax_handler = { NULL };
@@ -750,7 +814,7 @@
       sax_handler.startElement = translate_generic_service_html_start_element_cb;
       sax_handler.endElement = translate_generic_service_html_end_element_cb;
 
-      body = g_strndup(message->response.body, message->response.length);
+      body = g_strndup(SOUP_MESSAGE_RESPONSE_BODY (message), SOUP_MESSAGE_RESPONSE_LENGTH (message));
       htmlSAXParseDoc(body, NULL, &sax_handler, user_data);
       g_free(body);
     }
@@ -817,7 +881,7 @@
 {
   TransferInfo *info = user_data;
   const char *refresh_uri;
-  SoupUri *new_uri = NULL;
+  SoupURI *new_uri = NULL;
 
   refresh_uri = translate_generic_service_get_header(message, info, "Refresh");
   if (refresh_uri)
@@ -832,9 +896,9 @@
       new_uri = soup_uri_new(refresh_uri);
       if (! new_uri)
 	{
-	  const SoupUri *base_uri;
+	  SoupURI *base_uri;
 	  
-	  base_uri = soup_message_get_uri(message);
+	  base_uri = (SoupURI *)soup_message_get_uri(message);
 	  new_uri = soup_uri_new_with_base(base_uri, refresh_uri);
 	}
     }
@@ -851,6 +915,7 @@
     }
 }
 
+#ifdef HAVE_LIBSOUP22
 static void
 translate_generic_service_redirect_handler (SoupMessage *message,
 					    gpointer user_data)
@@ -887,6 +952,7 @@
       soup_session_requeue_message(session, message);
     }
 }
+#endif
 
 static char *
 translate_generic_service_timed_translate_text (TranslateService *service,
@@ -1391,7 +1457,7 @@
 translate_generic_service_soup_session_sync_new (void)
 {
   char *proxy_text_uri;
-  SoupUri *proxy_uri = NULL;
+  SoupURI *proxy_uri = NULL;
   SoupSession *session;
   TranslateGenericSoupCookieJar *cookie_jar;
 
@@ -1411,7 +1477,7 @@
     soup_uri_free(proxy_uri);
 
   cookie_jar = translate_generic_soup_cookie_jar_new();
-  soup_session_add_filter(session, SOUP_MESSAGE_FILTER(cookie_jar));
+  translate_generic_soup_cookie_jar_attach(cookie_jar, session);
   g_object_unref(cookie_jar);
 
   return session;
diff -dPNur libtranslate-0.99/src/modules/translate-generic-soup-cookie-jar.c libtranslate-0.99-1/src/modules/translate-generic-soup-cookie-jar.c
--- libtranslate-0.99/src/modules/translate-generic-soup-cookie-jar.c	2005-01-17 17:46:53.000000000 +0100
+++ libtranslate-0.99-1/src/modules/translate-generic-soup-cookie-jar.c	2010-02-14 03:55:56.000000000 +0100
@@ -29,9 +29,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "config.h"
 #include <string.h>
 #include <libsoup/soup.h>
+#ifdef HAVE_LIBSOUP22
 #include <libsoup/soup-message-filter.h>
+#endif
 #include "translate-generic-soup-cookie-jar.h"
 
 struct _TranslateGenericSoupCookieJarPrivate
@@ -44,9 +47,12 @@
 static void translate_generic_soup_cookie_jar_register_type (GType *type);
 static void translate_generic_soup_cookie_jar_class_init (TranslateGenericSoupCookieJarClass *class);
 static void translate_generic_soup_cookie_jar_init (TranslateGenericSoupCookieJar *jar);
+#ifdef HAVE_LIBSOUP22
 static void translate_generic_soup_cookie_jar_filter_init (SoupMessageFilterClass *iface);
+#else
+#define SoupMessageFilter TranslateGenericSoupCookieJar
+#endif
 static void translate_generic_soup_cookie_jar_finalize (GObject *object);
-
 static void translate_generic_soup_cookie_jar_setup_message (SoupMessageFilter *filter,
 							     SoupMessage *message);
 
@@ -75,17 +81,21 @@
     0,
     (GInstanceInitFunc) translate_generic_soup_cookie_jar_init
   };
+#ifdef HAVE_LIBSOUP22
   static const GInterfaceInfo filter_info = {
     (GInterfaceInitFunc) translate_generic_soup_cookie_jar_filter_init,
     NULL,
     NULL
   };
+#endif
 
   *type = g_type_register_static(G_TYPE_OBJECT,
 				 "TranslateGenericSoupCookieJar",
 				 &info,
 				 0);
+#ifdef HAVE_LIBSOUP22
   g_type_add_interface_static(*type, SOUP_TYPE_MESSAGE_FILTER, &filter_info);
+#endif
 }
 
 static void
@@ -107,11 +117,13 @@
 					  TranslateGenericSoupCookieJarPrivate);
 }
 
+#ifdef HAVE_LIBSOUP22
 static void
 translate_generic_soup_cookie_jar_filter_init (SoupMessageFilterClass *iface)
 {
   iface->setup_message = translate_generic_soup_cookie_jar_setup_message;
 }
+#endif
 
 static void
 translate_generic_soup_cookie_jar_finalize (GObject *object)
@@ -125,26 +137,46 @@
 }
 
 static void
+add_cookie_to_jar (TranslateGenericSoupCookieJar *jar, const char *cookie)
+{
+  char *s;
+
+  s = strchr(cookie, ';');
+  if (s)
+    jar->priv->cookies = g_slist_append(jar->priv->cookies, g_strndup(cookie, s - cookie));
+}
+
+#ifdef HAVE_LIBSOUP24
+static void
+maybe_add_cookie_to_jar (const char *header, const char *value, gpointer jar)
+{
+  if (!g_ascii_strcasecmp (header, "Set-Cookie"))
+    add_cookie_to_jar (jar, value);
+}
+#endif
+
+static void
 translate_generic_soup_cookie_jar_setup_message (SoupMessageFilter *filter,
-					 SoupMessage *message)
+						 SoupMessage *message)
 {
   TranslateGenericSoupCookieJar *jar = TRANSLATE_GENERIC_SOUP_COOKIE_JAR(filter);
-  const GSList *cookies;
   const GSList *l;
 
   /* FIXME: add full RFC 2965 support */
 
+#ifdef HAVE_LIBSOUP22
+  const GSList *cookies;
+
   cookies = soup_message_get_header_list(message->response_headers, "Set-Cookie");
   for (l = cookies; l != NULL; l = l->next)
     {
       const char *cookie = l->data;
-      char *s;
-
-      s = strchr(cookie, ';');
-      if (s)
-	jar->priv->cookies = g_slist_append(jar->priv->cookies, g_strndup(cookie, s - cookie));
+      add_cookie_to_jar(jar, cookie);
     }
-  
+#else
+  soup_message_headers_foreach(message->response_headers, maybe_add_cookie_to_jar, jar);
+#endif
+
   if (jar->priv->cookies)
     {
       GString *string;
@@ -159,13 +191,44 @@
 	    g_string_append(string, "; ");
 	}
 
+#ifdef HAVE_LIBSOUP22
       soup_message_add_header(message->request_headers, "Cookie", string->str);
+#else
+      soup_message_headers_append(message->request_headers, "Cookie", string->str);
+#endif
       g_string_free(string, TRUE);
     }
 }
 
+#ifdef HAVE_LIBSOUP24
+static void
+translate_generic_soup_cookie_jar_request_started (SoupSession *session,
+						   SoupMessage *message,
+						   SoupSocket *socket,
+						   gpointer cookie_jar)
+{
+  translate_generic_soup_cookie_jar_setup_message (cookie_jar, message);
+}
+#endif
+
 TranslateGenericSoupCookieJar *
 translate_generic_soup_cookie_jar_new (void)
 {
   return g_object_new(TRANSLATE_GENERIC_TYPE_SOUP_COOKIE_JAR, NULL);
 }
+
+void
+translate_generic_soup_cookie_jar_attach (TranslateGenericSoupCookieJar *cookie_jar,
+					  SoupSession *session)
+{
+#ifdef HAVE_LIBSOUP22
+  soup_session_add_filter (session, SOUP_MESSAGE_FILTER(cookie_jar));
+#else
+  g_signal_connect (session, "request_started",
+		    G_CALLBACK (translate_generic_soup_cookie_jar_request_started),
+		    cookie_jar);
+  g_object_set_data_full (G_OBJECT (session), "TranslateGenericSoupCookieJar",
+			  g_object_ref (cookie_jar), g_object_unref);
+#endif
+}
+
diff -dPNur libtranslate-0.99/src/modules/translate-generic-soup-cookie-jar.h libtranslate-0.99-1/src/modules/translate-generic-soup-cookie-jar.h
--- libtranslate-0.99/src/modules/translate-generic-soup-cookie-jar.h	2005-01-17 17:47:00.000000000 +0100
+++ libtranslate-0.99-1/src/modules/translate-generic-soup-cookie-jar.h	2010-02-14 03:55:56.000000000 +0100
@@ -33,6 +33,7 @@
 #define _TRANSLATE_GENERIC_SOUP_COOKIE_JAR_H
 
 #include <glib-object.h>
+#include <libsoup/soup-session.h>
 
 #define TRANSLATE_GENERIC_TYPE_SOUP_COOKIE_JAR			(translate_generic_soup_cookie_jar_get_type())
 #define TRANSLATE_GENERIC_SOUP_COOKIE_JAR(obj)			(G_TYPE_CHECK_INSTANCE_CAST((obj), TRANSLATE_GENERIC_TYPE_SOUP_COOKIE_JAR, TranslateGenericSoupCookieJar))
@@ -59,5 +60,6 @@
 
 GType translate_generic_soup_cookie_jar_get_type (void);
 TranslateGenericSoupCookieJar *translate_generic_soup_cookie_jar_new (void);
+void translate_generic_soup_cookie_jar_attach (TranslateGenericSoupCookieJar *cookie_jar, SoupSession *session);
 
 #endif /* _TRANSLATE_GENERIC_SOUP_COOKIE_JAR_H */