From f0f678104ae8f33d978067ebcd7ab939b985a992 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 20 Dec 2010 14:03:33 +0000 Subject: [PATCH] 2010-12-20 15:02 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * package/winuni/RELNOTES * contrib/hbcurl/hbcurl.c * contrib/hbcurl/hbcurl.ch + Added support for new features of libcurl 7.21.3 --- harbour/ChangeLog | 6 ++++++ harbour/contrib/hbcurl/hbcurl.c | 23 +++++++++++++++++++++++ harbour/contrib/hbcurl/hbcurl.ch | 16 +++++++++------- harbour/package/winuni/RELNOTES | 2 +- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 65b59cba20..33a31a941d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2010-12-20 15:02 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * package/winuni/RELNOTES + * contrib/hbcurl/hbcurl.c + * contrib/hbcurl/hbcurl.ch + + Added support for new features of libcurl 7.21.3 + 2010-12-17 14:33 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * package/winuni/RELNOTES * mysql update. diff --git a/harbour/contrib/hbcurl/hbcurl.c b/harbour/contrib/hbcurl/hbcurl.c index 65b2303e42..fab74084b9 100644 --- a/harbour/contrib/hbcurl/hbcurl.c +++ b/harbour/contrib/hbcurl/hbcurl.c @@ -100,6 +100,7 @@ typedef struct _HB_CURL struct curl_slist * pPREQUOTE; struct curl_slist * pTELNETOPTIONS; struct curl_slist * pMAIL_RCPT; + struct curl_slist * pRESOLVE; char * ul_name; HB_FHANDLE ul_handle; @@ -510,6 +511,7 @@ static void PHB_CURL_free( PHB_CURL hb_curl, HB_BOOL bFree ) hb_curl_slist_free( &hb_curl->pPREQUOTE ); hb_curl_slist_free( &hb_curl->pTELNETOPTIONS ); hb_curl_slist_free( &hb_curl->pMAIL_RCPT ); + hb_curl_slist_free( &hb_curl->pRESOLVE ); hb_curl_file_ul_free( hb_curl ); hb_curl_file_dl_free( hb_curl ); @@ -1411,6 +1413,27 @@ HB_FUNC( CURL_EASY_SETOPT ) res = curl_easy_setopt( hb_curl->curl, CURLOPT_CONNECT_ONLY, HB_CURL_OPT_BOOL( 3 ) ); break; #endif +#if LIBCURL_VERSION_NUM >= 0x071503 + case HB_CURLOPT_RESOLVE: + { + PHB_ITEM pArray = hb_param( 3, HB_IT_ARRAY ); + + curl_easy_setopt( hb_curl->curl, CURLOPT_RESOLVE, NULL ); + hb_curl_slist_free( &hb_curl->pRESOLVE ); + + if( pArray ) + { + HB_SIZE ulPos; + HB_SIZE ulArrayLen = hb_arrayLen( pArray ); + + for( ulPos = 0; ulPos < ulArrayLen; ulPos++ ) + hb_curl->pRESOLVE = curl_slist_append( hb_curl->pRESOLVE, hb_arrayGetCPtr( pArray, ulPos + 1 ) ); + + res = curl_easy_setopt( hb_curl->curl, CURLOPT_RESOLVE, hb_curl->pRESOLVE ); + } + } + break; +#endif /* SSL and Security */ diff --git a/harbour/contrib/hbcurl/hbcurl.ch b/harbour/contrib/hbcurl/hbcurl.ch index 26de114a51..b82cf488ee 100644 --- a/harbour/contrib/hbcurl/hbcurl.ch +++ b/harbour/contrib/hbcurl/hbcurl.ch @@ -248,6 +248,7 @@ #define HB_CURLOPT_RTSP_CLIENT_CSEQ 193 #define HB_CURLOPT_RTSP_SERVER_CSEQ 194 #define HB_CURLOPT_WILDCARDMATCH 197 +#define HB_CURLOPT_RESOLVE 198 #define HB_CURLOPT_DOWNLOAD 1001 /* Harbour special ones */ #define HB_CURLOPT_PROGRESSBLOCK 1002 #define HB_CURLOPT_UL_FILE_SETUP 1003 @@ -281,13 +282,14 @@ #define HB_CURL_NETRC_REQUIRED 2 /* A user:password in the URL will be ignored. */ /* HB_CURLOPT_HTTPAUTH option */ -#define HB_CURLAUTH_NONE 0 /* nothing */ -#define HB_CURLAUTH_BASIC 1 /* Basic (default) */ -#define HB_CURLAUTH_DIGEST 2 /* Digest */ -#define HB_CURLAUTH_GSSNEGOTIATE 4 /* GSS-Negotiate */ -#define HB_CURLAUTH_NTLM 8 /* NTLM */ -#define HB_CURLAUTH_DIGEST_IE hb_bitShift( 1, 4 ) /* Digest with IE flavour */ -#define HB_CURLAUTH_ANY hb_bitNot( 0 ) /* all types set */ +#define HB_CURLAUTH_NONE 0 /* nothing */ +#define HB_CURLAUTH_BASIC 1 /* Basic (default) */ +#define HB_CURLAUTH_DIGEST 2 /* Digest */ +#define HB_CURLAUTH_GSSNEGOTIATE 4 /* GSS-Negotiate */ +#define HB_CURLAUTH_NTLM 8 /* NTLM */ +#define HB_CURLAUTH_DIGEST_IE hb_bitShift( 1, 4 ) /* Digest with IE flavour */ +#define HB_CURLAUTH_ONLY hb_bitShift( 1, 31 ) /* used together with a single other type to force no auth or just that single type */ +#define HB_CURLAUTH_ANY hb_bitNot( 0 ) /* all types set */ #define HB_CURLAUTH_ANYSAFE hb_bitNot( HB_CURLAUTH_BASIC ) /* HB_CURLOPT_HTTP_VERSION option */ diff --git a/harbour/package/winuni/RELNOTES b/harbour/package/winuni/RELNOTES index 41531f1c98..d81ee2c198 100644 --- a/harbour/package/winuni/RELNOTES +++ b/harbour/package/winuni/RELNOTES @@ -58,7 +58,7 @@ Tool/lib versions used to create this package: Allegro 4.2.2 Blat 2.6.2 Cairo 1.8.8 - libcurl 7.21.0 + libcurl 7.21.3 Firebird 2.5.0rc2 FreeImage 3.13.1 GD 2.0.35