summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2012-01-27 17:33:42 +0000
committerAlexandre Rostovtsev <tetromino@gentoo.org>2012-01-27 17:33:42 +0000
commitf36c93117fdf576d8bd499a7ed64bfc7d868fd1d (patch)
tree6961dc2e35bd129bcde2190518ae4eb49767e57e /net-libs/libsoup
parentStable for amd64, wrt bug #400511 (diff)
downloadgentoo-2-f36c93117fdf576d8bd499a7ed64bfc7d868fd1d.tar.gz
gentoo-2-f36c93117fdf576d8bd499a7ed64bfc7d868fd1d.tar.bz2
gentoo-2-f36c93117fdf576d8bd499a7ed64bfc7d868fd1d.zip
Add patch from 2.37.x fixing "Too many open files" crash when loading some webpages. Thanks to Priit Laes for reporting.
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'net-libs/libsoup')
-rw-r--r--net-libs/libsoup/ChangeLog10
-rw-r--r--net-libs/libsoup/files/libsoup-2.36.1-SoupHTTPInputStream-GCancellable.patch102
-rw-r--r--net-libs/libsoup/libsoup-2.36.1-r1.ebuild73
3 files changed, 184 insertions, 1 deletions
diff --git a/net-libs/libsoup/ChangeLog b/net-libs/libsoup/ChangeLog
index 6a1423e781d6..ac93896ab6de 100644
--- a/net-libs/libsoup/ChangeLog
+++ b/net-libs/libsoup/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-libs/libsoup
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-libs/libsoup/ChangeLog,v 1.268 2012/01/18 21:03:29 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libsoup/ChangeLog,v 1.269 2012/01/27 17:33:42 tetromino Exp $
+
+*libsoup-2.36.1-r1 (27 Jan 2012)
+
+ 27 Jan 2012; Alexandre Rostovtsev <tetromino@gentoo.org>
+ +libsoup-2.36.1-r1.ebuild,
+ +files/libsoup-2.36.1-SoupHTTPInputStream-GCancellable.patch:
+ Add patch from 2.37.x fixing "Too many open files" crash when loading some
+ webpages. Thanks to Priit Laes for reporting.
18 Jan 2012; Markus Meier <maekke@gentoo.org> libsoup-2.36.1.ebuild:
arm stable, bug #393007
diff --git a/net-libs/libsoup/files/libsoup-2.36.1-SoupHTTPInputStream-GCancellable.patch b/net-libs/libsoup/files/libsoup-2.36.1-SoupHTTPInputStream-GCancellable.patch
new file mode 100644
index 000000000000..9e1a59e62cfb
--- /dev/null
+++ b/net-libs/libsoup/files/libsoup-2.36.1-SoupHTTPInputStream-GCancellable.patch
@@ -0,0 +1,102 @@
+From 856df33301221711789f0db744fce951eb70ba76 Mon Sep 17 00:00:00 2001
+From: Dan Winship <danw@gnome.org>
+Date: Mon, 23 Jan 2012 12:34:12 -0500
+Subject: [PATCH] SoupHTTPInputStream: don't burn through GCancellable fds
+
+SoupSession limits the number of outgoing TCP connections, but
+SoupRequestHTTP/SoupHTTPInputStream were still using a file descriptor
+for the GCancellable of each request that got queued, even before it
+was sent. This meant that if the app queued 1000ish requests all at
+once (eg, while rendering an HTML page with *lots* of images), we
+would run out of file descriptors.
+
+Fix this by just using the GCancellable::cancelled signal rather than
+g_cancellable_get_fd().
+
+https://bugzilla.gnome.org/show_bug.cgi?id=668508
+---
+ libsoup/soup-http-input-stream.c | 38 ++++++++++++++++----------------------
+ 1 files changed, 16 insertions(+), 22 deletions(-)
+
+diff --git a/libsoup/soup-http-input-stream.c b/libsoup/soup-http-input-stream.c
+index 45f181c..c0337e9 100644
+--- a/libsoup/soup-http-input-stream.c
++++ b/libsoup/soup-http-input-stream.c
+@@ -43,7 +43,7 @@ typedef struct {
+ goffset offset;
+
+ GCancellable *cancellable;
+- GSource *cancel_watch;
++ guint cancel_id;
+ SoupHTTPInputStreamCallback got_headers_cb;
+ SoupHTTPInputStreamCallback got_chunk_cb;
+ SoupHTTPInputStreamCallback finished_cb;
+@@ -323,39 +323,34 @@ soup_http_input_stream_finished (SoupMessage *msg, gpointer stream)
+ priv->finished_cb (stream);
+ }
+
+-static gboolean
+-soup_http_input_stream_cancelled (GIOChannel *chan, GIOCondition condition,
+- gpointer stream)
++static void
++soup_http_input_stream_cancelled (GCancellable *cancellable,
++ gpointer user_data)
+ {
++ SoupHTTPInputStream *stream = user_data;
+ SoupHTTPInputStreamPrivate *priv = SOUP_HTTP_INPUT_STREAM_GET_PRIVATE (stream);
+
+- priv->cancel_watch = NULL;
++ g_signal_handler_disconnect (cancellable, priv->cancel_id);
++ priv->cancel_id = 0;
+
+ soup_session_pause_message (priv->session, priv->msg);
+ if (priv->cancelled_cb)
+- priv->cancelled_cb (stream);
+-
+- return FALSE;
++ priv->cancelled_cb (G_INPUT_STREAM (stream));
+ }
+
+ static void
+ soup_http_input_stream_prepare_for_io (GInputStream *stream,
+ GCancellable *cancellable,
+ guchar *buffer,
+- gsize count)
++ gsize count)
+ {
+ SoupHTTPInputStreamPrivate *priv = SOUP_HTTP_INPUT_STREAM_GET_PRIVATE (stream);
+- int cancel_fd;
+
+ priv->cancellable = cancellable;
+- cancel_fd = g_cancellable_get_fd (cancellable);
+- if (cancel_fd != -1) {
+- GIOChannel *chan = g_io_channel_unix_new (cancel_fd);
+- priv->cancel_watch = soup_add_io_watch (priv->async_context, chan,
+- G_IO_IN | G_IO_ERR | G_IO_HUP,
+- soup_http_input_stream_cancelled,
+- stream);
+- g_io_channel_unref (chan);
++ if (cancellable) {
++ priv->cancel_id = g_signal_connect (cancellable, "cancelled",
++ G_CALLBACK (soup_http_input_stream_cancelled),
++ stream);
+ }
+
+ priv->caller_buffer = buffer;
+@@ -371,10 +366,9 @@ soup_http_input_stream_done_io (GInputStream *stream)
+ {
+ SoupHTTPInputStreamPrivate *priv = SOUP_HTTP_INPUT_STREAM_GET_PRIVATE (stream);
+
+- if (priv->cancel_watch) {
+- g_source_destroy (priv->cancel_watch);
+- priv->cancel_watch = NULL;
+- g_cancellable_release_fd (priv->cancellable);
++ if (priv->cancel_id) {
++ g_signal_handler_disconnect (priv->cancellable, priv->cancel_id);
++ priv->cancel_id = 0;
+ }
+ priv->cancellable = NULL;
+
+--
+1.7.8.4
+
diff --git a/net-libs/libsoup/libsoup-2.36.1-r1.ebuild b/net-libs/libsoup/libsoup-2.36.1-r1.ebuild
new file mode 100644
index 000000000000..dfb427bda83a
--- /dev/null
+++ b/net-libs/libsoup/libsoup-2.36.1-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libsoup/libsoup-2.36.1-r1.ebuild,v 1.1 2012/01/27 17:33:42 tetromino Exp $
+
+EAPI="4"
+GCONF_DEBUG="yes"
+GNOME2_LA_PUNT="yes"
+
+inherit autotools eutils gnome2
+
+DESCRIPTION="An HTTP library implementation in C"
+HOMEPAGE="http://live.gnome.org/LibSoup"
+
+LICENSE="LGPL-2"
+SLOT="2.4"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="debug doc +introspection samba ssl test"
+
+# glib-networking-2.29.18 needed to avoid a tls bug, see NEWS file
+RDEPEND=">=dev-libs/glib-2.30.0:2
+ >=dev-libs/libxml2-2:2
+ >=net-libs/glib-networking-2.30.0[ssl?]
+ introspection? ( >=dev-libs/gobject-introspection-0.9.5 )
+ samba? ( net-fs/samba )"
+DEPEND="${RDEPEND}
+ >=dev-util/pkgconfig-0.9
+ >=dev-util/gtk-doc-am-1.10
+ doc? ( >=dev-util/gtk-doc-1.10 )"
+# test? ( www-servers/apache[ssl,apache2_modules_auth_digest,apache2_modules_alias,apache2_modules_auth_basic,
+# apache2_modules_authn_file,apache2_modules_authz_host,apache2_modules_authz_user,apache2_modules_dir,
+# apache2_modules_mime,apache2_modules_proxy,apache2_modules_proxy_http,apache2_modules_proxy_connect]
+# dev-lang/php[apache2,xmlrpc]
+# net-misc/curl
+# net-libs/glib-networking[ssl])"
+
+pkg_setup() {
+ # Set invalid apache module dir until apache tests are ready, bug #326957
+ DOCS="AUTHORS NEWS README"
+ G2CONF="${G2CONF}
+ --disable-static
+ --disable-tls-check
+ --without-gnome
+ --with-apache-module-dir="${T}"
+ $(use_enable introspection)
+ $(use_with samba ntlm-auth ${EPREFIX}/usr/bin/ntlm_auth)"
+}
+
+src_configure() {
+ # FIXME: we need addpredict to workaround bug #324779 until
+ # root cause (bug #249496) is solved
+ addpredict /usr/share/snmp/mibs/.index
+ gnome2_src_configure
+}
+
+src_prepare() {
+ gnome2_src_prepare
+
+ if ! use test; then
+ # don't waste time building tests (bug #226271)
+ sed 's/^\(SUBDIRS =.*\)tests\(.*\)$/\1\2/' -i Makefile.am Makefile.in \
+ || die "sed failed"
+ fi
+
+ # Patch *must* be applied conditionally (see patch for details)
+ if use doc; then
+ # Fix bug 268592 (upstream #573685) (build fails without gnome && doc)
+ epatch "${FILESDIR}/${PN}-2.34.2-fix-build-without-gnome-with-doc.patch"
+ eautoreconf
+ fi
+
+ # Patch from 2.37.x, fixes 'Too many open files' error
+ epatch "${FILESDIR}/${P}-SoupHTTPInputStream-GCancellable.patch"
+}