Control: tags -1 + patch

Please find attached a patch; build-tested only.

Since the library exposes libsoup's API and forces its rdeps to link
with libsoup, this introduces API/ABI break so the SONAME should be
bumped (perhaps to a Debian-specific one if upstream is inactive).

Please see the attached simple program which runs as expected with the
packages from unstable:

$ ./abi-test
http://example.org/

But after installation of libevd-0.2-0t64 with the patch applied:

$ ./abi-test

(process:225263): libsoup-ERROR **: 20:59:44.930: libsoup2 symbols detected. 
Using libsoup2 and libsoup3 in the same process is not supported.
Прихващане на трасиране/точка на прекъсване                                     
                 ./abi-test
>From 1b4a8e7a8737b0d00dcd37ca04dafbcd3d96ea62 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <[email protected]>
Date: Wed, 15 Oct 2025 21:43:02 +0300
Subject: [PATCH] Port to libsoup3 (#1073943)

---
 debian/changelog              |   8 +
 debian/control                |   2 +-
 debian/patches/libsoup3.patch | 847 ++++++++++++++++++++++++++++++++++
 debian/patches/series         |   1 +
 4 files changed, 857 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/libsoup3.patch

diff --git a/debian/changelog b/debian/changelog
index 9694582..de4cb23 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+event-dance (0.2.0-8) UNRELEASED; urgency=medium
+
+  * debian/patches/libsoup3.patch: Port to libsoup 3 (Closes: #1073943).
+  * debian/control (Build-Depends): Replace libsoup2.4-dev with
+    libsoup-3.0-dev.
+
+ -- Yavor Doganov <[email protected]>  Wed, 15 Oct 2025 21:41:05 +0300
+
 event-dance (0.2.0-7) unstable; urgency=medium
 
   * debian/control:
diff --git a/debian/control b/debian/control
index 4a33135..1dfdd54 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Alberto Garcia <[email protected]>
 Build-Depends: dpkg-dev (>= 1.22.5), debhelper-compat (= 13),
                libglib2.0-dev,
                libgnutls28-dev,
-               libsoup2.4-dev,
+               libsoup-3.0-dev,
                uuid-dev,
                libjson-glib-dev,
                gobject-introspection,
diff --git a/debian/patches/libsoup3.patch b/debian/patches/libsoup3.patch
new file mode 100644
index 0000000..b3eb727
--- /dev/null
+++ b/debian/patches/libsoup3.patch
@@ -0,0 +1,847 @@
+Description: Port to libsoup3.
+Bug-Debian: https://bugs.debian.org/1073943
+Author: Yavor Doganov <[email protected]>
+Forwarded: no
+Last-Update: 2025-10-15
+---
+
+--- eventdance.orig/configure.ac
++++ eventdance/configure.ac
+@@ -82,7 +82,7 @@
+ AM_CONDITIONAL(HAVE_GIO_UNIX, test x"$HAVE_GIO_UNIX" = x"yes")
+ 
+ PKG_CHECK_MODULES(TLS, gnutls >= 3.0.0)
+-PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.28.0)
++PKG_CHECK_MODULES(SOUP, libsoup-3.0 >= 3.0.3)
+ PKG_CHECK_MODULES(UUID, uuid >= 2.16.0)
+ PKG_CHECK_MODULES(JSON, json-glib-1.0 >= 0.14.0)
+ 
+--- eventdance.orig/evd/evd-http-request.h
++++ eventdance/evd/evd-http-request.h
+@@ -27,8 +27,6 @@
+ #error "Only <evd.h> can be included directly."
+ #endif
+ 
+-#include <libsoup/soup-uri.h>
+-
+ #include "evd-http-message.h"
+ 
+ G_BEGIN_DECLS
+@@ -66,7 +64,7 @@
+ 
+  gchar                  *evd_http_request_get_path          (EvdHttpRequest *self);
+ 
+-SoupURI                 *evd_http_request_get_uri           (EvdHttpRequest *self);
++GUri                    *evd_http_request_get_uri           (EvdHttpRequest *self);
+ 
+ gchar                   *evd_http_request_to_string         (EvdHttpRequest *self,
+                                                              gsize          *size);
+--- eventdance.orig/evd/evd-http-connection.c
++++ eventdance/evd/evd-http-connection.c
+@@ -21,6 +21,7 @@
+  */
+ 
+ #include <string.h>
++#include <libsoup/soup-uri-utils.h>
+ 
+ #include "evd-http-connection.h"
+ 
+@@ -221,13 +222,13 @@
+   response = (struct EvdHttpConnectionResponseHeaders *) data;
+ 
+   if (response->headers != NULL)
+-    soup_message_headers_free (response->headers);
++    soup_message_headers_unref (response->headers);
+   g_free (response->reason_phrase);
+ 
+   g_free (response);
+ }
+ 
+-static SoupURI *
++static GUri *
+ evd_http_connection_build_uri (EvdHttpConnection  *self,
+                                const gchar        *path,
+                                SoupMessageHeaders *headers)
+@@ -235,7 +236,7 @@
+   gchar *scheme;
+   const gchar *host;
+   gchar *uri_str;
+-  SoupURI *uri;
++  GUri *uri;
+ 
+   if (evd_connection_get_tls_active (EVD_CONNECTION (self)))
+     scheme = g_strdup ("https");
+@@ -246,7 +247,8 @@
+ 
+   uri_str = g_strconcat (scheme, "://", host, path, NULL);
+ 
+-  uri = soup_uri_new (uri_str);
++  uri = g_uri_parse (uri_str, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED,
++                     NULL);
+ 
+   g_free (uri_str);
+   g_free (scheme);
+@@ -289,7 +291,7 @@
+           && version <= SOUP_HTTP_1_1)
+         {
+           EvdHttpRequest *request;
+-          SoupURI *uri;
++          GUri *uri;
+           const gchar *conn_header;
+ 
+           uri = evd_http_connection_build_uri (self, path, headers);
+@@ -301,7 +303,7 @@
+                                   "uri", uri,
+                                   NULL);
+ 
+-          soup_uri_free (uri);
++          g_uri_unref (uri);
+ 
+           evd_http_connection_set_current_request (self, request);
+ 
+@@ -323,7 +325,7 @@
+         }
+       else
+         {
+-          soup_message_headers_free (headers);
++          soup_message_headers_unref (headers);
+ 
+           g_simple_async_result_set_error (res,
+                                            G_IO_ERROR,
+@@ -1370,7 +1372,7 @@
+     }
+ 
+   if (headers == NULL)
+-    soup_message_headers_free (_headers);
++    soup_message_headers_unref (_headers);
+ 
+   return result;
+ }
+@@ -1460,7 +1462,7 @@
+                                         TRUE,
+                                         error);
+ 
+-  soup_message_headers_free (headers);
++  soup_message_headers_unref (headers);
+ 
+   return result;
+ }
+--- eventdance.orig/evd/evd-longpolling-server.c
++++ eventdance/evd/evd-longpolling-server.c
+@@ -256,14 +256,14 @@
+ evd_longpolling_server_resolve_action (EvdLongpollingServer *self,
+                                        EvdHttpRequest       *request)
+ {
+-  SoupURI *uri;
++  GUri *uri;
+   const gchar *path;
+   gchar **tokens;
+   gint i;
+   gchar *action = NULL;
+ 
+   uri = evd_http_request_get_uri (request);
+-  path = uri->path;
++  path = g_uri_get_path (uri);
+ 
+   tokens = g_strsplit (path, "/", 32);
+ 
+@@ -295,15 +295,17 @@
+   EvdLongpollingServer *self = EVD_LONGPOLLING_SERVER (web_service);
+   gchar *action;
+   EvdPeer *peer;
+-  SoupURI *uri;
++  GUri *uri;
++  const gchar *query;
+ 
+   uri = evd_http_request_get_uri (request);
+ 
+-  self->priv->current_peer_id = uri->query;
++  query = g_uri_get_query (uri);
++  self->priv->current_peer_id = query;
+ 
+-  if (uri->query == NULL ||
++  if (query == NULL ||
+       (peer = evd_transport_lookup_peer (EVD_TRANSPORT (self),
+-                                         uri->query)) == NULL)
++                                         query)) == NULL)
+     {
+       EVD_WEB_SERVICE_GET_CLASS (self)->respond (EVD_WEB_SERVICE (self),
+                                                  conn,
+@@ -534,7 +536,7 @@
+         flush_and_return_connection (EVD_WEB_SERVICE (self), conn);
+     }
+ 
+-  soup_message_headers_free (headers);
++  soup_message_headers_unref (headers);
+ 
+   return result;
+ }
+--- eventdance.orig/evd/evd-web-service.c
++++ eventdance/evd/evd-web-service.c
+@@ -215,7 +215,7 @@
+                   0,
+                   NULL);
+ 
+-  soup_message_headers_free (res_headers);
++  soup_message_headers_unref (res_headers);
+ }
+ 
+ static gboolean
+@@ -514,7 +514,7 @@
+     }
+ 
+   if (headers == NULL)
+-    soup_message_headers_free (_headers);
++    soup_message_headers_unref (_headers);
+ 
+   return result;
+ }
+@@ -818,7 +818,7 @@
+                                                        error);
+ 
+   if (headers == NULL)
+-    soup_message_headers_free (headers);
++    soup_message_headers_unref (headers);
+ 
+   return result;
+ }
+--- eventdance.orig/evd/evd-websocket-protocol.c
++++ eventdance/evd/evd-websocket-protocol.c
+@@ -829,7 +829,7 @@
+  finish:
+ 
+   if (res_headers != NULL)
+-    soup_message_headers_free (res_headers);
++    soup_message_headers_unref (res_headers);
+ 
+   return result;
+ }
+--- eventdance.orig/evd/evd-websocket-server.c
++++ eventdance/evd/evd-websocket-server.c
+@@ -306,7 +306,7 @@
+ {
+   EvdWebsocketServer *self = EVD_WEBSOCKET_SERVER (web_service);
+   EvdPeer *peer = NULL;
+-  SoupURI *uri;
++  GUri *uri;
+   guint validate_result;
+   EvdTransportInterface *iface;
+   GError *error = NULL;
+@@ -315,7 +315,8 @@
+   uri = evd_http_request_get_uri (request);
+ 
+   /* resolve peer */
+-  peer = evd_transport_lookup_peer (EVD_TRANSPORT (self), uri->query);
++  peer = evd_transport_lookup_peer (EVD_TRANSPORT (self),
++                                    g_uri_get_query (uri));
+   if (peer == NULL)
+     {
+       if (! self->priv->standalone)
+--- eventdance.orig/evd/evd-websocket-client.c
++++ eventdance/evd/evd-websocket-client.c
+@@ -21,6 +21,7 @@
+  */
+ 
+ #include <libsoup/soup-headers.h>
++#include <libsoup/soup-uri-utils.h>
+ 
+ #include "evd-websocket-client.h"
+ 
+@@ -460,7 +461,7 @@
+   g_free (data->handshake_key);
+ 
+   if (data->res_headers != NULL)
+-    soup_message_headers_free (data->res_headers);
++    soup_message_headers_unref (data->res_headers);
+ 
+   g_slice_free (ConnectionData, data);
+ }
+@@ -679,12 +680,14 @@
+                 GSimpleAsyncResult *async_result,
+                 GCancellable       *cancellable)
+ {
+-  SoupURI *uri;
++  GUri *uri;
+   EvdWebsocketClient *self = EVD_WEBSOCKET_CLIENT (transport);
+   gchar *addr;
++  const gchar *scheme;
+   ConnectionData *data;
+ 
+-  uri = soup_uri_new (address);
++  uri = g_uri_parse (address, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED,
++                     NULL);
+   if (uri == NULL)
+     {
+       g_simple_async_result_set_error (async_result,
+@@ -698,7 +701,8 @@
+     }
+ 
+   /* validate URI scheme */
+-  if (g_strcmp0 (uri->scheme, "ws") != 0 && g_strcmp0 (uri->scheme, "wss") != 0)
++  scheme = g_uri_get_scheme (uri);
++  if (g_strcmp0 (scheme, "ws") != 0 && g_strcmp0 (scheme, "wss") != 0)
+     {
+       g_simple_async_result_set_error (async_result,
+                                        G_IO_ERROR,
+@@ -720,13 +724,13 @@
+ 
+   /* connection pool */
+   addr = g_strdup_printf ("%s:%d",
+-                          soup_uri_get_host (uri),
+-                          soup_uri_get_port (uri));
++                          g_uri_get_host (uri),
++                          g_uri_get_port (uri));
+ 
+   data->pool = evd_connection_pool_new (addr, EVD_TYPE_HTTP_CONNECTION);
+ 
+   /* if scheme is WSS (secure WebSocket), set connection pool to auto start TLS */
+-  if (g_strcmp0 (uri->scheme, "wss") == 0)
++  if (g_strcmp0 (scheme, "wss") == 0)
+     evd_connection_pool_set_tls_autostart (data->pool, TRUE);
+ 
+   g_free (addr);
+@@ -735,7 +739,7 @@
+   get_connection (data->pool, cancellable, data);
+ 
+  out:
+-  soup_uri_free (uri);
++  g_uri_unref (uri);
+ }
+ 
+ /* public methods */
+--- eventdance.orig/evd/evd-web-selector.c
++++ eventdance/evd/evd-web-selector.c
+@@ -158,7 +158,7 @@
+   EvdWebSelector *self = EVD_WEB_SELECTOR (web_service);
+   EvdService *service;
+ 
+-  SoupURI *uri;
++  GUri *uri;
+   SoupMessageHeaders *headers;
+   const gchar *domain;
+ 
+@@ -169,7 +169,8 @@
+ 
+   domain = soup_message_headers_get_one (headers, "host");
+ 
+-  if ( (service = evd_web_selector_find_match (self, domain, uri->path)) == NULL)
++  if ((service = evd_web_selector_find_match (self, domain,
++                                              g_uri_get_path (uri))) == NULL)
+     service = self->priv->default_service;
+ 
+   if (service != NULL)
+--- eventdance.orig/evd/evd-http-message.c
++++ eventdance/evd/evd-http-message.c
+@@ -113,7 +113,7 @@
+   EvdHttpMessage *self = EVD_HTTP_MESSAGE (obj);
+ 
+   if (self->priv->headers != NULL)
+-    soup_message_headers_free (self->priv->headers);
++    soup_message_headers_unref (self->priv->headers);
+ 
+   G_OBJECT_CLASS (evd_http_message_parent_class)->finalize (obj);
+ }
+@@ -136,7 +136,7 @@
+ 
+     case PROP_HEADERS:
+       if (self->priv->headers != NULL)
+-        soup_message_headers_free (self->priv->headers);
++        soup_message_headers_unref (self->priv->headers);
+       self->priv->headers = g_value_get_boxed (value);
+       break;
+ 
+--- eventdance.orig/evd/evd-web-transport-server.c
++++ eventdance/evd/evd-web-transport-server.c
+@@ -21,6 +21,7 @@
+  */
+ 
+ #include <json-glib/json-glib.h>
++#include <libsoup/soup-uri-utils.h>
+ #include <string.h>
+ 
+ #include "evd-web-transport-server.h"
+@@ -392,7 +393,7 @@
+   EvdWebTransportServer *self;
+   gchar *mechanism_url;
+   GError *error = NULL;
+-  SoupURI *uri = NULL;
++  GUri *uri = NULL;
+ 
+   JsonObject *request_obj;
+   JsonObject *response_obj;
+@@ -431,45 +432,52 @@
+       const gchar *uri_str;
+ 
+       uri_str = json_object_get_string_member (request_obj, "url");
+-      uri = soup_uri_new (uri_str);
++      uri = g_uri_parse (uri_str,
++                         SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED,
++                         NULL);
+ 
+       /* @TODO: validate that uri is not null and fail the handshake if so */
+     }
+ 
+   if (uri == NULL)
+-    uri = soup_uri_copy (evd_http_request_get_uri (data->request));
++    uri = g_uri_ref (evd_http_request_get_uri (data->request));
+ 
+   /* websocket? */
+   if (self->priv->enable_ws &&
+       has_mechanism (request_mechs, WEB_SOCKET_MECHANISM_NAME))
+     {
+-      SoupURI *ws_uri;
++      GUri *ws_uri, *tmp_uri;
+       gboolean tls = FALSE;
+-      guint32 port = 0;
+ 
+       if (self->priv->external_url != NULL)
+         {
+-          ws_uri = soup_uri_new (self->priv->external_url);
+-          if (g_strcmp0 (ws_uri->scheme, "https") == 0)
++          tmp_uri = g_uri_parse (self->priv->external_url,
++                                 SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED,
++                                 NULL);
++          if (g_strcmp0 (g_uri_get_scheme (tmp_uri), "https") == 0)
+             tls = TRUE;
+         }
+       else
+         {
+-          ws_uri = soup_uri_copy (uri);
++          tmp_uri = g_uri_ref (uri);
+           if (evd_connection_get_tls_active (EVD_CONNECTION (data->conn)))
+             tls = TRUE;
+         }
+ 
+-      port = ws_uri->port;
+       if (tls)
+-        soup_uri_set_scheme (ws_uri, "wss");
++        ws_uri = soup_uri_copy (tmp_uri, SOUP_URI_SCHEME, "wss",
++                                SOUP_URI_PORT, g_uri_get_port (tmp_uri),
++                                SOUP_URI_PATH, self->priv->ws_base_path,
++                                SOUP_URI_NONE);
+       else
+-        soup_uri_set_scheme (ws_uri, "ws");
+-      ws_uri->port = port;
+-
+-      soup_uri_set_path (ws_uri, self->priv->ws_base_path);
+-      mechanism_url = soup_uri_to_string (ws_uri, FALSE);
+-      soup_uri_free (ws_uri);
++        ws_uri = soup_uri_copy (tmp_uri, SOUP_URI_SCHEME, "ws",
++                                SOUP_URI_PORT, g_uri_get_port (tmp_uri),
++                                SOUP_URI_PATH, self->priv->ws_base_path,
++                                SOUP_URI_NONE);
++
++      mechanism_url = g_uri_to_string_partial (ws_uri, G_URI_HIDE_PASSWORD);
++      g_uri_unref (tmp_uri);
++      g_uri_unref (ws_uri);
+ 
+       add_mechanism_to_response_list (response_mechs,
+                                       WEB_SOCKET_MECHANISM_NAME,
+@@ -480,16 +488,21 @@
+   /* long-polling? */
+   if (has_mechanism (request_mechs, LONG_POLLING_MECHANISM_NAME))
+     {
+-      SoupURI *lp_uri;
++      GUri *lp_uri, *tmp_uri;
+ 
+       if (self->priv->external_url != NULL)
+-        lp_uri = soup_uri_new (self->priv->external_url);
++        tmp_uri = g_uri_parse (self->priv->external_url,
++                               SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED,
++                               NULL);
+       else
+-        lp_uri = soup_uri_copy (uri);
+-      soup_uri_set_path (lp_uri, self->priv->lp_base_path);
+-      soup_uri_set_query (lp_uri, NULL);
+-      mechanism_url = soup_uri_to_string (lp_uri, FALSE);
+-      soup_uri_free (lp_uri);
++        tmp_uri = g_uri_ref (uri);
++      lp_uri = soup_uri_copy (tmp_uri,
++                              SOUP_URI_PATH, self->priv->lp_base_path,
++                              SOUP_URI_QUERY, NULL,
++                              SOUP_URI_NONE);
++      mechanism_url = g_uri_to_string_partial (lp_uri, G_URI_HIDE_PASSWORD);
++      g_uri_unref (tmp_uri);
++      g_uri_unref (lp_uri);
+ 
+       add_mechanism_to_response_list (response_mechs,
+                                       LONG_POLLING_MECHANISM_NAME,
+@@ -527,9 +540,9 @@
+       g_error_free (error);
+     }
+ 
+-  soup_message_headers_free (headers);
++  soup_message_headers_unref (headers);
+ 
+-  soup_uri_free (uri);
++  g_uri_unref (uri);
+   g_free (content);
+ }
+ 
+@@ -756,26 +769,29 @@
+                                      EvdHttpRequest    *request)
+ {
+   EvdWebTransportServer *self = EVD_WEB_TRANSPORT_SERVER (web_service);
+-  SoupURI *uri;
++  GUri *uri;
+   EvdWebService *actual_service;
++  const gchar *path, *query;
+ 
+   uri = evd_http_request_get_uri (request);
++  path = g_uri_get_path (uri);
++  query = g_uri_get_query (uri);
+ 
+   /* handshake? */
+-  if (g_strcmp0 (uri->path, self->priv->hs_base_path) == 0)
++  if (g_strcmp0 (path, self->priv->hs_base_path) == 0)
+     {
+       evd_web_transport_server_read_handshake_data (self, conn, request);
+     }
+   /* longpolling or websocket? */
+   else if ((actual_service =
+-            get_actual_transport_from_path (self, uri->path)) != NULL)
++            get_actual_transport_from_path (self, path)) != NULL)
+     {
+       EvdPeer *peer;
+       EvdTransport *current_transport;
+ 
+-      if (uri->query != NULL &&
++      if (query != NULL &&
+           (peer = evd_transport_lookup_peer (EVD_TRANSPORT (self),
+-                                             uri->query)) != NULL)
++                                             query)) != NULL)
+         {
+           evd_peer_touch (peer);
+ 
+--- eventdance.orig/evd/evd-web-dir.c
++++ eventdance/evd/evd-web-dir.c
+@@ -265,7 +265,7 @@
+     g_slice_free1 (BLOCK_SIZE, binding->buffer);
+ 
+   if (binding->response_headers != NULL)
+-    soup_message_headers_free (binding->response_headers);
++    soup_message_headers_unref (binding->response_headers);
+ 
+   g_free (binding->filename);
+ 
+@@ -292,7 +292,7 @@
+       break;
+ 
+     default:
+-      binding->response_status_code = SOUP_STATUS_IO_ERROR;
++      binding->response_status_code = G_IO_ERROR_FAILED;
+       break;
+     }
+ 
+@@ -433,7 +433,7 @@
+   gboolean result = FALSE;
+   SoupMessageHeaders *req_headers;
+   const gchar *modified_date_st;
+-  SoupDate *modified_date;
++  GDateTime *modified_date;
+ 
+   req_headers = evd_http_message_get_headers (EVD_HTTP_MESSAGE (request));
+ 
+@@ -442,12 +442,12 @@
+   if (modified_date_st == NULL)
+     return FALSE;
+ 
+-  modified_date = soup_date_new_from_string (modified_date_st);
++  modified_date = soup_date_time_new_from_http_string (modified_date_st);
+   if (modified_date != NULL)
+     {
+       guint64 modified_date_int;
+ 
+-      modified_date_int = soup_date_to_time_t (modified_date);
++      modified_date_int = g_date_time_to_unix (modified_date);
+ 
+       if (modified_date_int >= file_last_modified_time)
+         {
+@@ -470,7 +470,7 @@
+         }
+     }
+ 
+-  soup_date_free (modified_date);
++  g_date_time_unref (modified_date);
+ 
+   return result;
+ }
+@@ -492,7 +492,7 @@
+   SoupMessageHeaders *headers = NULL;
+ 
+   guint64 file_modified_date_int;
+-  SoupDate *sdate;
++  GDateTime *sdate;
+   gchar *date;
+ 
+   request = binding->request;
+@@ -569,11 +569,11 @@
+     }
+ 
+   /* set 'last-modified' header in response */
+-  sdate = soup_date_new_from_time_t (file_modified_date_int);
+-  date = soup_date_to_string (sdate, SOUP_DATE_HTTP);
++  sdate = g_date_time_new_from_unix_utc (file_modified_date_int);
++  date = soup_date_time_to_string (sdate, SOUP_DATE_HTTP);
+   soup_message_headers_replace (headers, "Last-Modified", date);
+   g_free (date);
+-  soup_date_free (sdate);
++  g_date_time_unref (sdate);
+ 
+   /* check cross origin */
+   if (evd_http_request_is_cross_origin (request))
+@@ -609,7 +609,7 @@
+ 
+  out:
+   if (headers != NULL)
+-    soup_message_headers_free (headers);
++    soup_message_headers_unref (headers);
+   g_object_unref (info);
+ }
+ 
+@@ -664,7 +664,8 @@
+   EvdWebDir *self = EVD_WEB_DIR (web_service);
+   gchar *filename = NULL;
+   EvdWebDirBinding *binding;
+-  SoupURI *uri;
++  GUri *uri;
++  const gchar *path;
+   const gchar *path_without_alias = "";
+ 
+   if (! evd_web_dir_method_allowed (self,
+@@ -690,12 +691,13 @@
+     }
+ 
+   uri = evd_http_request_get_uri (request);
++  path = g_uri_get_path (uri);
+ 
+   if (self->priv->alias != NULL)
+     {
+-      if (g_strstr_len (uri->path, -1, self->priv->alias) == uri->path)
++      if (g_strstr_len (path, -1, self->priv->alias) == path)
+         {
+-          path_without_alias = uri->path + strlen (self->priv->alias);
++          path_without_alias = path + strlen (self->priv->alias);
+         }
+       else
+         {
+@@ -720,7 +722,7 @@
+     }
+   else
+     {
+-      path_without_alias = uri->path;
++      path_without_alias = path;
+     }
+ 
+   filename = g_strconcat (self->priv->root,
+--- eventdance.orig/evd/evd-http-request.c
++++ eventdance/evd/evd-http-request.c
+@@ -23,6 +23,7 @@
+ #include <string.h>
+ 
+ #include <libsoup/soup-method.h>
++#include <libsoup/soup-uri-utils.h>
+ 
+ #include "evd-http-request.h"
+ 
+@@ -36,7 +37,7 @@
+ struct _EvdHttpRequestPrivate
+ {
+   gchar *method;
+-  SoupURI *uri;
++  GUri *uri;
+ };
+ 
+ /* properties */
+@@ -93,7 +94,7 @@
+                                    g_param_spec_boxed ("uri",
+                                                        "Request URI",
+                                                        "The URI of the requested resource",
+-                                                       SOUP_TYPE_URI,
++                                                       G_TYPE_URI,
+                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+                                                        G_PARAM_STATIC_STRINGS));
+ 
+@@ -123,7 +124,7 @@
+   g_free (self->priv->method);
+ 
+   if (self->priv->uri != NULL)
+-    soup_uri_free (self->priv->uri);
++    g_uri_unref (self->priv->uri);
+ 
+   G_OBJECT_CLASS (evd_http_request_parent_class)->finalize (obj);
+ }
+@@ -190,15 +191,16 @@
+ evd_http_request_new (const gchar *method, const gchar *url)
+ {
+   EvdHttpRequest *self;
+-  SoupURI *uri;
++  GUri *uri;
+ 
+-  uri = soup_uri_new (url);
++  uri = g_uri_parse (url, SOUP_HTTP_URI_FLAGS | G_URI_FLAGS_PARSE_RELAXED,
++                     NULL);
+ 
+   self = g_object_new (EVD_TYPE_HTTP_REQUEST,
+                        "method", method,
+                        "uri", uri,
+                        NULL);
+-  soup_uri_free (uri);
++  g_uri_unref (uri);
+ 
+   return self;
+ }
+@@ -216,7 +218,8 @@
+ {
+   g_return_val_if_fail (EVD_IS_HTTP_REQUEST (self), NULL);
+ 
+-  return soup_uri_to_string (self->priv->uri, TRUE);
++  return g_strconcat (g_uri_get_path (self->priv->uri),
++                      g_uri_get_query (self->priv->uri), NULL);
+ }
+ 
+ /**
+@@ -224,7 +227,7 @@
+  *
+  * Returns: (transfer none):
+  **/
+-SoupURI *
++GUri *
+ evd_http_request_get_uri (EvdHttpRequest *self)
+ {
+   g_return_val_if_fail (EVD_IS_HTTP_REQUEST (self), NULL);
+@@ -275,12 +278,15 @@
+   /* determine 'Host' header */
+   if (soup_message_headers_get_one (headers, "Host") == NULL)
+     {
+-      if (self->priv->uri->port == 80)
+-        st = g_strdup_printf ("%s", self->priv->uri->host);
++      gint port;
++      const gchar *host;
++
++      host = g_uri_get_host (self->priv->uri);
++      port = g_uri_get_port (self->priv->uri);
++      if (port == 80)
++        st = g_strdup_printf ("%s", host);
+       else
+-        st = g_strdup_printf ("%s:%d",
+-                              self->priv->uri->host,
+-                              self->priv->uri->port);
++        st = g_strdup_printf ("%s:%d", host, port);
+       soup_message_headers_replace (headers, "Host", st);
+       g_free (st);
+     }
+@@ -458,9 +464,9 @@
+     return FALSE;
+ 
+   host = g_strdup_printf ("%s://%s:%d",
+-                          self->priv->uri->scheme,
+-                          self->priv->uri->host,
+-                          self->priv->uri->port);
++                          g_uri_get_scheme (self->priv->uri),
++                          g_uri_get_host (self->priv->uri),
++                          g_uri_get_port (self->priv->uri));
+ 
+   result = (g_strstr_len (host, -1, origin) != host);
+ 
+--- eventdance.orig/evd/evd-jsonrpc-http-client.c
++++ eventdance/evd/evd-jsonrpc-http-client.c
+@@ -142,14 +142,15 @@
+ {
+   EvdJsonrpcHttpClient *self = EVD_JSONRPC_HTTP_CLIENT (obj);
+ 
+-  SoupURI *uri;
++  GUri *uri;
+   gchar *sock_addr;
+ 
+   self->priv->http_request = evd_http_request_new (SOUP_METHOD_POST,
+                                                    self->priv->url);
+ 
+   uri = evd_http_request_get_uri (self->priv->http_request);
+-  sock_addr = g_strdup_printf ("%s:%u", uri->host, uri->port);
++  sock_addr = g_strdup_printf ("%s:%u", g_uri_get_host (uri),
++                               g_uri_get_port (uri));
+ 
+   g_object_set (self,
+                 "address", sock_addr,
+@@ -350,7 +351,7 @@
+           g_error_free (error);
+         }
+ 
+-      soup_message_headers_free (headers);
++      soup_message_headers_unref (headers);
+       g_free (reason);
+     }
+ 
+--- eventdance.orig/evd/evd-jsonrpc-http-server.c
++++ eventdance/evd/evd-jsonrpc-http-server.c
+@@ -21,7 +21,7 @@
+  */
+ 
+ #include <string.h>
+-#include <libsoup/soup-date.h>
++#include <libsoup/soup-date-utils.h>
+ 
+ #include "evd-jsonrpc-http-server.h"
+ 
+@@ -157,7 +157,7 @@
+   evd_jsonrpc_transport_set_send_callback (self->priv->rpc, NULL, NULL, NULL);
+   g_object_unref (self->priv->rpc);
+ 
+-  soup_message_headers_free (self->priv->headers);
++  soup_message_headers_unref (self->priv->headers);
+ 
+   if (self->priv->method_call_user_data != NULL &&
+       self->priv->method_call_user_data_free_func)
+@@ -221,20 +221,22 @@
+   EvdJsonrpcHttpServer *self = EVD_JSONRPC_HTTP_SERVER (user_data);
+   EvdHttpConnection *conn = EVD_HTTP_CONNECTION (context);
+   GError *error = NULL;
+-  SoupDate *date;
++  GDateTime *date, *now;
+   gchar *date_str;
+ 
+   /* update 'Expire' header in response headers */
+-  date = soup_date_new_from_now (- 60 * 60 * 24); /* 24h in the past */
+-  date_str = soup_date_to_string (date, SOUP_DATE_HTTP);
+-  soup_date_free (date);
++  now = g_date_time_new_now_utc ();
++  date = g_date_time_add_days (now, -1); /* 24h in the past */
++  date_str = soup_date_time_to_string (date, SOUP_DATE_HTTP);
++  g_date_time_unref (now);
++  g_date_time_unref (date);
+   soup_message_headers_replace (self->priv->headers, "Expires", date_str);
+   g_free (date_str);
+ 
+   /* update 'Date' header in response headers */
+-  date = soup_date_new_from_now (0);
+-  date_str = soup_date_to_string (date, SOUP_DATE_HTTP);
+-  soup_date_free (date);
++  date = g_date_time_new_now_utc ();
++  date_str = soup_date_time_to_string (date, SOUP_DATE_HTTP);
++  g_date_time_unref (date);
+   soup_message_headers_replace (self->priv->headers, "Date", date_str);
+   g_free (date_str);
+ 
+--- eventdance.orig/evd/Makefile.am
++++ eventdance/evd/Makefile.am
+@@ -212,7 +212,7 @@
+ introspection_sources = $(evd_HEADERS) $(source_c)
+ 
+ @[email protected]: lib@[email protected] Makefile
+-@EVD_GIR_TARGET_NAME@_INCLUDES = GObject-2.0 Gio-2.0 Soup-2.4 Json-1.0
++@EVD_GIR_TARGET_NAME@_INCLUDES = GObject-2.0 Gio-2.0 Soup-3.0 Json-1.0
+ @EVD_GIR_TARGET_NAME@_CFLAGS = $(INCLUDES) $(JSON_CFLAGS)
+ @EVD_GIR_TARGET_NAME@_LIBS = @EVD_API_NAME@
+ @EVD_GIR_TARGET_NAME@_FILES = $(addprefix $(srcdir)/,$(introspection_sources))
+--- eventdance.orig/evd/evd-0.2.pc.in
++++ eventdance/evd/evd-0.2.pc.in
+@@ -8,7 +8,7 @@
+ 
+ Name: EventDance
+ Description: An event distribution framework.
+-Requires: glib-2.0 gio-2.0 gobject-2.0 libsoup-2.4 json-glib-1.0 gnutls uuid
++Requires: glib-2.0 gio-2.0 gobject-2.0 libsoup-3.0 json-glib-1.0 gnutls uuid
+ Version: @EVD_VERSION@
+ Libs: -L${libdir} -levd-@EVD_API_VERSION@
+ Cflags: -I${includedir}/evd-@EVD_API_VERSION@
diff --git a/debian/patches/series b/debian/patches/series
index 0e84935..bbef1b4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix-duplicate-header.patch
 remove-uuid-from-gir.patch
 fix-dbus-bridge-include.patch
 rename-bool-variable.patch
+libsoup3.patch
-- 
2.51.0

#include <evd.h>

int
main (void)
{
  EvdHttpRequest *request;
  SoupURI *uri;
  gchar *str;

  request = evd_http_request_new (SOUP_METHOD_GET, "http://example.org";);
  uri = evd_http_request_get_uri (request);
  str = soup_uri_to_string (uri, FALSE);

  g_print ("%s\n", str);

  g_object_unref (request);
  g_free (str);

  return 0;
}

/*
Local Variables:
compile-command: "make abi-test CFLAGS=\"-g `pkg-config --cflags evd-0.2`\" LDLIBS=\"`pkg-config --libs evd-0.2`\""
End:
*/

Reply via email to