rpms/m2crypto/devel m2crypto-0.19.1-close-HTTPResponse.patch, NONE, 1.1 m2crypto.spec, 1.49, 1.50

Miloslav Trmac mitr at fedoraproject.org
Wed Feb 4 19:06:03 UTC 2009


Author: mitr

Update of /cvs/pkgs/rpms/m2crypto/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11227

Modified Files:
	m2crypto.spec 
Added Files:
	m2crypto-0.19.1-close-HTTPResponse.patch 
Log Message:
* Wed Feb  4 2009 Miloslav Trmač <mitr at redhat.com> - 0.19.1-5
- Close the connection when an m2urllib2 response is closed
  Resolves: #460692
- Work around conflicts between macros defined by gcc and swig


m2crypto-0.19.1-close-HTTPResponse.patch:

--- NEW FILE m2crypto-0.19.1-close-HTTPResponse.patch ---
Index: x/M2Crypto/m2urllib2.py
===================================================================
--- a/M2Crypto/m2urllib2.py	(revision 662)
+++ b/M2Crypto/m2urllib2.py	(working copy)
@@ -11,12 +11,28 @@
  - Add the M2Crypto HTTPSHandler when building a default opener.
 """
 
+import socket
 from urllib2 import *
 import urlparse
 
 import SSL
 import httpslib
 
+
+class _closing_fileobject(socket._fileobject):
+    '''socket._fileobject that propagates self.close() to the socket.
+
+    Python 2.5 provides this as socket._fileobject(sock, close=True).
+    '''
+
+    def __init__(self, sock):
+        socket._fileobject.__init__(self, sock)
+
+    def close(self):
+        sock = self._sock
+        socket._fileobject.close(self)
+        sock.close()
+
 class HTTPSHandler(AbstractHTTPHandler):
     def __init__(self, ssl_context = None):
         AbstractHTTPHandler.__init__(self)
@@ -81,7 +97,7 @@
         # out of socket._fileobject() and into a base class.
 
         r.recv = r.read
-        fp = socket._fileobject(r)
+        fp = _closing_fileobject(r)
 
         resp = addinfourl(fp, r.msg, req.get_full_url())
         resp.code = r.status


Index: m2crypto.spec
===================================================================
RCS file: /cvs/pkgs/rpms/m2crypto/devel/m2crypto.spec,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- m2crypto.spec	17 Jan 2009 14:57:43 -0000	1.49
+++ m2crypto.spec	4 Feb 2009 19:05:33 -0000	1.50
@@ -6,12 +6,14 @@
 Summary: Support for using OpenSSL in python scripts
 Name: m2crypto
 Version: 0.19.1
-Release: 4
+Release: 5
 Source0: http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-%{version}.tar.gz
 # https://bugzilla.osafoundation.org/show_bug.cgi?id=2341
 Patch0: m2crypto-0.18-timeouts.patch
 # This is only precautionary, it does fix anything - not sent upstream
 Patch1: m2crypto-0.18-gcc_macros.patch
+# https://bugzilla.osafoundation.org/show_bug.cgi?id=12718
+Patch2: m2crypto-0.19.1-close-HTTPResponse.patch
 License: MIT
 Group: System Environment/Libraries
 URL: http://wiki.osafoundation.org/bin/view/Projects/MeTooCrypto
@@ -27,6 +29,7 @@
 %setup -q -n M2Crypto-%{version}
 %patch0 -p1
 %patch1 -p1 -b .gcc_macros
+%patch2 -p1
 
 # Red Hat opensslconf.h #includes an architecture-specific file, but SWIG
 # doesn't follow the #include.
@@ -45,7 +48,8 @@
 done
 %endif
 
-gcc -E -dM - < /dev/null | grep -v __STDC__ > SWIG/gcc_macros.h
+gcc -E -dM - < /dev/null | grep -v __STDC__ \
+	| sed 's/^\(#define \([^ ]*\) .*\)$/#undef \2\n\1/' > SWIG/gcc_macros.h
 
 %build
 CFLAGS="$RPM_OPT_FLAGS" ; export CFLAGS
@@ -88,6 +92,11 @@
 %{python_sitearch}/M2Crypto-*.egg-info
 
 %changelog
+* Wed Feb  4 2009 Miloslav Trmač <mitr at redhat.com> - 0.19.1-5
+- Close the connection when an m2urllib2 response is closed
+  Resolves: #460692
+- Work around conflicts between macros defined by gcc and swig
+
 * Sat Jan 17 2009 Tomas Mraz <tmraz at redhat.com> - 0.19.1-4
 - rebuild with new openssl
 




More information about the fedora-extras-commits mailing list