[gajim/f13/master] - Fix high CPU usage when the server announces a strange streamhost (RHBZ#649986)

Michal Schmidt michich at fedoraproject.org
Fri Nov 5 21:38:30 UTC 2010


commit 49476c70429141b3a4ddefdd1a2efa71466cc05b
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Fri Nov 5 22:36:52 2010 +0100

    - Fix high CPU usage when the server announces a strange streamhost
      (RHBZ#649986)

 gajim-0.14-check-error.patch |   37 +++++++++++++++++++++++++++++++++++++
 gajim.spec                   |    8 +++++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/gajim-0.14-check-error.patch b/gajim-0.14-check-error.patch
new file mode 100644
index 0000000..8bffbc3
--- /dev/null
+++ b/gajim-0.14-check-error.patch
@@ -0,0 +1,37 @@
+check error before incoming or outgoing events
+
+https://bugzilla.redhat.com/show_bug.cgi?id=649986
+http://trac.gajim.org/ticket/5991
+
+diff -r c47219e5a552 -r ba5c2eb1f1e7 src/common/xmpp/idlequeue.py
+--- a/src/common/xmpp/idlequeue.py	Mon Oct 25 20:09:30 2010 +0200
++++ b/src/common/xmpp/idlequeue.py	Mon Oct 25 21:06:45 2010 +0200
+@@ -388,20 +388,22 @@
+             self.unplug_idle(fd)
+             return False
+ 
++        if flags & IS_CLOSED:
++            # io error, don't expect more events
++            self.remove_timeout(obj.fd)
++            self.unplug_idle(obj.fd)
++            obj.pollend()
++            return False
++
+         if flags & PENDING_READ:
+             #print 'waiting read on %d, flags are %d' % (fd, flags)
+             obj.pollin()
+             return True
+ 
+-        elif flags & PENDING_WRITE:
++        if flags & PENDING_WRITE:
+             obj.pollout()
+             return True
+ 
+-        elif flags & IS_CLOSED:
+-            # io error, don't expect more events
+-            self.remove_timeout(obj.fd)
+-            self.unplug_idle(obj.fd)
+-            obj.pollend()
+         return False
+ 
+     def process(self):
diff --git a/gajim.spec b/gajim.spec
index 9c62885..a0714bf 100644
--- a/gajim.spec
+++ b/gajim.spec
@@ -2,7 +2,7 @@ Summary:	Jabber client written in PyGTK
 Name:		gajim
 %global		majorver 0.14
 Version:	0.14.1
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPLv3
 Group:		Applications/Internet
 URL:		http://gajim.org/
@@ -10,6 +10,7 @@ Source0:	http://gajim.org/downloads/%{majorver}/%{name}-%{version}.tar.bz2
 # libasyncns triggers a kernel bug (RHBZ#529202), so let's not use it until
 # it's fixed.
 Patch2:		gajim-0.14-disable-libasyncns.patch
+Patch4:		gajim-0.14-check-error.patch
 BuildArch:	noarch
 BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
@@ -62,6 +63,7 @@ Gajim does not require GNOME to run, even though it exists with it nicely.
 %prep
 %setup -q
 %patch2 -p1
+%patch4 -p1
 
 %build
 %configure --docdir=%{_docdir}/%{name}-%{version}
@@ -119,6 +121,10 @@ rm -rf %{buildroot}
 %{_datadir}/%{name}/src
 
 %changelog
+* Fri Nov 05 2010 Michal Schmidt <mschmidt at redhat.com> 0.14.1-2
+- Fix high CPU usage when the server announces a strange streamhost
+  (RHBZ#649986)
+
 * Tue Oct 26 2010 Michal Schmidt <mschmidt at redhat.com> 0.14.1-1
 - Upstream bugfix release.
 - Dropped merged patches.


More information about the scm-commits mailing list