Work around the removal of the CURLOPT_PASSWDFUNCTION and

CURLOPT_PASSWDDATA options which have been deprecated since curl-7.10.8.

Reported by:	dosirak via kris
This commit is contained in:
Peter Pentchev 2004-04-20 12:07:57 +00:00
parent b738c01a80
commit 7f6a1b771e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=107706
4 changed files with 93 additions and 1 deletions

View file

@ -8,7 +8,7 @@
PORTNAME= curlpp
PORTVERSION= 0.3.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= ftp
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}

View file

@ -0,0 +1,30 @@
Index: src/curl.cpp
===================================================================
RCS file: /home/cvs/ringlet/c/contrib/net/curlpp/src/curl.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- src/curl.cpp 13 Apr 2004 17:20:29 -0000 1.1.1.1
+++ src/curl.cpp 20 Apr 2004 11:18:15 -0000 1.2
@@ -193,13 +193,21 @@
void
curlpp::curl::passwd_function( passwd_function_t function )
{
+#if LIBCURL_VERSION_NUM < 0x070b01
option( CURLOPT_PASSWDFUNCTION, ( void * ) function );
+#else
+ runtime_assert( false, "The CURLOPT_PASSWDFUNCTION option has been deprecated." );
+#endif
}
void
curlpp::curl::passwd_data( passwd_trait *trait )
{
+#if LIBCURL_VERSION_NUM < 0x070b01
option( CURLOPT_PASSWDDATA, static_cast< void * >( trait ) );
+#else
+ runtime_assert( false, "The CURLOPT_PASSWDDATA option has been deprecated." );
+#endif
}
void

View file

@ -7,6 +7,7 @@
PORTNAME= WWW-Curl
PORTVERSION= 2.0
PORTREVISION= 1
CATEGORIES= www ftp perl5
MASTER_SITES= ${MASTER_SITE_PERL_CPAN} \
http://curl.haxx.se/libcurl/perl/

View file

@ -0,0 +1,61 @@
Index: Curl.xs
===================================================================
RCS file: /home/cvs/ringlet/perl/contrib/net/WWW-Curl/Curl.xs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Curl.xs 20 Apr 2004 10:55:02 -0000 1.1.1.1
+++ Curl.xs 20 Apr 2004 11:17:25 -0000 1.2
@@ -66,6 +66,12 @@
} perl_curl_easy;
+#if LIBCURL_VERSION_NUM >= 0x070b01
+typedef struct {
+ struct curl_httppost * post;
+ struct curl_httppost * last;
+} perl_curl_form;
+#else
#if LIBCURL_VERSION_NUM >= 0x070900
typedef struct {
struct HttpPost * post;
@@ -77,6 +83,7 @@
void * last;
} perl_curl_form;
#endif
+#endif
/* switch from curl option codes to the relevant callback index */
static perl_curl_easy_callback_code callback_index(int option) {
@@ -101,9 +108,11 @@
return CALLBACK_PROGRESS;
break;
+#if (LIBCURL_VERSION_NUM<0x070b01)
case CURLOPT_PASSWDFUNCTION:
case CURLOPT_PASSWDDATA:
return CALLBACK_PASSWD;
+#endif
break;
}
croak("Bad callback index requested\n");
@@ -617,7 +626,9 @@
case CURLOPT_INFILE:
case CURLOPT_WRITEHEADER:
case CURLOPT_PROGRESSDATA:
+#if (LIBCURL_VERSION_NUM<0x070b01)
case CURLOPT_PASSWDDATA:
+#endif
perl_curl_easy_register_callback(self,&(self->callback_ctx[callback_index(option)]),value);
break;
@@ -626,7 +637,9 @@
case CURLOPT_READFUNCTION:
case CURLOPT_HEADERFUNCTION:
case CURLOPT_PROGRESSFUNCTION:
+#if (LIBCURL_VERSION_NUM<0x070b01)
case CURLOPT_PASSWDFUNCTION:
+#endif
perl_curl_easy_register_callback(self,&(self->callback[callback_index(option)]),value);
break;