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