From 4f98f9a8383fe0a6fce8a8a3521b1e7d088d9783 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Fri, 15 Sep 2023 11:00:09 -0500 Subject: [PATCH] 3.4.3 --- .gitignore | 1 + ...er-don-t-crash-if-connection-outlive.patch | 79 ------------------- ...don-t-crash-if-connection-outlives-t.patch | 34 -------- libsoup3.spec | 9 +-- sources | 2 +- 5 files changed, 3 insertions(+), 122 deletions(-) delete mode 100644 0001-connection-manager-don-t-crash-if-connection-outlive.patch delete mode 100644 0002-connection-auth-don-t-crash-if-connection-outlives-t.patch diff --git a/.gitignore b/.gitignore index 2e49176..578bff9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /libsoup-3.4.0.tar.xz /libsoup-3.4.1.tar.xz /libsoup-3.4.2.tar.xz +/libsoup-3.4.3.tar.xz diff --git a/0001-connection-manager-don-t-crash-if-connection-outlive.patch b/0001-connection-manager-don-t-crash-if-connection-outlive.patch deleted file mode 100644 index a001329..0000000 --- a/0001-connection-manager-don-t-crash-if-connection-outlive.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 31d415ca44349fe8c4d2e0b2fb56f84501ec9524 Mon Sep 17 00:00:00 2001 -From: Michael Catanzaro -Date: Mon, 21 Aug 2023 12:54:53 -0500 -Subject: [PATCH 1/2] connection-manager: don't crash if connection outlives - its manager - -I have no clue whether SoupConnections are expected to outlive -SoupConnectionManager or not, but it's happening, and it doesn't seem too -surprising; after all, SoupConnection is a GObject, and things can keep -references to it. Guard against this by disconnecting from the signals -of each SoupConnection when destroying the SoupConnectionManager. - -Probably fixes #361 ---- - libsoup/soup-connection-manager.c | 34 +++++++++++++++++++++---------- - 1 file changed, 23 insertions(+), 11 deletions(-) - -diff --git a/libsoup/soup-connection-manager.c b/libsoup/soup-connection-manager.c -index e6f7caa7..5c4ec741 100644 ---- a/libsoup/soup-connection-manager.c -+++ b/libsoup/soup-connection-manager.c -@@ -206,6 +206,26 @@ soup_connection_manager_get_or_create_host_for_item (SoupConnectionManager *mana - return host; - } - -+static void -+soup_connection_manager_drop_connection (SoupConnectionManager *manager, -+ SoupConnection *conn) -+{ -+ g_signal_handlers_disconnect_by_data (conn, manager); -+ manager->num_conns--; -+ g_object_unref (conn); -+ -+ g_cond_broadcast (&manager->cond); -+} -+ -+static void -+remove_connection (gpointer key, -+ gpointer value, -+ gpointer user_data) -+{ -+ SoupConnectionManager *manager = user_data; -+ soup_connection_manager_drop_connection (manager, key); -+} -+ - SoupConnectionManager * - soup_connection_manager_new (SoupSession *session, - guint max_conns, -@@ -235,6 +255,9 @@ soup_connection_manager_new (SoupSession *session, - void - soup_connection_manager_free (SoupConnectionManager *manager) - { -+ g_hash_table_foreach (manager->conns, remove_connection, manager); -+ g_assert (manager->num_conns == 0); -+ - g_clear_object (&manager->remote_connectable); - g_hash_table_destroy (manager->http_hosts); - g_hash_table_destroy (manager->https_hosts); -@@ -293,17 +316,6 @@ soup_connection_manager_get_num_conns (SoupConnectionManager *manager) - return manager->num_conns; - } - --static void --soup_connection_manager_drop_connection (SoupConnectionManager *manager, -- SoupConnection *conn) --{ -- g_signal_handlers_disconnect_by_data (conn, manager); -- manager->num_conns--; -- g_object_unref (conn); -- -- g_cond_broadcast (&manager->cond); --} -- - static void - soup_connection_list_disconnect_all (GList *conns) - { --- -2.41.0 - diff --git a/0002-connection-auth-don-t-crash-if-connection-outlives-t.patch b/0002-connection-auth-don-t-crash-if-connection-outlives-t.patch deleted file mode 100644 index b2ddabc..0000000 --- a/0002-connection-auth-don-t-crash-if-connection-outlives-t.patch +++ /dev/null @@ -1,34 +0,0 @@ -From c978ab757ab62b295e65936858758fdf7e67b6bc Mon Sep 17 00:00:00 2001 -From: Michael Catanzaro -Date: Mon, 21 Aug 2023 12:56:55 -0500 -Subject: [PATCH 2/2] connection-auth: don't crash if connection outlives the - auth - -Currently we crash if the SoupConnection lives longer than the -SoupConnectionAuth. I'm unsure whether this is intended to happen, but -since it does happen, we should probably disconnect from the -SoupConnection's signal rather than crash when it does. - -Probably fixes #348 ---- - libsoup/auth/soup-connection-auth.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libsoup/auth/soup-connection-auth.c b/libsoup/auth/soup-connection-auth.c -index 2d9514f9..34d40d12 100644 ---- a/libsoup/auth/soup-connection-auth.c -+++ b/libsoup/auth/soup-connection-auth.c -@@ -113,8 +113,8 @@ soup_connection_auth_get_connection_state_for_message (SoupConnectionAuth *auth, - g_hash_table_insert (priv->conns, conn, state); - g_mutex_unlock (&priv->lock); - if (conn) { -- g_signal_connect (conn, "disconnected", -- G_CALLBACK (connection_disconnected), auth); -+ g_signal_connect_object (conn, "disconnected", -+ G_CALLBACK (connection_disconnected), auth, 0); - } - } else { - g_mutex_unlock (&priv->lock); --- -2.41.0 - diff --git a/libsoup3.spec b/libsoup3.spec index 1b8c675..347167b 100644 --- a/libsoup3.spec +++ b/libsoup3.spec @@ -1,20 +1,13 @@ %global glib2_version 2.69.1 Name: libsoup3 -Version: 3.4.2 +Version: 3.4.3 Release: %autorelease Summary: Soup, an HTTP library implementation License: LGPL-2.0-or-later URL: https://wiki.gnome.org/Projects/libsoup Source0: https://download.gnome.org/sources/libsoup/3.4/libsoup-%{version}.tar.xz -# https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/374 -# https://gitlab.gnome.org/GNOME/libsoup/-/issues/361 -# https://gitlab.gnome.org/GNOME/libsoup/-/issues/348 -# Fixes a couple of cases where apps can crash in connection_disconnect() -Patch: 0001-connection-manager-don-t-crash-if-connection-outlive.patch -Patch: 0002-connection-auth-don-t-crash-if-connection-outlives-t.patch - BuildRequires: gcc BuildRequires: gettext diff --git a/sources b/sources index e89a166..1c0141a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libsoup-3.4.2.tar.xz) = 711007599f639625fe2efdb7adb81de2dea0035180737ce0ec8234afb034646a2b6bd9ae384a69d6591aa142e91d245d502d13e1d97cd7b51c8c87c2d925f6b3 +SHA512 (libsoup-3.4.3.tar.xz) = 638b1eaefd60624f39edd0f16cea638c2edf6402318805c685f575577a228ba212c6f7ec8b64bac9f1928607e0026b69901e08b8569d179bf228e708e060a571