curl-and-python

CURL_STATICLIB issue on Windows

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Tue, 8 Oct 2013 18:12:30 +0200

Hi list. My 1st post here.

pycurl.c has a "#define CURL_STATICLIB 1" unconditionally
for Windows. Why? I like to have my pycurl.pyd automatically
be updated with new features/bugfixes as libcurl.dll gets rebuilt.
Thus no need to rebuilt pycurl.pyd.

So can you please accept this patch:

@@ -37,7 +37,7 @@
 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
 # define WIN32 1
 #endif
-#if defined(WIN32)
+#if defined(WIN32) && !defined(PYCURL_USE_LIBCURL_DLL)
 # define CURL_STATICLIB 1
 #endif
 #include <Python.h>

Speaking of 'new features', since libcurl ver. 7.33 (I think?) the
very useful 'CURLOPT_DNS_SERVERS' option was added.
Could you add support for this too?

@@ -1906,6 +1906,9 @@
         case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
         case CURLOPT_CRLFILE:
         case CURLOPT_ISSUERCERT:
+#if LIBCURL_VERSION_NUM >= 0x072100
+ case CURLOPT_DNS_SERVERS:
+#endif
 /* FIXME: check if more of these options allow binary data */
             str = PyString_AsString_NoNUL(obj);
             if (str == NULL)
@@ -4160,6 +4163,10 @@
     insint_c(d, "PAUSE_CONT", CURLPAUSE_CONT);
 #endif

+#if LIBCURL_VERSION_NUM >= 0x072100
+ insint_c(d, "DNS_SERVERS", CURLOPT_DNS_SERVERS);
+#endif
+
     /* options for global_init() */
     insint(d, "GLOBAL_SSL", CURL_GLOBAL_SSL);
     insint(d, "GLOBAL_WIN32", CURL_GLOBAL_WIN32);

--gv

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2013-10-08