Backport a patch to avoid DNS delays at plugin init
https://bugzilla.redhat.com/show_bug.cgi?id=969123
This commit is contained in:
parent
6a0fd5b782
commit
885e74af0d
67
0001-magnatune-Do-not-check-for-network-connectivity.patch
Normal file
67
0001-magnatune-Do-not-check-for-network-connectivity.patch
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
From cb432d7e87c661240baf3cba712811f60278678a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Victor Toso <me@victortoso.com>
|
||||||
|
Date: Wed, 5 Jun 2013 00:34:02 -0300
|
||||||
|
Subject: [PATCH] magnatune: Do not check for network connectivity
|
||||||
|
|
||||||
|
It fixex huge delay resolving dns.
|
||||||
|
|
||||||
|
g_network_monitor_can_reach() is sync and takes up to 30 seconds to
|
||||||
|
resolve dns with some users.
|
||||||
|
|
||||||
|
Link: https://bugzilla.gnome.org/show_bug.cgi?id=701336
|
||||||
|
---
|
||||||
|
src/magnatune/grl-magnatune.c | 24 ------------------------
|
||||||
|
1 file changed, 24 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/magnatune/grl-magnatune.c b/src/magnatune/grl-magnatune.c
|
||||||
|
index 3c82d32..bfbcca8 100644
|
||||||
|
--- a/src/magnatune/grl-magnatune.c
|
||||||
|
+++ b/src/magnatune/grl-magnatune.c
|
||||||
|
@@ -183,8 +183,6 @@ static void grl_magnatune_source_search(GrlSource *source,
|
||||||
|
static void grl_magnatune_source_browse(GrlSource *source,
|
||||||
|
GrlSourceBrowseSpec *bs);
|
||||||
|
|
||||||
|
-static gboolean magnatune_has_network_conn(void);
|
||||||
|
-
|
||||||
|
static void magnatune_get_db_async(OperationSpec *os);
|
||||||
|
|
||||||
|
/* ================== Magnatune Plugin ================= */
|
||||||
|
@@ -201,9 +199,6 @@ grl_magnatune_plugin_init(GrlRegistry *registry,
|
||||||
|
GRL_DEBUG("magnatune_plugin_init");
|
||||||
|
|
||||||
|
source = grl_magnatune_source_new();
|
||||||
|
- if (source->priv->db == NULL && magnatune_has_network_conn() == FALSE)
|
||||||
|
- return FALSE;
|
||||||
|
-
|
||||||
|
grl_registry_register_source(registry,
|
||||||
|
plugin,
|
||||||
|
GRL_SOURCE(source),
|
||||||
|
@@ -326,25 +321,6 @@ grl_magnatune_source_finalize(GObject *object)
|
||||||
|
|
||||||
|
/* ======================= Utilities ==================== */
|
||||||
|
|
||||||
|
-static gboolean
|
||||||
|
-magnatune_has_network_conn(void)
|
||||||
|
-{
|
||||||
|
- gboolean ret = FALSE;
|
||||||
|
- GNetworkMonitor *nm = NULL;
|
||||||
|
- GSocketConnectable *addr = NULL;
|
||||||
|
- GError *err = NULL;
|
||||||
|
-
|
||||||
|
- nm = g_network_monitor_get_default();
|
||||||
|
- addr = g_network_address_new("www.magnatune.com", 80);
|
||||||
|
-
|
||||||
|
- ret = g_network_monitor_can_reach(nm, addr, NULL, &err);
|
||||||
|
- if (ret == FALSE)
|
||||||
|
- GRL_WARNING("Plugin can't reach magnatune.com - '%s'", err->message);
|
||||||
|
-
|
||||||
|
- g_object_unref(addr);
|
||||||
|
- return ret;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static void
|
||||||
|
magnatune_get_crc_done(GObject *source_object,
|
||||||
|
GAsyncResult *res,
|
||||||
|
--
|
||||||
|
1.8.2.1
|
||||||
|
|
@ -3,13 +3,15 @@
|
|||||||
|
|
||||||
Name: grilo-plugins
|
Name: grilo-plugins
|
||||||
Version: 0.2.8
|
Version: 0.2.8
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Plugins for the Grilo framework
|
Summary: Plugins for the Grilo framework
|
||||||
|
|
||||||
Group: Applications/Multimedia
|
Group: Applications/Multimedia
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Url: https://live.gnome.org/Grilo
|
Url: https://live.gnome.org/Grilo
|
||||||
Source0: http://ftp.gnome.org/pub/GNOME/sources/grilo-plugins/%{release_version}/grilo-plugins-%{version}.tar.xz
|
Source0: http://ftp.gnome.org/pub/GNOME/sources/grilo-plugins/%{release_version}/grilo-plugins-%{version}.tar.xz
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=969123
|
||||||
|
Patch0: 0001-magnatune-Do-not-check-for-network-connectivity.patch
|
||||||
|
|
||||||
BuildRequires: grilo-devel >= 0.2.6
|
BuildRequires: grilo-devel >= 0.2.6
|
||||||
BuildRequires: glib2-devel >= 2.26.0
|
BuildRequires: glib2-devel >= 2.26.0
|
||||||
@ -52,6 +54,7 @@ This package contains plugins to get information from theses sources:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0 -p1 -b .dns_lookup
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -98,6 +101,9 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/*
|
|||||||
%{_libdir}/grilo-%{release_version}/*.xml
|
%{_libdir}/grilo-%{release_version}/*.xml
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 06 2013 Kalev Lember <kalevlember@gmail.com> - 0.2.8-2
|
||||||
|
- Backport a patch to avoid DNS delays at plugin init (#969123)
|
||||||
|
|
||||||
* Sat May 25 2013 Kalev Lember <kalevlember@gmail.com> - 0.2.8-1
|
* Sat May 25 2013 Kalev Lember <kalevlember@gmail.com> - 0.2.8-1
|
||||||
- Update to 0.2.8
|
- Update to 0.2.8
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user