diffstat for libsoup3-3.2.3 libsoup3-3.2.3

 debian/changelog                                                               |    9 ++
 debian/patches/series                                                          |    1 
 debian/patches/tests-Gracefully-skip-test-if-a-large-memory-allocation-f.patch |   42 ++++++++++
 tests/http2-body-stream-test.c                                                 |   10 +-
 4 files changed, 60 insertions(+), 2 deletions(-)

diff -Nru libsoup3-3.2.3/debian/changelog libsoup3-3.2.3/debian/changelog
--- libsoup3-3.2.3/debian/changelog	2025-07-12 14:39:06.000000000 +0100
+++ libsoup3-3.2.3/debian/changelog	2025-08-25 16:06:45.000000000 +0100
@@ -1,3 +1,12 @@
+libsoup3 (3.2.3-0+deb12u2) bookworm; urgency=medium
+
+  * Team upload
+  * d/p/tests-Gracefully-skip-test-if-a-large-memory-allocation-f.patch:
+    Add proposed patch to fix a test failure on some 32-bit machines, in
+    particular Debian 12's mipsel buildds
+
+ -- Simon McVittie <smcv@debian.org>  Mon, 25 Aug 2025 16:06:45 +0100
+
 libsoup3 (3.2.3-0+deb12u1) bookworm; urgency=medium
 
   * Team upload
diff -Nru libsoup3-3.2.3/debian/patches/series libsoup3-3.2.3/debian/patches/series
--- libsoup3-3.2.3/debian/patches/series	2025-07-12 14:39:06.000000000 +0100
+++ libsoup3-3.2.3/debian/patches/series	2025-08-25 16:06:45.000000000 +0100
@@ -21,3 +21,4 @@
 headers-Handle-parsing-edge-case.patch
 headers-Handle-parsing-only-newlines.patch
 session-Strip-authentication-credentails-on-cross-origin-.patch
+tests-Gracefully-skip-test-if-a-large-memory-allocation-f.patch
diff -Nru libsoup3-3.2.3/debian/patches/tests-Gracefully-skip-test-if-a-large-memory-allocation-f.patch libsoup3-3.2.3/debian/patches/tests-Gracefully-skip-test-if-a-large-memory-allocation-f.patch
--- libsoup3-3.2.3/debian/patches/tests-Gracefully-skip-test-if-a-large-memory-allocation-f.patch	1970-01-01 01:00:00.000000000 +0100
+++ libsoup3-3.2.3/debian/patches/tests-Gracefully-skip-test-if-a-large-memory-allocation-f.patch	2025-08-25 16:06:45.000000000 +0100
@@ -0,0 +1,42 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Mon, 25 Aug 2025 11:11:22 +0100
+Subject: tests: Gracefully skip test if a large memory allocation fails
+
+On resource-constrained 32-bit machines, it might not be possible to
+allocate 1G of buffer space. Catch this and skip the test that uses
+very large buffers, instead of having it fail.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+Forwarded: https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/478
+---
+ tests/http2-body-stream-test.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tests/http2-body-stream-test.c b/tests/http2-body-stream-test.c
+index ee3218b..1fb804b 100644
+--- a/tests/http2-body-stream-test.c
++++ b/tests/http2-body-stream-test.c
+@@ -29,8 +29,13 @@ do_large_data_test (void)
+         GInputStream *stream = soup_body_input_stream_http2_new ();
+         SoupBodyInputStreamHttp2 *mem_stream = SOUP_BODY_INPUT_STREAM_HTTP2 (stream);
+         gsize data_needed = TEST_SIZE;
+-        guint8 *memory_chunk = g_new (guint8, CHUNK_SIZE); 
+-        guint8 *trash_buffer = g_new (guint8, CHUNK_SIZE);
++        guint8 *memory_chunk = g_try_new (guint8, CHUNK_SIZE);
++        guint8 *trash_buffer = g_try_new (guint8, CHUNK_SIZE);
++
++	if (memory_chunk == NULL || trash_buffer == NULL) {
++		g_test_skip ("large memory allocation failed");
++		goto out;
++	}
+ 
+         /* We can add unlimited data and as long as its read the data will
+          * be freed, so this should work fine even though its reading GB of data */
+@@ -55,6 +60,7 @@ do_large_data_test (void)
+                 data_needed -= CHUNK_SIZE;
+         }
+ 
++out:
+         g_free (trash_buffer);
+         g_free (memory_chunk);
+         g_object_unref (stream);
diff -Nru libsoup3-3.2.3/tests/http2-body-stream-test.c libsoup3-3.2.3/tests/http2-body-stream-test.c
--- libsoup3-3.2.3/tests/http2-body-stream-test.c	2024-11-25 00:39:07.000000000 +0000
+++ libsoup3-3.2.3/tests/http2-body-stream-test.c	2025-08-25 16:15:28.000000000 +0100
@@ -29,8 +29,13 @@
         GInputStream *stream = soup_body_input_stream_http2_new ();
         SoupBodyInputStreamHttp2 *mem_stream = SOUP_BODY_INPUT_STREAM_HTTP2 (stream);
         gsize data_needed = TEST_SIZE;
-        guint8 *memory_chunk = g_new (guint8, CHUNK_SIZE); 
-        guint8 *trash_buffer = g_new (guint8, CHUNK_SIZE);
+        guint8 *memory_chunk = g_try_new (guint8, CHUNK_SIZE);
+        guint8 *trash_buffer = g_try_new (guint8, CHUNK_SIZE);
+
+	if (memory_chunk == NULL || trash_buffer == NULL) {
+		g_test_skip ("large memory allocation failed");
+		goto out;
+	}
 
         /* We can add unlimited data and as long as its read the data will
          * be freed, so this should work fine even though its reading GB of data */
@@ -55,6 +60,7 @@
                 data_needed -= CHUNK_SIZE;
         }
 
+out:
         g_free (trash_buffer);
         g_free (memory_chunk);
         g_object_unref (stream);
