[jabberpy/el5] use blocking read in initial communication with http proxy

Milan Zazrivec mzazrive at fedoraproject.org
Tue Jul 8 14:24:01 UTC 2014


commit 778c89ecb1dcbd126031db74397d2f1c4283f83c
Author: Milan Zazrivec <mzazrivec at redhat.com>
Date:   Tue Jul 8 16:21:41 2014 +0200

    use blocking read in initial communication with http proxy

 jabberpy-proxy-read.patch |   11 +++++++++++
 jabberpy.spec             |    7 ++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/jabberpy-proxy-read.patch b/jabberpy-proxy-read.patch
new file mode 100644
index 0000000..e723ee7
--- /dev/null
+++ b/jabberpy-proxy-read.patch
@@ -0,0 +1,11 @@
+--- jabberpy-0.5-0/jabber/xmlstream.py
++++ jabberpy-0.5-0/jabber/xmlstream.py
+@@ -522,7 +522,7 @@ class Client(Stream):
+             connector.append('\r\n')
+             bak = self._read , self._write
+             self.write('\r\n'.join(connector))
+-            reply = self.read().replace('\r','')
++            reply = self._read(BLOCK_SIZE).replace('\r','')
+             self._read , self._write = bak
+             try: proto,code,desc=reply.split('\n')[0].split(' ',2)
+             except: raise error('Invalid proxy reply')
diff --git a/jabberpy.spec b/jabberpy.spec
index b75e8e0..609aece 100644
--- a/jabberpy.spec
+++ b/jabberpy.spec
@@ -2,7 +2,7 @@
 Name:          jabberpy
 Version:       0.5
 # Used like this because upstream releases like 0.5-0
-Release:       0.18%{?dist}
+Release:       0.19%{?dist}
 Summary:       Python xmlstream and jabber IM protocol libs
 
 Group:         Development/Libraries
@@ -12,6 +12,7 @@ Source0:       http://downloads.sf.net/sourceforge/%{name}/%{name}-%{version}-0.
 Patch0:        jabberpy-no-init.patch
 Patch1:        jabberpy-clean-sockets.patch
 Patch2:        jabberpy-ipv6.patch
+Patch3:        jabberpy-proxy-read.patch
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:     noarch
@@ -31,6 +32,7 @@ chmod -x examples/*.py
 %patch0 -p1 -b .no-init
 %patch1 -p1 -b .clean-sockets
 %patch2 -p0 -b .ipv6
+%patch3 -p0 -b .proxy
 
 %build
 %{__python} setup.py  build
@@ -49,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Tue Jul  8 2014 Milan Zazrivec <mzazrivec at redhat.com> 0.5-0.19
+- non-blocking read in initial communication with proxy
+
 * Fri Sep 23 2011 Milan Zazrivec <mzazrivec at redhat.com> 0.5-0.18
 - 670881 - IPv6 support for jabberpy
 


More information about the scm-commits mailing list