sync with upstream 8d654296

This commit is contained in:
Kamil Dudka 2013-08-08 12:03:09 +02:00
parent ffc10dfe31
commit c2150c3aea
6 changed files with 3309 additions and 333 deletions

View File

@ -1,61 +0,0 @@
From a2fb13434cf975b2e9b19067c8968f91e190de5b Mon Sep 17 00:00:00 2001
From: Zdenek Pavlas <zpavlas@redhat.com>
Date: Wed, 13 Mar 2013 16:55:58 +0100
Subject: [PATCH 1/2] add the GLOBAL_ACK_EINTR constant to the list of exported symbols
... if built against a new enough version of libcurl
Bug: https://bugzilla.redhat.com/920589
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
src/pycurl.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/pycurl.c b/src/pycurl.c
index 619ca20..9950e00 100644
--- a/src/pycurl.c
+++ b/src/pycurl.c
@@ -3210,6 +3210,16 @@ static PyTypeObject CurlMulti_Type = {
*/
};
+static int
+are_global_init_flags_valid(int flags)
+{
+#ifdef CURL_GLOBAL_ACK_EINTR
+ /* CURL_GLOBAL_ACK_EINTR was introduced in libcurl-7.30.0 */
+ return !(flags & ~(CURL_GLOBAL_ALL | CURL_GLOBAL_ACK_EINTR));
+#else
+ return !(flags & ~(CURL_GLOBAL_ALL));
+#endif
+}
/*************************************************************************
// module level
@@ -3227,10 +3237,7 @@ do_global_init(PyObject *dummy, PyObject *args)
return NULL;
}
- if (!(option == CURL_GLOBAL_SSL ||
- option == CURL_GLOBAL_WIN32 ||
- option == CURL_GLOBAL_ALL ||
- option == CURL_GLOBAL_NOTHING)) {
+ if (!are_global_init_flags_valid(option)) {
PyErr_SetString(PyExc_ValueError, "invalid option to global_init");
return NULL;
}
@@ -3866,6 +3873,10 @@ initpycurl(void)
insint(d, "GLOBAL_ALL", CURL_GLOBAL_ALL);
insint(d, "GLOBAL_NOTHING", CURL_GLOBAL_NOTHING);
insint(d, "GLOBAL_DEFAULT", CURL_GLOBAL_DEFAULT);
+#ifdef CURL_GLOBAL_ACK_EINTR
+ /* CURL_GLOBAL_ACK_EINTR was introduced in libcurl-7.30.0 */
+ insint(d, "GLOBAL_ACK_EINTR", CURL_GLOBAL_ACK_EINTR);
+#endif
/* constants for curl_multi_socket interface */
--
1.7.1

View File

@ -0,0 +1,26 @@
From dc431c729b9639485a45dbd91e020c5c95508c90 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 8 Aug 2013 12:51:48 +0200
Subject: [PATCH 1/2] do_curl_getinfo: fix misplaced #endif
---
src/pycurl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/pycurl.c b/src/pycurl.c
index c8b8402..87dac7e 100644
--- a/src/pycurl.c
+++ b/src/pycurl.c
@@ -2481,8 +2481,8 @@ do_curl_getinfo(CurlObject *self, PyObject *args)
return convert_certinfo(clist);
}
}
- }
#endif
+ }
/* Got wrong option on the method call */
PyErr_SetString(PyExc_ValueError, "invalid argument to getinfo");
--
1.7.1

View File

@ -0,0 +1,26 @@
From 9540e6097563ea754b8619fe85ba010071a67244 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 8 Aug 2013 12:54:53 +0200
Subject: [PATCH 2/2] runwsgi.py: start the server explicitly at 127.0.0.1
Otherwise it may start on ::1, which would consequently break self-test.
---
tests/runwsgi.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tests/runwsgi.py b/tests/runwsgi.py
index c9bc236..096038c 100644
--- a/tests/runwsgi.py
+++ b/tests/runwsgi.py
@@ -85,7 +85,7 @@ class ServerThread(threading.Thread):
self.app = app
self.port = port
self.server_kwargs = server_kwargs
- self.server = server(host='localhost', port=self.port, **self.server_kwargs)
+ self.server = server(host='127.0.0.1', port=self.port, **self.server_kwargs)
def run(self):
bottle.run(self.app, server=self.server, quiet=True)
--
1.7.1

View File

@ -1,42 +0,0 @@
From 3fba1b63a99f68bedb9a3d60326d22bd8f10f83b Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 3 Apr 2013 15:06:32 +0200
Subject: [PATCH 2/2] tests/global_init_ack_eintr.py: test GLOBAL_ACK_EINTR
... if we have a new enough version of libcurl
---
tests/global_init_ack_eintr.py | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
create mode 100644 tests/global_init_ack_eintr.py
diff --git a/tests/global_init_ack_eintr.py b/tests/global_init_ack_eintr.py
new file mode 100644
index 0000000..429fc3f
--- /dev/null
+++ b/tests/global_init_ack_eintr.py
@@ -0,0 +1,22 @@
+#! /usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+# vi:ts=4:et
+
+import pycurl
+import unittest
+
+from . import util
+
+class GlobalInitAckEintrTest(unittest.TestCase):
+ def test_global_init_default(self):
+ # initialize libcurl with DEFAULT flags
+ pycurl.global_init(pycurl.GLOBAL_DEFAULT)
+ pycurl.global_cleanup()
+
+ def test_global_init_ack_eintr(self):
+ # the GLOBAL_ACK_EINTR flag was introduced in libcurl-7.30, but can also
+ # be backported for older versions of libcurl at the distribution level
+ if not util.pycurl_version_less_than(7, 30) or hasattr(pycurl, 'GLOBAL_ACK_EINTR'):
+ # initialize libcurl with the GLOBAL_ACK_EINTR flag
+ pycurl.global_init(pycurl.GLOBAL_ACK_EINTR)
+ pycurl.global_cleanup()
--
1.7.1

View File

@ -2,7 +2,7 @@
Name: python-pycurl
Version: 7.19.0
Release: 17.20120408git9b8f4e38%{?dist}
Release: 18.20130315git8d654296%{?dist}
Summary: A Python interface to libcurl
Group: Development/Languages
@ -10,18 +10,19 @@ License: LGPLv2+ or MIT
URL: http://pycurl.sourceforge.net/
Source0: http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz
# sync with upstream's 9b8f4e38
Patch0: 0000-pycurl-7.19.7-9b8f4e38.patch
# sync with upstream's 8d654296
Patch0: 0000-pycurl-7.19.7-8d654296.patch
# bz #920589 - add the GLOBAL_ACK_EINTR constant to the list of exported symbols
Patch1: 0001-add-the-GLOBAL_ACK_EINTR-constant-to-the-list-of-exp.patch
Patch2: 0002-tests-global_init_ack_eintr.py-test-GLOBAL_ACK_EINTR.patch
# get the test-suite running
Patch1: 0001-do_curl_getinfo-fix-misplaced-endif.patch
Patch2: 0002-runwsgi.py-start-the-server-explicitly-at-127.0.0.1.patch
Requires: keyutils-libs
BuildRequires: python-devel
BuildRequires: curl-devel >= 7.19.0
BuildRequires: openssl-devel
BuildRequires: python-bottle
BuildRequires: python-cherrypy
BuildRequires: python-nose
BuildRequires: vsftpd
@ -56,6 +57,9 @@ find -type f | xargs sed -i 's/\$Id: [^$]*\$/$Id$/'
%patch1 -p1
%patch2 -p1
# remove a test specific to OpenSSL-powered libcurl
rm -f tests/certinfo_test.py
# temporarily disable intermittently failing test-case
rm -f tests/multi_socket_select_test.py
@ -75,6 +79,9 @@ rm -rf %{buildroot}%{_datadir}/doc/pycurl
%{python_sitearch}/*
%changelog
* Thu Aug 08 2013 Kamil Dudka <kdudka@redhat.com> - 7.19.0-18.20130315git8d654296
- sync with upstream 8d654296
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.19.0-17.20120408git9b8f4e38
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild