From 13b74f6edcddc47bd584f608606f97d53f678dfe Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 9 Nov 2008 15:52:14 +0000 Subject: [PATCH] 2008-11-09 16:49 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/hbcurl/hbcurl.c * contrib/hbcurl/hbcurl.ch + Added libcurl 7.19.1 features. % Removed hashing calls from some parts which are only compiled for libcurl versions which don't need hashing anyway. * ChangeLog * Changed CVS ID tag name in some very old entries to avoid them being replaced by versioning system. --- harbour/ChangeLog | 24 ++++++++++++++----- harbour/contrib/hbcurl/hbcurl.c | 40 ++++++++++++++++++++++++++++---- harbour/contrib/hbcurl/hbcurl.ch | 7 ++++++ 3 files changed, 61 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 135fe5bb71..1cd7f7b841 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,18 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-09 16:49 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * contrib/hbcurl/hbcurl.c + * contrib/hbcurl/hbcurl.ch + + Added libcurl 7.19.1 features. + % Removed hashing calls from some parts which are + only compiled for libcurl versions which don't need + hashing anyway. + + * ChangeLog + * Changed CVS ID tag name in some very old entries to + avoid them being replaced by versioning system. + 2008-11-09 16:00 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * make_b32.mak * make_vc.mak @@ -96736,7 +96748,7 @@ Mon Jun 07 12:58:17 1999 Gonzalo A. Diethelm * include/ctoharb.h - Added word wDec parameter to PushDouble prototype (needed by C++ compilers) * include/gtapi.h - - Added $Id$ block at top + - Added CVS ID - Added gtWhereX() - Added gtWhereY() * source/rtl/console.c @@ -96748,7 +96760,7 @@ Mon Jun 07 12:58:17 1999 Gonzalo A. Diethelm - Borland support now takes into account that older compiler versions don't have the POSIX S_ flags. * source/rtl/gtapi.c - - Added $Id$ block at top + - Added CVS ID - Changed #include to #include - Modified _gtWriteCon() to process control characters * source/rtl/set.c @@ -96757,27 +96769,27 @@ Mon Jun 07 12:58:17 1999 Gonzalo A. Diethelm * source/rtl/transfrm.c - Added use of wDec parameter in calls to PushDouble() * source/rtl/gt/gtdos.c - - Added $Id$ block at top + - Added CVS ID - Added gtWhereX() - Added gtWhereY() - Removed screen coordinate adjustments (i.e., - 1), because Clipper (and therefore Harbour) screen origin is (0,0) * source/rtl/gt/gtos2.c - - Added $Id$ block at top + - Added CVS ID - Added gtWhereX() - Added gtWhereY() - Removed screen coordinate adjustments (i.e., - 1), because Clipper (and therefore Harbour) screen origin is (0,0) - Note: Still needs some work - doesn't match output from gtdos.c * source/rtl/gt/gtwin.c - - Added $Id$ block at top + - Added CVS ID - Added gtWhereX() - Added gtWhereY() - Removed screen coordinate adjustments (i.e., - 1), because Clipper (and therefore Harbour) screen origin is (0,0) - Note: Needs to be tested, because I don't have a Windows compiler * source/rtl/gt/gtxxx.c - - Added $Id$ block at top + - Added CVS ID - Added gtWhereX() - Added gtWhereY() * source/vm/hvm.c diff --git a/harbour/contrib/hbcurl/hbcurl.c b/harbour/contrib/hbcurl/hbcurl.c index ab45da644f..4c99968e82 100644 --- a/harbour/contrib/hbcurl/hbcurl.c +++ b/harbour/contrib/hbcurl/hbcurl.c @@ -809,9 +809,25 @@ HB_FUNC( CURL_EASY_SETOPT ) case HB_CURLOPT_USERPWD: res = curl_easy_setopt( hb_curl->curl, CURLOPT_USERPWD, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); break; +#if LIBCURL_VERSION_NUM >= 0x071301 + case HB_CURLOPT_USERNAME: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_USERNAME, hb_parc( 3 ) ); + break; + case HB_CURLOPT_PASSWORD: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_PASSWORD, hb_parc( 3 ) ); + break; +#endif case HB_CURLOPT_PROXYUSERPWD: res = curl_easy_setopt( hb_curl->curl, CURLOPT_PROXYUSERPWD, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); break; +#if LIBCURL_VERSION_NUM >= 0x071301 + case HB_CURLOPT_PROXYUSERNAME: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_PROXYUSERNAME, hb_parc( 3 ) ); + break; + case HB_CURLOPT_PROXYPASSWORD: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_PROXYPASSWORD, hb_parc( 3 ) ); + break; +#endif case HB_CURLOPT_HTTPAUTH: res = curl_easy_setopt( hb_curl->curl, CURLOPT_HTTPAUTH, hb_parnl( 3 ) ); break; @@ -838,7 +854,12 @@ HB_FUNC( CURL_EASY_SETOPT ) break; #if LIBCURL_VERSION_NUM >= 0x071101 case HB_CURLOPT_POST301: + case HB_CURLOPT_POSTREDIR: +#if LIBCURL_VERSION_NUM >= 0x071301 + res = curl_easy_setopt( hb_curl->curl, CURLOPT_POSTREDIR, HB_CURL_OPT_BOOL( 3 ) ); +#else res = curl_easy_setopt( hb_curl->curl, CURLOPT_POST301, HB_CURL_OPT_BOOL( 3 ) ); +#endif break; #endif case HB_CURLOPT_PUT: @@ -850,7 +871,7 @@ HB_FUNC( CURL_EASY_SETOPT ) #if LIBCURL_VERSION_NUM >= 0x071101 case HB_CURLOPT_POSTFIELDS: case HB_CURLOPT_COPYPOSTFIELDS: - res = curl_easy_setopt( hb_curl->curl, CURLOPT_COPYPOSTFIELDS, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + res = curl_easy_setopt( hb_curl->curl, CURLOPT_COPYPOSTFIELDS, hb_parc( 3 ) ); break; #endif case HB_CURLOPT_POSTFIELDSIZE: @@ -1253,10 +1274,15 @@ HB_FUNC( CURL_EASY_SETOPT ) break; #if LIBCURL_VERSION_NUM > 0x071300 case HB_CURLOPT_CRLFILE: - res = curl_easy_setopt( hb_curl->curl, CURLOPT_CRLFILE, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + res = curl_easy_setopt( hb_curl->curl, CURLOPT_CRLFILE, hb_parc( 3 ) ); break; case HB_CURLOPT_ISSUERCERT: - res = curl_easy_setopt( hb_curl->curl, CURLOPT_ISSUERCERT, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + res = curl_easy_setopt( hb_curl->curl, CURLOPT_ISSUERCERT, hb_parc( 3 ) ); + break; +#endif +#if LIBCURL_VERSION_NUM > 0x071301 + case HB_CURLOPT_CERTINFO: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_CERTINFO, HB_CURL_OPT_BOOL( 3 ) ); break; #endif @@ -1269,7 +1295,7 @@ HB_FUNC( CURL_EASY_SETOPT ) #endif #if LIBCURL_VERSION_NUM >= 0x071101 case HB_CURLOPT_SSH_HOST_PUBLIC_KEY_MD5: - res = curl_easy_setopt( hb_curl->curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + res = curl_easy_setopt( hb_curl->curl, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, hb_parc( 3 ) ); break; #endif #if LIBCURL_VERSION_NUM >= 0x071001 @@ -1646,6 +1672,12 @@ HB_FUNC( CURL_EASY_GETINFO ) #endif type = HB_CURL_INFO_TYPE_DOUBLE; break; + case HB_CURLINFO_CERTINFO: +#if LIBCURL_VERSION_NUM >= 0x071301 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_CERTINFO, &ret_ptr ); +#endif + type = HB_CURL_INFO_TYPE_PTR; + break; } switch( type ) diff --git a/harbour/contrib/hbcurl/hbcurl.ch b/harbour/contrib/hbcurl/hbcurl.ch index b6f6ae00a1..31a1db926b 100644 --- a/harbour/contrib/hbcurl/hbcurl.ch +++ b/harbour/contrib/hbcurl/hbcurl.ch @@ -224,6 +224,12 @@ #define HB_CURLOPT_CRLFILE 169 #define HB_CURLOPT_ISSUERCERT 170 #define HB_CURLOPT_ADDRESS_SCOPE 171 +#define HB_CURLOPT_CERTINFO 172 +#define HB_CURLOPT_POSTREDIR 173 +#define HB_CURLOPT_USERNAME 174 +#define HB_CURLOPT_PASSWORD 175 +#define HB_CURLOPT_PROXYUSERNAME 176 +#define HB_CURLOPT_PROXYPASSWORD 177 #define HB_CURLOPT_DOWNLOAD 1001 /* Harbour special ones */ #define HB_CURLOPT_PROGRESSBLOCK 1002 #define HB_CURLOPT_UL_FILE_SETUP 1003 @@ -366,6 +372,7 @@ #define HB_CURLINFO_FTP_ENTRY_PATH 31 #define HB_CURLINFO_PRIMARY_IP 32 #define HB_CURLINFO_APPCONNECT_TIME 33 +#define HB_CURLINFO_CERTINFO 34 /* curl result codes. */