From ae1912cb0d494b48d514d937826c9fe83ec96c4d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 29 Dec 1999 14:20:26 +0000 Subject: Initial revision --- lib/version.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 lib/version.c (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c new file mode 100644 index 000000000..73be0d7f9 --- /dev/null +++ b/lib/version.c @@ -0,0 +1,86 @@ +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Curl. + * + * The Initial Developer of the Original Code is Daniel Stenberg. + * + * Portions created by the Initial Developer are Copyright (C) 1998. + * All Rights Reserved. + * + * ------------------------------------------------------------ + * Main author: + * - Daniel Stenberg + * + * http://curl.haxx.nu + * + * $Source$ + * $Revision$ + * $Date$ + * $Author$ + * $State$ + * $Locker$ + * + * ------------------------------------------------------------ + ****************************************************************************/ + +#include +#include + +#include "setup.h" +#include +#include "urldata.h" + +char *curl_version(void) +{ + static char version[200]; + char *ptr; +#if defined(USE_SSLEAY) + static char sub[2]; +#endif + strcpy(version, LIBCURL_NAME " " LIBCURL_VERSION ); + ptr=strchr(version, '\0'); + +#ifdef USE_SSLEAY + +#if (SSLEAY_VERSION_NUMBER >= 0x900000) + sprintf(ptr, " (SSL %x.%x.%x)", + (SSLEAY_VERSION_NUMBER>>28)&0xff, + (SSLEAY_VERSION_NUMBER>>20)&0xff, + (SSLEAY_VERSION_NUMBER>>12)&0xf); +#else + if(SSLEAY_VERSION_NUMBER&0x0f) { + sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; + } + else + sub[0]=0; + + sprintf(ptr, " (SSL %x.%x.%x%s)", + (SSLEAY_VERSION_NUMBER>>12)&0xff, + (SSLEAY_VERSION_NUMBER>>8)&0xf, + (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); + +#endif + ptr=strchr(ptr, '\0'); +#endif + +#ifdef USE_ZLIB + sprintf(ptr, " (zlib %s)", zlibVersion()); +#endif + + return version; +} -- cgit v1.2.1 From 96dde76b99897352aa3d0877a0b621a9e605733e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 22 May 2000 14:12:12 +0000 Subject: moved here from the newlib branch --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 73be0d7f9..ea54b2a49 100644 --- a/lib/version.c +++ b/lib/version.c @@ -58,7 +58,7 @@ char *curl_version(void) #ifdef USE_SSLEAY #if (SSLEAY_VERSION_NUMBER >= 0x900000) - sprintf(ptr, " (SSL %x.%x.%x)", + sprintf(ptr, " (SSL %lx.%lx.%lx)", (SSLEAY_VERSION_NUMBER>>28)&0xff, (SSLEAY_VERSION_NUMBER>>20)&0xff, (SSLEAY_VERSION_NUMBER>>12)&0xf); -- cgit v1.2.1 From 1ef3600a0731fef8f59563a1e49981f1b64b9746 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 20 Jun 2000 15:31:26 +0000 Subject: haxx.nu => haxx.se --- lib/version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index ea54b2a49..be14e6551 100644 --- a/lib/version.c +++ b/lib/version.c @@ -24,9 +24,9 @@ * * ------------------------------------------------------------ * Main author: - * - Daniel Stenberg + * - Daniel Stenberg * - * http://curl.haxx.nu + * http://curl.haxx.se * * $Source$ * $Revision$ -- cgit v1.2.1 From b6e18f2f665f16910c04cb52bdc7b90270ab7c9b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 24 Aug 2000 14:26:33 +0000 Subject: #include "setup.h" moved first of all includes --- lib/version.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index be14e6551..475edd129 100644 --- a/lib/version.c +++ b/lib/version.c @@ -38,10 +38,11 @@ * ------------------------------------------------------------ ****************************************************************************/ +#include "setup.h" + #include #include -#include "setup.h" #include #include "urldata.h" -- cgit v1.2.1 From c62cc76fdbe01dd5b2cd322015f8e034f9149341 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 21 Sep 2000 08:51:15 +0000 Subject: now reports "krb4 enabled" is that's so --- lib/version.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 475edd129..7cd530913 100644 --- a/lib/version.c +++ b/lib/version.c @@ -79,8 +79,14 @@ char *curl_version(void) ptr=strchr(ptr, '\0'); #endif +#ifdef KRB4 + sprintf(ptr, " (krb4 enabled)"); + ptr += strlen(ptr); +#endif + #ifdef USE_ZLIB sprintf(ptr, " (zlib %s)", zlibVersion()); + ptr += strlen(ptr); #endif return version; -- cgit v1.2.1 From 24dee483e9e925c2ab79dd582f70c9a55ab9ba4d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 3 Jan 2001 09:29:33 +0000 Subject: dual-license fix --- lib/version.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 7cd530913..6659f502e 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,38 +5,21 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * The contents of this file are subject to the Mozilla Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * Copyright (C) 2000, Daniel Stenberg, , et al. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. + * In order to be useful for every potential user, curl and libcurl are + * dual-licensed under the MPL and the MIT/X-derivate licenses. * - * The Original Code is Curl. + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the MPL or the MIT/X-derivate + * licenses. You may pick one of these licenses. * - * The Initial Developer of the Original Code is Daniel Stenberg. + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. * - * Portions created by the Initial Developer are Copyright (C) 1998. - * All Rights Reserved. - * - * ------------------------------------------------------------ - * Main author: - * - Daniel Stenberg - * - * http://curl.haxx.se - * - * $Source$ - * $Revision$ - * $Date$ - * $Author$ - * $State$ - * $Locker$ - * - * ------------------------------------------------------------ - ****************************************************************************/ + * $Id$ + *****************************************************************************/ #include "setup.h" -- cgit v1.2.1 From 4031104404c6ceed5e57134125dcdb6cac51c564 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Jan 2001 10:11:41 +0000 Subject: Internal symbols that aren't static are now prefixed with 'Curl_' --- lib/version.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 6659f502e..9b2bbcded 100644 --- a/lib/version.c +++ b/lib/version.c @@ -33,9 +33,6 @@ char *curl_version(void) { static char version[200]; char *ptr; -#if defined(USE_SSLEAY) - static char sub[2]; -#endif strcpy(version, LIBCURL_NAME " " LIBCURL_VERSION ); ptr=strchr(version, '\0'); @@ -47,17 +44,19 @@ char *curl_version(void) (SSLEAY_VERSION_NUMBER>>20)&0xff, (SSLEAY_VERSION_NUMBER>>12)&0xf); #else - if(SSLEAY_VERSION_NUMBER&0x0f) { - sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; - } - else - sub[0]=0; - - sprintf(ptr, " (SSL %x.%x.%x%s)", - (SSLEAY_VERSION_NUMBER>>12)&0xff, - (SSLEAY_VERSION_NUMBER>>8)&0xf, - (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); + { + char sub[2]; + if(SSLEAY_VERSION_NUMBER&0x0f) { + sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; + } + else + sub[0]=0; + sprintf(ptr, " (SSL %x.%x.%x%s)", + (SSLEAY_VERSION_NUMBER>>12)&0xff, + (SSLEAY_VERSION_NUMBER>>8)&0xf, + (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); + } #endif ptr=strchr(ptr, '\0'); #endif -- cgit v1.2.1 From 6f438bc8fb6d53e099a26f1d55ef6577c347fef0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 23 Jan 2001 08:16:59 +0000 Subject: Added 'ipv6 enabled' for ipv6 compiled versions --- lib/version.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 9b2bbcded..cfb4aa333 100644 --- a/lib/version.c +++ b/lib/version.c @@ -61,8 +61,18 @@ char *curl_version(void) ptr=strchr(ptr, '\0'); #endif +#if defined(KRB4) || defined(ENABLE_IPV6) + strcat(ptr, " ("); + ptr+=2; #ifdef KRB4 - sprintf(ptr, " (krb4 enabled)"); + sprintf(ptr, "krb4 "); + ptr += strlen(ptr); +#endif +#ifdef ENABLE_IPV6 + sprintf(ptr, "ipv6 "); + ptr += strlen(ptr); +#endif + sprintf(ptr, "enabled)"); ptr += strlen(ptr); #endif -- cgit v1.2.1 From 88bb054e1db2884cfdc50eff6218bac0cf61f0ca Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 6 Apr 2001 08:48:42 +0000 Subject: show openssl 0.9.6a properly --- lib/version.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index cfb4aa333..85a15812a 100644 --- a/lib/version.c +++ b/lib/version.c @@ -38,6 +38,23 @@ char *curl_version(void) #ifdef USE_SSLEAY +#if (SSLEAY_VERSION_NUMBER >= 0x906000) + { + char sub[2]; + if(SSLEAY_VERSION_NUMBER&0xff0) { + sub[0]=((SSLEAY_VERSION_NUMBER>>4)&0xff) + 'a' -1; + } + else + sub[0]=0; + + sprintf(ptr, " (OpenSSL %lx.%lx.%lx%s)", + (SSLEAY_VERSION_NUMBER>>28)&0xf, + (SSLEAY_VERSION_NUMBER>>20)&0xff, + (SSLEAY_VERSION_NUMBER>>12)&0xff, + sub); + } + +#else #if (SSLEAY_VERSION_NUMBER >= 0x900000) sprintf(ptr, " (SSL %lx.%lx.%lx)", (SSLEAY_VERSION_NUMBER>>28)&0xff, @@ -57,6 +74,7 @@ char *curl_version(void) (SSLEAY_VERSION_NUMBER>>8)&0xf, (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); } +#endif #endif ptr=strchr(ptr, '\0'); #endif -- cgit v1.2.1 From 37d7a198d5ec3e4f183a5a81eaf2ee80d0cdf304 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 23 Apr 2001 07:54:12 +0000 Subject: Added zero termination, as the OpenSSL version string was written without it! --- lib/version.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 85a15812a..ab11122c8 100644 --- a/lib/version.c +++ b/lib/version.c @@ -41,6 +41,7 @@ char *curl_version(void) #if (SSLEAY_VERSION_NUMBER >= 0x906000) { char sub[2]; + sub[1]=0; if(SSLEAY_VERSION_NUMBER&0xff0) { sub[0]=((SSLEAY_VERSION_NUMBER>>4)&0xff) + 'a' -1; } @@ -63,6 +64,7 @@ char *curl_version(void) #else { char sub[2]; + sub[1]=0; if(SSLEAY_VERSION_NUMBER&0x0f) { sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; } -- cgit v1.2.1 From 0b7e0638a9a6b66104e8ec563b0ea7c81cea4739 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 24 Apr 2001 06:12:07 +0000 Subject: on albert chin's comment I remade the fix to set '\0' instead of 0 since they're chars --- lib/version.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index ab11122c8..32a37b067 100644 --- a/lib/version.c +++ b/lib/version.c @@ -41,12 +41,12 @@ char *curl_version(void) #if (SSLEAY_VERSION_NUMBER >= 0x906000) { char sub[2]; - sub[1]=0; + sub[1]='\0'; if(SSLEAY_VERSION_NUMBER&0xff0) { sub[0]=((SSLEAY_VERSION_NUMBER>>4)&0xff) + 'a' -1; } else - sub[0]=0; + sub[0]='\0'; sprintf(ptr, " (OpenSSL %lx.%lx.%lx%s)", (SSLEAY_VERSION_NUMBER>>28)&0xf, @@ -64,12 +64,12 @@ char *curl_version(void) #else { char sub[2]; - sub[1]=0; + sub[1]='\0'; if(SSLEAY_VERSION_NUMBER&0x0f) { sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; } else - sub[0]=0; + sub[0]='\0'; sprintf(ptr, " (SSL %x.%x.%x%s)", (SSLEAY_VERSION_NUMBER>>12)&0xff, -- cgit v1.2.1 From 6147879837a53d22c9be04e7a4fc315a297ba2b3 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Fri, 7 Sep 2001 04:01:32 +0000 Subject: Added formatting sections for emacs and vim --- lib/version.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 32a37b067..ae3a865e1 100644 --- a/lib/version.c +++ b/lib/version.c @@ -103,3 +103,11 @@ char *curl_version(void) return version; } + +/* + * local variables: + * eval: (load-file "../curl-mode.el") + * end: + * vim600: et sw=2 ts=2 sts=2 tw=78 fdm=marker + * vim<600: et sw=2 ts=2 sts=2 tw=78 + */ -- cgit v1.2.1 From 8e91d5de8e4e17ce3d4936cc91171d09726e7bb3 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Thu, 11 Oct 2001 09:32:19 +0000 Subject: looks nicer and is better compatible with older vim versions --- lib/version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index ae3a865e1..ac30bf105 100644 --- a/lib/version.c +++ b/lib/version.c @@ -108,6 +108,6 @@ char *curl_version(void) * local variables: * eval: (load-file "../curl-mode.el") * end: - * vim600: et sw=2 ts=2 sts=2 tw=78 fdm=marker - * vim<600: et sw=2 ts=2 sts=2 tw=78 + * vim600: fdm=marker + * vim: et sw=2 ts=2 sts=2 tw=78 */ -- cgit v1.2.1 From b3b4786990e94216bc5319621ad7b36602a6f704 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 16 Jan 2002 17:45:08 +0000 Subject: Kevin Roth's SSLeay() patch, slight edited by me. Works with OpenSSL 0.9.5 now. --- lib/version.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index ac30bf105..ecaec67c8 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2000, Daniel Stenberg, , et al. + * Copyright (C) 2002, Daniel Stenberg, , et al. * * In order to be useful for every potential user, curl and libcurl are * dual-licensed under the MPL and the MIT/X-derivate licenses. @@ -38,20 +38,28 @@ char *curl_version(void) #ifdef USE_SSLEAY -#if (SSLEAY_VERSION_NUMBER >= 0x906000) +#if (SSLEAY_VERSION_NUMBER >= 0x905000) { char sub[2]; + unsigned long ssleay_value; sub[1]='\0'; - if(SSLEAY_VERSION_NUMBER&0xff0) { - sub[0]=((SSLEAY_VERSION_NUMBER>>4)&0xff) + 'a' -1; - } - else + ssleay_value=SSLeay(); + if(ssleay_value < 0x906000) { + ssleay_value=SSLEAY_VERSION_NUMBER; sub[0]='\0'; + } + else { + if(ssleay_value&0xff0) { + sub[0]=((ssleay_value>>4)&0xff) + 'a' -1; + } + else + sub[0]='\0'; + } sprintf(ptr, " (OpenSSL %lx.%lx.%lx%s)", - (SSLEAY_VERSION_NUMBER>>28)&0xf, - (SSLEAY_VERSION_NUMBER>>20)&0xff, - (SSLEAY_VERSION_NUMBER>>12)&0xff, + (ssleay_value>>28)&0xf, + (ssleay_value>>20)&0xff, + (ssleay_value>>12)&0xff, sub); } -- cgit v1.2.1 From 974f314f5785156af6983675aeb28313cc8ba2ea Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 19 Mar 2002 07:54:55 +0000 Subject: copyright string (year) update --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index ecaec67c8..11420065c 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2002, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * * In order to be useful for every potential user, curl and libcurl are * dual-licensed under the MPL and the MIT/X-derivate licenses. -- cgit v1.2.1 From 5dd40bd0bb7aa58672be15b9d2bc75e6d4ef2ccb Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 2 Sep 2002 21:59:31 +0000 Subject: adjusted to more HTTP-strict version strings and to offer LIBZ info --- lib/version.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 11420065c..64da79c0d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -33,7 +33,7 @@ char *curl_version(void) { static char version[200]; char *ptr; - strcpy(version, LIBCURL_NAME " " LIBCURL_VERSION ); + strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION ); ptr=strchr(version, '\0'); #ifdef USE_SSLEAY @@ -56,7 +56,7 @@ char *curl_version(void) sub[0]='\0'; } - sprintf(ptr, " (OpenSSL %lx.%lx.%lx%s)", + sprintf(ptr, " OpenSSL/%lx.%lx.%lx%s", (ssleay_value>>28)&0xf, (ssleay_value>>20)&0xff, (ssleay_value>>12)&0xff, @@ -65,7 +65,7 @@ char *curl_version(void) #else #if (SSLEAY_VERSION_NUMBER >= 0x900000) - sprintf(ptr, " (SSL %lx.%lx.%lx)", + sprintf(ptr, " OpenSSL/%lx.%lx.%lx", (SSLEAY_VERSION_NUMBER>>28)&0xff, (SSLEAY_VERSION_NUMBER>>20)&0xff, (SSLEAY_VERSION_NUMBER>>12)&0xf); @@ -79,7 +79,7 @@ char *curl_version(void) else sub[0]='\0'; - sprintf(ptr, " (SSL %x.%x.%x%s)", + sprintf(ptr, " SSL/%x.%x.%x%s", (SSLEAY_VERSION_NUMBER>>12)&0xff, (SSLEAY_VERSION_NUMBER>>8)&0xf, (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); @@ -89,23 +89,16 @@ char *curl_version(void) ptr=strchr(ptr, '\0'); #endif -#if defined(KRB4) || defined(ENABLE_IPV6) - strcat(ptr, " ("); - ptr+=2; #ifdef KRB4 - sprintf(ptr, "krb4 "); + sprintf(ptr, " krb4"); ptr += strlen(ptr); #endif #ifdef ENABLE_IPV6 - sprintf(ptr, "ipv6 "); + sprintf(ptr, " ipv6"); ptr += strlen(ptr); #endif - sprintf(ptr, "enabled)"); - ptr += strlen(ptr); -#endif - -#ifdef USE_ZLIB - sprintf(ptr, " (zlib %s)", zlibVersion()); +#ifdef HAVE_LIBZ + sprintf(ptr, " zlib/%s", zlibVersion()); ptr += strlen(ptr); #endif -- cgit v1.2.1 From ba4e69bebc8f7f32f3bc7faa1e13e7580754075b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Sep 2002 11:52:59 +0000 Subject: updated source code boilerplate/header --- lib/version.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 64da79c0d..78e956c93 100644 --- a/lib/version.c +++ b/lib/version.c @@ -1,4 +1,4 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | @@ -7,19 +7,19 @@ * * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. - * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id$ - *****************************************************************************/ + ***************************************************************************/ #include "setup.h" -- cgit v1.2.1 From c0460660d5a0c8f2be98adf79d2f27b5fa8f707a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 25 Sep 2002 07:08:41 +0000 Subject: Wez Furlong's curl_version_info() function added, still needs some adjustments and possibly some improvments to feature all those things we could possibly want from this. --- lib/version.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 78e956c93..9c347685b 100644 --- a/lib/version.c +++ b/lib/version.c @@ -105,6 +105,53 @@ char *curl_version(void) return version; } +/* data for curl_version_info */ + +static const curl_runtime_protocol_info protocols[] = { +#ifndef CURL_DISABLE_FTP + { "ftp" }, +#endif +#ifndef CURL_DISABLE_GOPHER + { "gopher" }, +#endif +#ifndef CURL_DISABLE_TELNET + { "telnet" }, +#endif +#ifndef CURL_DISABLE_DICT + { "dict" }, +#endif +#ifndef CURL_DISABLE_LDAP + { "ldap" }, +#endif +#ifndef CURL_DISABLE_HTTP + { "http" }, +#endif +#ifndef CURL_DISABLE_FILE + { "file" }, +#endif + +#ifdef USE_SSLEAY +#ifndef CURL_DISABLE_HTTP + { "https" }, +#endif +#ifndef CURL_DISABLE_FTP + { "ftps" }, +#endif +#endif + { NULL } +}; + +static const curl_version_info_data version_info = { + LIBCURL_VERSION, + LIBCURL_VERSION_NUM, + &protocols +}; + +const curl_version_info_data *curl_version_info(void) +{ + return &version_info; +} + /* * local variables: * eval: (load-file "../curl-mode.el") -- cgit v1.2.1 From 1ee1f5f427bf39f07f11db812c0a62406a56bffa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 25 Sep 2002 15:38:48 +0000 Subject: extended curl_version_info() with more info on related sub-libraries --- lib/version.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 10 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 9c347685b..6456194fd 100644 --- a/lib/version.c +++ b/lib/version.c @@ -29,14 +29,9 @@ #include #include "urldata.h" -char *curl_version(void) -{ - static char version[200]; - char *ptr; - strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION ); - ptr=strchr(version, '\0'); - #ifdef USE_SSLEAY +static void getssl_version(char *ptr, long *num) +{ #if (SSLEAY_VERSION_NUMBER >= 0x905000) { @@ -44,6 +39,7 @@ char *curl_version(void) unsigned long ssleay_value; sub[1]='\0'; ssleay_value=SSLeay(); + *num = ssleay_value; if(ssleay_value < 0x906000) { ssleay_value=SSLEAY_VERSION_NUMBER; sub[0]='\0'; @@ -64,6 +60,7 @@ char *curl_version(void) } #else + *num = SSLEAY_VERSION_NUMBER; #if (SSLEAY_VERSION_NUMBER >= 0x900000) sprintf(ptr, " OpenSSL/%lx.%lx.%lx", (SSLEAY_VERSION_NUMBER>>28)&0xff, @@ -86,7 +83,23 @@ char *curl_version(void) } #endif #endif - ptr=strchr(ptr, '\0'); +} + +#endif + +char *curl_version(void) +{ + static char version[200]; + char *ptr; + long num; + strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION ); + ptr=strchr(version, '\0'); + +#ifdef USE_SSLEAY + getssl_version(ptr, &num); + ptr=strchr(version, '\0'); +#else + (void)num; /* no compiler warning please */ #endif #ifdef KRB4 @@ -141,14 +154,40 @@ static const curl_runtime_protocol_info protocols[] = { { NULL } }; -static const curl_version_info_data version_info = { +static curl_version_info_data version_info = { LIBCURL_VERSION, LIBCURL_VERSION_NUM, - &protocols + 0 /* features is 0 by default */ +#ifdef ENABLE_IPV6 + | CURL_VERSION_IPV6 +#endif +#ifdef KRB4 + | CURL_VERSION_KERBEROS4 +#endif + , + NULL, /* ssl_version */ + 0, /* ssl_version_num */ + NULL, /* zlib_version */ + protocols }; const curl_version_info_data *curl_version_info(void) { +#ifdef USE_SSLEAY + static char ssl_buffer[80]; + long num; + getssl_version(ssl_buffer, &num); + + version_info.ssl_version = ssl_buffer; + version_info.ssl_version_num = num; + /* SSL stuff is left zero if undefined */ +#endif + +#ifdef HAVE_LIBZ + version_info.libz_version = zlibVersion(); + /* libz left NULL if non-existing */ +#endif + return &version_info; } -- cgit v1.2.1 From 9247daf953bb48d19948199feb12b0031f825fa0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 26 Sep 2002 13:03:22 +0000 Subject: enhanced curl_version_info --- lib/version.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 6456194fd..33cea4619 100644 --- a/lib/version.c +++ b/lib/version.c @@ -120,7 +120,7 @@ char *curl_version(void) /* data for curl_version_info */ -static const curl_runtime_protocol_info protocols[] = { +static const char *protocols[] = { #ifndef CURL_DISABLE_FTP { "ftp" }, #endif @@ -157,12 +157,19 @@ static const curl_runtime_protocol_info protocols[] = { static curl_version_info_data version_info = { LIBCURL_VERSION, LIBCURL_VERSION_NUM, + OS, /* as found by configure or set by hand at build-time */ 0 /* features is 0 by default */ #ifdef ENABLE_IPV6 | CURL_VERSION_IPV6 #endif #ifdef KRB4 | CURL_VERSION_KERBEROS4 +#endif +#ifdef USE_SSLEAY + | CURL_VERSION_SSL +#endif +#ifdef HAVE_LIBZ + | CURL_VERSION_LIBZ #endif , NULL, /* ssl_version */ @@ -171,7 +178,7 @@ static curl_version_info_data version_info = { protocols }; -const curl_version_info_data *curl_version_info(void) +curl_version_info_data *curl_version_info(void) { #ifdef USE_SSLEAY static char ssl_buffer[80]; -- cgit v1.2.1 From dc9e415602c32bb575b58422f52965c5d741fda3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 30 Sep 2002 19:51:05 +0000 Subject: get an argument and add a 'age' field to the struct --- lib/version.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 33cea4619..41a71bfcc 100644 --- a/lib/version.c +++ b/lib/version.c @@ -122,39 +122,40 @@ char *curl_version(void) static const char *protocols[] = { #ifndef CURL_DISABLE_FTP - { "ftp" }, + "ftp", #endif #ifndef CURL_DISABLE_GOPHER - { "gopher" }, + "gopher", #endif #ifndef CURL_DISABLE_TELNET - { "telnet" }, + "telnet", #endif #ifndef CURL_DISABLE_DICT - { "dict" }, + "dict", #endif #ifndef CURL_DISABLE_LDAP - { "ldap" }, + "ldap", #endif #ifndef CURL_DISABLE_HTTP - { "http" }, + "http", #endif #ifndef CURL_DISABLE_FILE - { "file" }, + "file", #endif #ifdef USE_SSLEAY #ifndef CURL_DISABLE_HTTP - { "https" }, + "https", #endif #ifndef CURL_DISABLE_FTP - { "ftps" }, + "ftps", #endif #endif - { NULL } + NULL }; static curl_version_info_data version_info = { + CURLVERSION_FIRST, LIBCURL_VERSION, LIBCURL_VERSION_NUM, OS, /* as found by configure or set by hand at build-time */ @@ -178,7 +179,7 @@ static curl_version_info_data version_info = { protocols }; -curl_version_info_data *curl_version_info(void) +curl_version_info_data *curl_version_info(CURLversion stamp) { #ifdef USE_SSLEAY static char ssl_buffer[80]; @@ -194,6 +195,7 @@ curl_version_info_data *curl_version_info(void) version_info.libz_version = zlibVersion(); /* libz left NULL if non-existing */ #endif + (void)stamp; /* avoid compiler warnings, we don't use this */ return &version_info; } -- cgit v1.2.1 From f26a338a54e04d0a6907f5d2479d8b0fa9daf297 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Jan 2003 21:08:12 +0000 Subject: copyright year update in the source header --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 41a71bfcc..2175dbd72 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From a7c72b7abf1213c471f3fd11e6b8e3a37d526f60 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 29 Jan 2003 10:14:20 +0000 Subject: removed the local variables for emacs and vim, use the new sample.emacs way for emacs, and vim users should provide a similar non-polluting style --- lib/version.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 2175dbd72..4a9beb097 100644 --- a/lib/version.c +++ b/lib/version.c @@ -199,11 +199,3 @@ curl_version_info_data *curl_version_info(CURLversion stamp) return &version_info; } - -/* - * local variables: - * eval: (load-file "../curl-mode.el") - * end: - * vim600: fdm=marker - * vim: et sw=2 ts=2 sts=2 tw=78 - */ -- cgit v1.2.1 From 89f4af695e06621fe66dfdecb3b3757981c758fb Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 26 Jun 2003 11:22:48 +0000 Subject: include GSS in the debug string if available, support a few new flag booleans --- lib/version.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 4a9beb097..8191f9593 100644 --- a/lib/version.c +++ b/lib/version.c @@ -114,6 +114,10 @@ char *curl_version(void) sprintf(ptr, " zlib/%s", zlibVersion()); ptr += strlen(ptr); #endif +#ifdef GSSAPI + sprintf(ptr, " GSS"); + ptr += strlen(ptr); +#endif return version; } @@ -168,9 +172,16 @@ static curl_version_info_data version_info = { #endif #ifdef USE_SSLEAY | CURL_VERSION_SSL + | CURL_VERSION_NTLM /* since this requires OpenSSL */ #endif #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ +#endif +#ifdef GSSAPI + | CURL_VERSION_GSSNEGOTIATE +#endif +#ifdef CURLDEBUG + | CURL_VERSION_DEBUG #endif , NULL, /* ssl_version */ -- cgit v1.2.1 From 3eb4ae031c3c1f44271ad63b537ed181a773d5d5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 11 Aug 2003 23:13:09 +0000 Subject: Set the CURL_VERSION_ASYNCHDNS bit if USE_ARES is defined. --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 8191f9593..63ed63c41 100644 --- a/lib/version.c +++ b/lib/version.c @@ -182,6 +182,9 @@ static curl_version_info_data version_info = { #endif #ifdef CURLDEBUG | CURL_VERSION_DEBUG +#endif +#ifdef USE_ARES + | CURL_VERSION_ASYNCHDNS #endif , NULL, /* ssl_version */ -- cgit v1.2.1 From 46c2bc4bb67fefc63263468d6442f42570fdf237 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 29 Aug 2003 08:43:21 +0000 Subject: typecase to please the compiler gods --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 63ed63c41..651f895e1 100644 --- a/lib/version.c +++ b/lib/version.c @@ -46,7 +46,7 @@ static void getssl_version(char *ptr, long *num) } else { if(ssleay_value&0xff0) { - sub[0]=((ssleay_value>>4)&0xff) + 'a' -1; + sub[0]=(char)((ssleay_value>>4)&0xff) + 'a' -1; } else sub[0]='\0'; -- cgit v1.2.1 From 09ccfcdcd422fc0b0421562bbdcf53f78a3f3e4b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 19 Sep 2003 12:56:22 +0000 Subject: Markus Moeller's SPNEGO patch applied, with my edits, additions and minor cleanups. --- lib/version.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 651f895e1..3e8c88513 100644 --- a/lib/version.c +++ b/lib/version.c @@ -114,7 +114,7 @@ char *curl_version(void) sprintf(ptr, " zlib/%s", zlibVersion()); ptr += strlen(ptr); #endif -#ifdef GSSAPI +#ifdef HAVE_GSSAPI sprintf(ptr, " GSS"); ptr += strlen(ptr); #endif @@ -177,7 +177,7 @@ static curl_version_info_data version_info = { #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ #endif -#ifdef GSSAPI +#ifdef HAVE_GSSAPI | CURL_VERSION_GSSNEGOTIATE #endif #ifdef CURLDEBUG @@ -185,6 +185,9 @@ static curl_version_info_data version_info = { #endif #ifdef USE_ARES | CURL_VERSION_ASYNCHDNS +#endif +#ifdef HAVE_SPNEGO + | CURL_VERSION_SPNEGO #endif , NULL, /* ssl_version */ -- cgit v1.2.1 From 800052dc50ace9748f607afc8f451afac948736b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Dec 2003 13:27:29 +0000 Subject: use the HAVE_KRB4 define instead of just KRB4 --- lib/version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 3e8c88513..2e4d532ff 100644 --- a/lib/version.c +++ b/lib/version.c @@ -102,7 +102,7 @@ char *curl_version(void) (void)num; /* no compiler warning please */ #endif -#ifdef KRB4 +#ifdef HAVE_KRB4 sprintf(ptr, " krb4"); ptr += strlen(ptr); #endif @@ -167,7 +167,7 @@ static curl_version_info_data version_info = { #ifdef ENABLE_IPV6 | CURL_VERSION_IPV6 #endif -#ifdef KRB4 +#ifdef HAVE_KRB4 | CURL_VERSION_KERBEROS4 #endif #ifdef USE_SSLEAY -- cgit v1.2.1 From 053f6c85efd0bf698f73343989474d672d0563a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jan 2004 09:19:33 +0000 Subject: updated year in the copyright string --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 2e4d532ff..3004fc17c 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From c2967c3c39d5c5797bdd7fffa41b220cecce3786 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 2 Feb 2004 16:24:41 +0000 Subject: now provides c-ares version info in both version calls --- lib/version.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 3004fc17c..80abba4ea 100644 --- a/lib/version.c +++ b/lib/version.c @@ -29,6 +29,10 @@ #include #include "urldata.h" +#ifdef USE_ARES +#include +#endif + #ifdef USE_SSLEAY static void getssl_version(char *ptr, long *num) { @@ -118,6 +122,11 @@ char *curl_version(void) sprintf(ptr, " GSS"); ptr += strlen(ptr); #endif +#ifdef USE_ARES + /* this function is only present in c-ares, not in the original ares */ + sprintf(ptr, " c-ares/%s", ares_version(NULL)); + ptr += strlen(ptr); +#endif return version; } @@ -159,7 +168,7 @@ static const char *protocols[] = { }; static curl_version_info_data version_info = { - CURLVERSION_FIRST, + CURLVERSION_SECOND, LIBCURL_VERSION, LIBCURL_VERSION_NUM, OS, /* as found by configure or set by hand at build-time */ @@ -193,7 +202,8 @@ static curl_version_info_data version_info = { NULL, /* ssl_version */ 0, /* ssl_version_num */ NULL, /* zlib_version */ - protocols + protocols, + NULL, /* c-ares version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) @@ -211,6 +221,13 @@ curl_version_info_data *curl_version_info(CURLversion stamp) #ifdef HAVE_LIBZ version_info.libz_version = zlibVersion(); /* libz left NULL if non-existing */ +#endif +#ifdef USE_ARES + { + int aresnum; + version_info.ares = ares_version(&aresnum); + version_info.ares_num = aresnum; + } #endif (void)stamp; /* avoid compiler warnings, we don't use this */ -- cgit v1.2.1 From 95dd343244b09348b0d51376f6c7f7bab18794d5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Feb 2004 06:39:37 +0000 Subject: added the missing ares numerical version initialiser --- lib/version.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 80abba4ea..eaf20c0cd 100644 --- a/lib/version.c +++ b/lib/version.c @@ -204,6 +204,7 @@ static curl_version_info_data version_info = { NULL, /* zlib_version */ protocols, NULL, /* c-ares version */ + 0, /* c-ares version numerical */ }; curl_version_info_data *curl_version_info(CURLversion stamp) -- cgit v1.2.1 From 0c7cb0c10f41620003b81e1c53c08fc760ea3da0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 5 Feb 2004 09:37:46 +0000 Subject: prevent warning from that picky MIPSpro compiler --- lib/version.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index eaf20c0cd..41b00aa36 100644 --- a/lib/version.c +++ b/lib/version.c @@ -95,15 +95,15 @@ char *curl_version(void) { static char version[200]; char *ptr; - long num; strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION ); ptr=strchr(version, '\0'); #ifdef USE_SSLEAY - getssl_version(ptr, &num); - ptr=strchr(version, '\0'); -#else - (void)num; /* no compiler warning please */ + { + long num; + getssl_version(ptr, &num); + ptr=strchr(version, '\0'); + } #endif #ifdef HAVE_KRB4 -- cgit v1.2.1 From 7983ec84a7e72c0e4baf11ad5f6bb3c5ef34468e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Mar 2004 16:24:04 +0000 Subject: set CURL_VERSION_LARGEFILE if we support large files --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 41b00aa36..59d8a1461 100644 --- a/lib/version.c +++ b/lib/version.c @@ -197,6 +197,9 @@ static curl_version_info_data version_info = { #endif #ifdef HAVE_SPNEGO | CURL_VERSION_SPNEGO +#endif +#ifdef ENABLE_64BIT + | CURL_VERSION_LARGEFILE #endif , NULL, /* ssl_version */ -- cgit v1.2.1 From 3fa4ac080ef776e109500ca43966251f2dfd1dbd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 8 Mar 2004 07:46:26 +0000 Subject: we must not only support long long for Largefile to work, we must have a curl_off_t type that is larger than 4 bytes --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 59d8a1461..d2125a259 100644 --- a/lib/version.c +++ b/lib/version.c @@ -198,7 +198,7 @@ static curl_version_info_data version_info = { #ifdef HAVE_SPNEGO | CURL_VERSION_SPNEGO #endif -#ifdef ENABLE_64BIT +#if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4) | CURL_VERSION_LARGEFILE #endif , -- cgit v1.2.1 From 9631fa740708b1890197fad01e25b34b7e8eb80e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 26 Apr 2004 07:14:08 +0000 Subject: added libidn awareness --- lib/version.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index d2125a259..9e553673d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -33,6 +33,10 @@ #include #endif +#ifdef USE_LIBIDN +#include +#endif + #ifdef USE_SSLEAY static void getssl_version(char *ptr, long *num) { @@ -95,6 +99,7 @@ char *curl_version(void) { static char version[200]; char *ptr; + int len = sizeof(version); strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION ); ptr=strchr(version, '\0'); @@ -105,6 +110,7 @@ char *curl_version(void) ptr=strchr(version, '\0'); } #endif + len -= strlen(version); #ifdef HAVE_KRB4 sprintf(ptr, " krb4"); @@ -127,6 +133,10 @@ char *curl_version(void) sprintf(ptr, " c-ares/%s", ares_version(NULL)); ptr += strlen(ptr); #endif +#ifdef USE_LIBIDN + sprintf(ptr, " libidn/%s", stringprep_check_version(NULL)); + ptr += strlen(ptr); +#endif return version; } @@ -168,7 +178,7 @@ static const char *protocols[] = { }; static curl_version_info_data version_info = { - CURLVERSION_SECOND, + CURLVERSION_NOW, LIBCURL_VERSION, LIBCURL_VERSION_NUM, OS, /* as found by configure or set by hand at build-time */ @@ -200,6 +210,9 @@ static curl_version_info_data version_info = { #endif #if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4) | CURL_VERSION_LARGEFILE +#endif +#ifdef USE_LIBIDN + | CURL_VERSION_IDN #endif , NULL, /* ssl_version */ @@ -208,6 +221,7 @@ static curl_version_info_data version_info = { protocols, NULL, /* c-ares version */ 0, /* c-ares version numerical */ + NULL, /* libidn version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) -- cgit v1.2.1 From 3fc831f9eb906a5471222e584fc67c1590c7afc3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 May 2004 07:24:47 +0000 Subject: typecast the unsigned long to plain long to prevent compiler warnings --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 9e553673d..150d52b31 100644 --- a/lib/version.c +++ b/lib/version.c @@ -47,7 +47,7 @@ static void getssl_version(char *ptr, long *num) unsigned long ssleay_value; sub[1]='\0'; ssleay_value=SSLeay(); - *num = ssleay_value; + *num = (long)ssleay_value; if(ssleay_value < 0x906000) { ssleay_value=SSLEAY_VERSION_NUMBER; sub[0]='\0'; -- cgit v1.2.1 From af72f198ba486858d0794e272bb090b50db04a57 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 6 May 2004 07:32:30 +0000 Subject: removed the unused 'len' variable, made use of the ptr pointer even if no extra lib is used to prevent compiler warnings ("variable set but not used") on that case --- lib/version.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 150d52b31..3f981e2b5 100644 --- a/lib/version.c +++ b/lib/version.c @@ -98,10 +98,9 @@ static void getssl_version(char *ptr, long *num) char *curl_version(void) { static char version[200]; - char *ptr; - int len = sizeof(version); - strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION ); - ptr=strchr(version, '\0'); + char *ptr=version; + strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); + ptr=strchr(ptr, '\0'); #ifdef USE_SSLEAY { @@ -110,7 +109,6 @@ char *curl_version(void) ptr=strchr(version, '\0'); } #endif - len -= strlen(version); #ifdef HAVE_KRB4 sprintf(ptr, " krb4"); -- cgit v1.2.1 From 24420c21915ff74a8a13c284a1fa66aaff1e847b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 May 2004 07:40:00 +0000 Subject: Simon Josefsson added a idn_free() function in libidn 0.4.5 as a reaction to Gisle's previous mail. We now use this function, and thus we require libidn 0.4.5 or later. No earler version will do. --- lib/version.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 3f981e2b5..7bd4dbe50 100644 --- a/lib/version.c +++ b/lib/version.c @@ -132,8 +132,10 @@ char *curl_version(void) ptr += strlen(ptr); #endif #ifdef USE_LIBIDN - sprintf(ptr, " libidn/%s", stringprep_check_version(NULL)); - ptr += strlen(ptr); + if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) { + sprintf(ptr, " libidn/%s", stringprep_check_version(NULL)); + ptr += strlen(ptr); + } #endif return version; @@ -208,9 +210,6 @@ static curl_version_info_data version_info = { #endif #if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4) | CURL_VERSION_LARGEFILE -#endif -#ifdef USE_LIBIDN - | CURL_VERSION_IDN #endif , NULL, /* ssl_version */ @@ -244,6 +243,13 @@ curl_version_info_data *curl_version_info(CURLversion stamp) version_info.ares = ares_version(&aresnum); version_info.ares_num = aresnum; } +#endif +#ifdef USE_LIBIDN + /* This returns a version string if we use the given version or later, + otherwise it returns NULL */ + version_info.libidn = stringprep_check_version(LIBIDN_REQUIRED_VERSION); + if(version_info.libidn) + version_info.features |= CURL_VERSION_IDN; #endif (void)stamp; /* avoid compiler warnings, we don't use this */ -- cgit v1.2.1 From feb2dd283533f842c9b6e4cc2fcc7fd35638d5a0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 24 Jun 2004 11:54:11 +0000 Subject: Replaced all uses of sprintf() with the safer snprintf(). It is just a precaution to prevent mistakes to lead to buffer overflows. --- lib/version.c | 78 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 40 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 7bd4dbe50..21939d925 100644 --- a/lib/version.c +++ b/lib/version.c @@ -1,8 +1,8 @@ /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. @@ -10,7 +10,7 @@ * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. - * + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. @@ -29,6 +29,9 @@ #include #include "urldata.h" +#define _MPRINTF_REPLACE /* use the internal *printf() functions */ +#include + #ifdef USE_ARES #include #endif @@ -38,7 +41,7 @@ #endif #ifdef USE_SSLEAY -static void getssl_version(char *ptr, long *num) +static int getssl_version(char *ptr, size_t left, long *num) { #if (SSLEAY_VERSION_NUMBER >= 0x905000) @@ -60,20 +63,20 @@ static void getssl_version(char *ptr, long *num) sub[0]='\0'; } - sprintf(ptr, " OpenSSL/%lx.%lx.%lx%s", - (ssleay_value>>28)&0xf, - (ssleay_value>>20)&0xff, - (ssleay_value>>12)&0xff, - sub); + return snprintf(ptr, left, " OpenSSL/%lx.%lx.%lx%s", + (ssleay_value>>28)&0xf, + (ssleay_value>>20)&0xff, + (ssleay_value>>12)&0xff, + sub); } #else *num = SSLEAY_VERSION_NUMBER; #if (SSLEAY_VERSION_NUMBER >= 0x900000) - sprintf(ptr, " OpenSSL/%lx.%lx.%lx", - (SSLEAY_VERSION_NUMBER>>28)&0xff, - (SSLEAY_VERSION_NUMBER>>20)&0xff, - (SSLEAY_VERSION_NUMBER>>12)&0xf); + return snprintf(ptr, left, " OpenSSL/%lx.%lx.%lx", + (SSLEAY_VERSION_NUMBER>>28)&0xff, + (SSLEAY_VERSION_NUMBER>>20)&0xff, + (SSLEAY_VERSION_NUMBER>>12)&0xf); #else { char sub[2]; @@ -84,10 +87,10 @@ static void getssl_version(char *ptr, long *num) else sub[0]='\0'; - sprintf(ptr, " SSL/%x.%x.%x%s", - (SSLEAY_VERSION_NUMBER>>12)&0xff, - (SSLEAY_VERSION_NUMBER>>8)&0xf, - (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); + return snprintf(ptr, left, " SSL/%x.%x.%x%s", + (SSLEAY_VERSION_NUMBER>>12)&0xff, + (SSLEAY_VERSION_NUMBER>>8)&0xf, + (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); } #endif #endif @@ -99,42 +102,37 @@ char *curl_version(void) { static char version[200]; char *ptr=version; + int len; + size_t left = sizeof(version); strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); ptr=strchr(ptr, '\0'); + left -= strlen(ptr); #ifdef USE_SSLEAY { long num; - getssl_version(ptr, &num); - ptr=strchr(version, '\0'); + len = getssl_version(ptr, left, &num); + left -= len; + ptr += len; } #endif -#ifdef HAVE_KRB4 - sprintf(ptr, " krb4"); - ptr += strlen(ptr); -#endif -#ifdef ENABLE_IPV6 - sprintf(ptr, " ipv6"); - ptr += strlen(ptr); -#endif #ifdef HAVE_LIBZ - sprintf(ptr, " zlib/%s", zlibVersion()); - ptr += strlen(ptr); -#endif -#ifdef HAVE_GSSAPI - sprintf(ptr, " GSS"); - ptr += strlen(ptr); + len = snprintf(ptr, left, " zlib/%s", zlibVersion()); + left -= len; + ptr += len; #endif #ifdef USE_ARES /* this function is only present in c-ares, not in the original ares */ - sprintf(ptr, " c-ares/%s", ares_version(NULL)); - ptr += strlen(ptr); + len = snprintf(ptr, left, " c-ares/%s", ares_version(NULL)); + left -= len; + ptr += len; #endif #ifdef USE_LIBIDN if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) { - sprintf(ptr, " libidn/%s", stringprep_check_version(NULL)); - ptr += strlen(ptr); + len = snprintf(ptr, left, " libidn/%s", stringprep_check_version(NULL)); + left -= len; + ptr += len; } #endif @@ -226,7 +224,7 @@ curl_version_info_data *curl_version_info(CURLversion stamp) #ifdef USE_SSLEAY static char ssl_buffer[80]; long num; - getssl_version(ssl_buffer, &num); + getssl_version(ssl_buffer, sizeof(ssl_buffer), &num); version_info.ssl_version = ssl_buffer; version_info.ssl_version_num = num; -- cgit v1.2.1 From 8b6b15dcccbe2c137a33b01370fe804462c950a6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 24 Jun 2004 14:52:51 +0000 Subject: to prevent compier warnings, we only declare len if we have code that uses it --- lib/version.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 21939d925..510c20afc 100644 --- a/lib/version.c +++ b/lib/version.c @@ -102,7 +102,12 @@ char *curl_version(void) { static char version[200]; char *ptr=version; + /* to prevent compier warnings, we only declare len if we have code + that uses it */ +#if defined(USE_SSLEAY) || defined(HAVE_LIBZ) || defined(USE_ARES) || \ + defined(USE_LIBIDN) int len; +#endif size_t left = sizeof(version); strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); ptr=strchr(ptr, '\0'); -- cgit v1.2.1 From 80d301257c8b02dc2691fa8283bc02c1c84c06a3 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 20 Dec 2004 18:23:43 +0000 Subject: Make some more arrays of pointers const. --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 510c20afc..ebe0b5ba2 100644 --- a/lib/version.c +++ b/lib/version.c @@ -146,7 +146,7 @@ char *curl_version(void) /* data for curl_version_info */ -static const char *protocols[] = { +static const char * const protocols[] = { #ifndef CURL_DISABLE_FTP "ftp", #endif -- cgit v1.2.1 From d1d35ba85fe6f8a9e6a86d2a6c60109cf90edd6c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 10 Mar 2005 23:15:29 +0000 Subject: Christopher R. Palmer made it possible to build libcurl with the USE_WINDOWS_SSPI on Windows, and then libcurl will be built to use the native way to do NTLM. SSPI also allows libcurl to pass on the current user and its password in the request. --- lib/version.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index ebe0b5ba2..e82eacf59 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -194,6 +194,8 @@ static curl_version_info_data version_info = { #endif #ifdef USE_SSLEAY | CURL_VERSION_SSL +#endif +#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) | CURL_VERSION_NTLM /* since this requires OpenSSL */ #endif #ifdef HAVE_LIBZ -- cgit v1.2.1 From 84bc23b92f3e22722b965ae460ca8d3413293d3b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 11 Mar 2005 15:10:36 +0000 Subject: curl_version_info() returns the feature bit CURL_VERSION_SSPI --- lib/version.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index e82eacf59..34741bb2b 100644 --- a/lib/version.c +++ b/lib/version.c @@ -196,7 +196,10 @@ static curl_version_info_data version_info = { | CURL_VERSION_SSL #endif #if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) - | CURL_VERSION_NTLM /* since this requires OpenSSL */ + | CURL_VERSION_NTLM +#endif +#ifdef USE_WINDOWS_SSPI + | CURL_VERSION_SSPI #endif #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ -- cgit v1.2.1 From 6e619393824922118317689ef59a73c556b7ef98 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 7 Apr 2005 15:27:13 +0000 Subject: GnuTLS support added. There's now a "generic" SSL layer that we use all over internally, with code provided by sslgen.c. All SSL-layer-specific code is then written in ssluse.c (for OpenSSL) and gtls.c (for GnuTLS). As far as possible, internals should not need to know what SSL layer that is in use. Building with GnuTLS currently makes two test cases fail. TODO.gnutls contains a few known outstanding issues for the GnuTLS support. GnuTLS support is enabled with configure --with-gnutls --- lib/version.c | 92 +++++++---------------------------------------------------- 1 file changed, 11 insertions(+), 81 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 34741bb2b..f7fe757ec 100644 --- a/lib/version.c +++ b/lib/version.c @@ -28,6 +28,7 @@ #include #include "urldata.h" +#include "sslgen.h" #define _MPRINTF_REPLACE /* use the internal *printf() functions */ #include @@ -40,87 +41,20 @@ #include #endif -#ifdef USE_SSLEAY -static int getssl_version(char *ptr, size_t left, long *num) -{ - -#if (SSLEAY_VERSION_NUMBER >= 0x905000) - { - char sub[2]; - unsigned long ssleay_value; - sub[1]='\0'; - ssleay_value=SSLeay(); - *num = (long)ssleay_value; - if(ssleay_value < 0x906000) { - ssleay_value=SSLEAY_VERSION_NUMBER; - sub[0]='\0'; - } - else { - if(ssleay_value&0xff0) { - sub[0]=(char)((ssleay_value>>4)&0xff) + 'a' -1; - } - else - sub[0]='\0'; - } - - return snprintf(ptr, left, " OpenSSL/%lx.%lx.%lx%s", - (ssleay_value>>28)&0xf, - (ssleay_value>>20)&0xff, - (ssleay_value>>12)&0xff, - sub); - } - -#else - *num = SSLEAY_VERSION_NUMBER; -#if (SSLEAY_VERSION_NUMBER >= 0x900000) - return snprintf(ptr, left, " OpenSSL/%lx.%lx.%lx", - (SSLEAY_VERSION_NUMBER>>28)&0xff, - (SSLEAY_VERSION_NUMBER>>20)&0xff, - (SSLEAY_VERSION_NUMBER>>12)&0xf); -#else - { - char sub[2]; - sub[1]='\0'; - if(SSLEAY_VERSION_NUMBER&0x0f) { - sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1; - } - else - sub[0]='\0'; - - return snprintf(ptr, left, " SSL/%x.%x.%x%s", - (SSLEAY_VERSION_NUMBER>>12)&0xff, - (SSLEAY_VERSION_NUMBER>>8)&0xf, - (SSLEAY_VERSION_NUMBER>>4)&0xf, sub); - } -#endif -#endif -} - -#endif char *curl_version(void) { static char version[200]; char *ptr=version; - /* to prevent compier warnings, we only declare len if we have code - that uses it */ -#if defined(USE_SSLEAY) || defined(HAVE_LIBZ) || defined(USE_ARES) || \ - defined(USE_LIBIDN) - int len; -#endif + size_t len; size_t left = sizeof(version); strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); ptr=strchr(ptr, '\0'); left -= strlen(ptr); -#ifdef USE_SSLEAY - { - long num; - len = getssl_version(ptr, left, &num); - left -= len; - ptr += len; - } -#endif + len = Curl_ssl_version(ptr, left); + left -= len; + ptr += len; #ifdef HAVE_LIBZ len = snprintf(ptr, left, " zlib/%s", zlibVersion()); @@ -169,7 +103,7 @@ static const char * const protocols[] = { "file", #endif -#ifdef USE_SSLEAY +#ifdef USE_SSL #ifndef CURL_DISABLE_HTTP "https", #endif @@ -192,10 +126,10 @@ static curl_version_info_data version_info = { #ifdef HAVE_KRB4 | CURL_VERSION_KERBEROS4 #endif -#ifdef USE_SSLEAY +#ifdef USE_SSL | CURL_VERSION_SSL #endif -#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) +#ifdef USE_NTLM | CURL_VERSION_NTLM #endif #ifdef USE_WINDOWS_SSPI @@ -221,7 +155,7 @@ static curl_version_info_data version_info = { #endif , NULL, /* ssl_version */ - 0, /* ssl_version_num */ + 0, /* ssl_version_num, this is kept at zero */ NULL, /* zlib_version */ protocols, NULL, /* c-ares version */ @@ -231,14 +165,10 @@ static curl_version_info_data version_info = { curl_version_info_data *curl_version_info(CURLversion stamp) { -#ifdef USE_SSLEAY +#ifdef USE_SSL static char ssl_buffer[80]; - long num; - getssl_version(ssl_buffer, sizeof(ssl_buffer), &num); - + Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer)); version_info.ssl_version = ssl_buffer; - version_info.ssl_version_num = num; - /* SSL stuff is left zero if undefined */ #endif #ifdef HAVE_LIBZ -- cgit v1.2.1 From 56d9624b566ac15ffb4b4b6eef220a5000b767e0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 2 Sep 2005 15:11:08 +0000 Subject: John Kelly added TFTP support to libcurl. A bunch of new error codes was added. TODO: add them to docs. add TFTP server to test suite. add TFTP to list of protocols whereever those are mentioned. --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index f7fe757ec..42bdfd99c 100644 --- a/lib/version.c +++ b/lib/version.c @@ -81,6 +81,9 @@ char *curl_version(void) /* data for curl_version_info */ static const char * const protocols[] = { +#ifndef CURL_DISABLE_TFTP + "tftp", +#endif #ifndef CURL_DISABLE_FTP "ftp", #endif -- cgit v1.2.1 From 67a83c1b3465c44b249eaa44fdc492952e59b31f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 16 Jan 2006 22:14:37 +0000 Subject: David Shaw finally removed all traces of Gopher and we are now officially not supporting it. It hasn't been functioning for years anyway, so this is just finally stating what already was true. And a cleanup at the same time. --- lib/version.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 42bdfd99c..53e2b56ef 100644 --- a/lib/version.c +++ b/lib/version.c @@ -87,9 +87,6 @@ static const char * const protocols[] = { #ifndef CURL_DISABLE_FTP "ftp", #endif -#ifndef CURL_DISABLE_GOPHER - "gopher", -#endif #ifndef CURL_DISABLE_TELNET "telnet", #endif -- cgit v1.2.1 From f191b143e99d26a1d68537a30fd3e8723060f674 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 19 Apr 2006 09:03:21 +0000 Subject: CURL_VERSION_CONV is returned by curl_version_info if libcurl has been built to allow/support character conversions --- lib/version.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 53e2b56ef..6cf5eb5de 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -152,6 +152,9 @@ static curl_version_info_data version_info = { #endif #if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4) | CURL_VERSION_LARGEFILE +#endif +#if defined(CURL_DOES_CONVERSIONS) + | CURL_VERSION_CONV #endif , NULL, /* ssl_version */ -- cgit v1.2.1 From cca00a63781934492caa8b46f8a9e56035a6e6fe Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Fri, 4 Aug 2006 16:10:48 +0000 Subject: Added version info for iconv. --- lib/version.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 6cf5eb5de..46f3ff047 100644 --- a/lib/version.c +++ b/lib/version.c @@ -41,6 +41,9 @@ #include #endif +#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) +#include +#endif char *curl_version(void) { @@ -74,6 +77,12 @@ char *curl_version(void) ptr += len; } #endif +#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) + len = snprintf(ptr, left, " iconv/%d.%d", + _libiconv_version >> 8, _libiconv_version & 255); + left -= len; + ptr += len; +#endif return version; } @@ -164,6 +173,7 @@ static curl_version_info_data version_info = { NULL, /* c-ares version */ 0, /* c-ares version numerical */ NULL, /* libidn version */ + 0, /* iconv version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) @@ -192,6 +202,11 @@ curl_version_info_data *curl_version_info(CURLversion stamp) if(version_info.libidn) version_info.features |= CURL_VERSION_IDN; #endif + +#if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) + version_info.iconv_ver_num = _libiconv_version; +#endif + (void)stamp; /* avoid compiler warnings, we don't use this */ return &version_info; -- cgit v1.2.1 From 31def9e2175d4d4ba3810f3781ca5110254ad6f9 Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Tue, 15 Aug 2006 17:02:24 +0000 Subject: Use '_LIBICONV_VERSION' instead of variable '_libiconv_version' to support older iconv versions. --- lib/version.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 46f3ff047..722f93b22 100644 --- a/lib/version.c +++ b/lib/version.c @@ -78,8 +78,13 @@ char *curl_version(void) } #endif #if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) +#ifdef _LIBICONV_VERSION len = snprintf(ptr, left, " iconv/%d.%d", - _libiconv_version >> 8, _libiconv_version & 255); + _LIBICONV_VERSION >> 8, _LIBICONV_VERSION & 255); +#else + /* version unknown */ + len = snprintf(ptr, left, " iconv"); +#endif /* _LIBICONV_VERSION */ left -= len; ptr += len; #endif @@ -204,7 +209,12 @@ curl_version_info_data *curl_version_info(CURLversion stamp) #endif #if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) - version_info.iconv_ver_num = _libiconv_version; +#ifdef _LIBICONV_VERSION + version_info.iconv_ver_num = _LIBICONV_VERSION; +#else + /* version unknown */ + version_info.iconv_ver_num = -1; +#endif /* _LIBICONV_VERSION */ #endif (void)stamp; /* avoid compiler warnings, we don't use this */ -- cgit v1.2.1 From 2147284cad624325f5b0034c2f394db62086d9e6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 2 Nov 2006 21:56:40 +0000 Subject: James Housley brought support for SCP transfers --- lib/version.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 722f93b22..c778896b2 100644 --- a/lib/version.c +++ b/lib/version.c @@ -45,6 +45,11 @@ #include #endif +#ifdef USE_LIBSSH2 +#include +#endif + + char *curl_version(void) { static char version[200]; @@ -88,6 +93,11 @@ char *curl_version(void) left -= len; ptr += len; #endif +#ifdef USE_LIBSSH2 + len = snprintf(ptr, left, " libssh2/%s", LIBSSH2_VERSION); + left -= len; + ptr += len; +#endif return version; } @@ -125,6 +135,11 @@ static const char * const protocols[] = { "ftps", #endif #endif + +#ifdef USE_LIBSSH2 + "scp", +#endif + NULL }; @@ -179,10 +194,15 @@ static curl_version_info_data version_info = { 0, /* c-ares version numerical */ NULL, /* libidn version */ 0, /* iconv version */ + NULL, /* ssh lib version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) { +#ifdef USE_LIBSSH2 + static char ssh_buffer[80]; +#endif + #ifdef USE_SSL static char ssl_buffer[80]; Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer)); @@ -217,6 +237,11 @@ curl_version_info_data *curl_version_info(CURLversion stamp) #endif /* _LIBICONV_VERSION */ #endif +#ifdef USE_LIBSSH2 + snprintf(ssh_buffer, sizeof(ssh_buffer), "libssh2/%s", LIBSSH2_VERSION); + version_info.libssh_version = ssh_buffer; +#endif + (void)stamp; /* avoid compiler warnings, we don't use this */ return &version_info; -- cgit v1.2.1 From a634f644005cbe2b3dea2b84328d605ec3474054 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 24 Nov 2006 22:14:39 +0000 Subject: James Housley did lots of work and introduced SFTP downloads. --- lib/version.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index c778896b2..9085f7df8 100644 --- a/lib/version.c +++ b/lib/version.c @@ -138,6 +138,7 @@ static const char * const protocols[] = { #ifdef USE_LIBSSH2 "scp", + "sftp", #endif NULL -- cgit v1.2.1 From ca410ec2ca79c880fa71b4abd5a05470a42467ee Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 15 Aug 2007 14:49:16 +0000 Subject: Fix a potential buffer overflow bug in lib/version.c --- lib/version.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 9085f7df8..43b993694 100644 --- a/lib/version.c +++ b/lib/version.c @@ -57,8 +57,9 @@ char *curl_version(void) size_t len; size_t left = sizeof(version); strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); - ptr=strchr(ptr, '\0'); - left -= strlen(ptr); + len = strlen(ptr); + left -= len; + ptr += len; len = Curl_ssl_version(ptr, left); left -= len; -- cgit v1.2.1 From ccba0d10b6baf5c73cae8cf4fb3f29f0f55c5a34 Mon Sep 17 00:00:00 2001 From: Gunter Knauf Date: Thu, 16 Aug 2007 14:08:47 +0000 Subject: added basic ldaps support; for now its ifdef'd with HAVE_LDAP_SSL unless we know its fully working, and available with all LDAP SDKs. Win32 requires to have the trusted CA in local keystore - I've not found yet a way to disable the cert check. --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 43b993694..de803babb 100644 --- a/lib/version.c +++ b/lib/version.c @@ -120,6 +120,9 @@ static const char * const protocols[] = { #endif #ifndef CURL_DISABLE_LDAP "ldap", +#ifdef HAVE_LDAP_SSL + "ldaps", +#endif #endif #ifndef CURL_DISABLE_HTTP "http", -- cgit v1.2.1 From d994fcf2b1b22cf08073cec98b8deb7031758197 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Fri, 24 Aug 2007 09:06:17 +0000 Subject: Remove leading space in curl_version_info ss_version field. --- lib/version.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index de803babb..24f5c622b 100644 --- a/lib/version.c +++ b/lib/version.c @@ -61,9 +61,15 @@ char *curl_version(void) left -= len; ptr += len; - len = Curl_ssl_version(ptr, left); - left -= len; - ptr += len; + if (left > 1) { + len = Curl_ssl_version(ptr + 1, left - 1); + + if (len > 0) { + *ptr = ' '; + left -= ++len; + ptr += len; + } + } #ifdef HAVE_LIBZ len = snprintf(ptr, left, " zlib/%s", zlibVersion()); -- cgit v1.2.1 From cbd1a77ec24e397d05f20c6de106625676343c9d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Nov 2007 09:21:35 +0000 Subject: if () => if() while () => while() and some other minor re-indentings --- lib/version.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 24f5c622b..5fb57525a 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -61,10 +61,10 @@ char *curl_version(void) left -= len; ptr += len; - if (left > 1) { + if(left > 1) { len = Curl_ssl_version(ptr + 1, left - 1); - if (len > 0) { + if(len > 0) { *ptr = ' '; left -= ++len; ptr += len; -- cgit v1.2.1 From 24b189071035e5b987c137b491532597158889b9 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 11 Aug 2008 01:22:57 +0000 Subject: s/SIZEOF_CURL_OFF_T/CURL_SIZEOF_CURL_OFF_T/g --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 5fb57525a..a2828ceae 100644 --- a/lib/version.c +++ b/lib/version.c @@ -190,7 +190,7 @@ static curl_version_info_data version_info = { #ifdef HAVE_SPNEGO | CURL_VERSION_SPNEGO #endif -#if defined(ENABLE_64BIT) && (SIZEOF_CURL_OFF_T > 4) +#if defined(ENABLE_64BIT) && (CURL_SIZEOF_CURL_OFF_T > 4) | CURL_VERSION_LARGEFILE #endif #if defined(CURL_DOES_CONVERSIONS) -- cgit v1.2.1 From ceb49d3742e4c27fdd86f9a6b043bebf7f42deaa Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 21 Aug 2008 00:06:15 +0000 Subject: Get rid of ENABLE_64BIT symbol definition and usage. Improve HAVE_LONGLONG symbol description. --- lib/version.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index a2828ceae..5b9ccca3d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -190,7 +190,16 @@ static curl_version_info_data version_info = { #ifdef HAVE_SPNEGO | CURL_VERSION_SPNEGO #endif -#if defined(ENABLE_64BIT) && (CURL_SIZEOF_CURL_OFF_T > 4) +/* + * FIXME before 7.19.0 release. + * + * libcurl is largefile enabled when (CURL_SIZEOF_CURL_OFF_T > 4) _AND_ + * libcurl has been built with sizeof(system off_t) > 4 or when large + * file support is available even with sizeof(system off_t) <= 4. + * + * Until this is adjusted, only the (CURL_SIZEOF_CURL_OFF_T > 4) check is done. + */ +#if (CURL_SIZEOF_CURL_OFF_T > 4) | CURL_VERSION_LARGEFILE #endif #if defined(CURL_DOES_CONVERSIONS) -- cgit v1.2.1 From 3e2487493ef28ea9e44931faffb04e89ed3aae8d Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 26 Aug 2008 01:40:19 +0000 Subject: Use SIZEOF_OFF_T definition from config file --- lib/version.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 5b9ccca3d..2e8f1b410 100644 --- a/lib/version.c +++ b/lib/version.c @@ -190,16 +190,8 @@ static curl_version_info_data version_info = { #ifdef HAVE_SPNEGO | CURL_VERSION_SPNEGO #endif -/* - * FIXME before 7.19.0 release. - * - * libcurl is largefile enabled when (CURL_SIZEOF_CURL_OFF_T > 4) _AND_ - * libcurl has been built with sizeof(system off_t) > 4 or when large - * file support is available even with sizeof(system off_t) <= 4. - * - * Until this is adjusted, only the (CURL_SIZEOF_CURL_OFF_T > 4) check is done. - */ -#if (CURL_SIZEOF_CURL_OFF_T > 4) +#if (CURL_SIZEOF_CURL_OFF_T > 4) && \ + ( (SIZEOF_OFF_T > 4) || defined(USE_WIN32_LARGE_FILES) ) | CURL_VERSION_LARGEFILE #endif #if defined(CURL_DOES_CONVERSIONS) -- cgit v1.2.1 From 74ba4d7950fa001d0a9dddfddacb240ae2c69c6c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 13 Mar 2009 09:58:15 +0000 Subject: - Use libssh2_version() to present the libssh2 version in case the libssh2 library is found to support it. --- lib/version.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 2e8f1b410..61a3b3287 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -49,6 +49,13 @@ #include #endif +#ifdef HAVE_LIBSSH2_VERSION +/* get it run-time if possible */ +#define CURL_LIBSSH2_VERSION libssh2_version(0) +#else +/* use build-time if run-time not possible */ +#define CURL_LIBSSH2_VERSION LIBSSH2_VERSION +#endif char *curl_version(void) { @@ -101,7 +108,7 @@ char *curl_version(void) ptr += len; #endif #ifdef USE_LIBSSH2 - len = snprintf(ptr, left, " libssh2/%s", LIBSSH2_VERSION); + len = snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION); left -= len; ptr += len; #endif -- cgit v1.2.1 From 2c166812253c28cdfbffdd4de069f5c11db3c7a8 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 10 Jun 2009 02:49:42 +0000 Subject: Adjusted to take in account that... With the curl memory tracking feature decoupled from the debug build feature, CURLDEBUG and DEBUGBUILD preprocessor symbol definitions are used as follows: CURLDEBUG used for curl debug memory tracking specific code (--enable-curldebug) DEBUGBUILD used for debug enabled specific code (--enable-debug) --- lib/version.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 61a3b3287..2bcec0092 100644 --- a/lib/version.c +++ b/lib/version.c @@ -188,9 +188,12 @@ static curl_version_info_data version_info = { #ifdef HAVE_GSSAPI | CURL_VERSION_GSSNEGOTIATE #endif -#ifdef CURLDEBUG +#ifdef DEBUGBUILD | CURL_VERSION_DEBUG #endif +#ifdef CURLDEBUG + | CURL_VERSION_CURLDEBUG +#endif #ifdef USE_ARES | CURL_VERSION_ASYNCHDNS #endif -- cgit v1.2.1 From ec3bb8f727405642a471b4b1b9eb0118fc003104 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 12 Dec 2009 21:54:01 +0000 Subject: introducing IMAP, POP3 and SMTP support (still lots of polish left to do) --- lib/version.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 2bcec0092..19eb3d4aa 100644 --- a/lib/version.c +++ b/lib/version.c @@ -158,6 +158,27 @@ static const char * const protocols[] = { "sftp", #endif +#ifndef CURL_DISABLE_IMAP + "imap", +#ifdef USE_SSL + "imaps", +#endif +#endif + +#ifndef CURL_DISABLE_POP3 + "pop3", +#ifdef USE_SSL + "pop3s", +#endif +#endif + +#ifndef CURL_DISABLE_SMTP + "smtp", +#ifdef USE_SSL + "smtps", +#endif +#endif + NULL }; -- cgit v1.2.1 From bc4582b68a673d3b0f5a2e7d971605de2c8b3730 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 21 Jan 2010 13:58:30 +0000 Subject: Chris Conroy brought support for RTSP transfers, and with it comes 8(!) new libcurl options for controlling what to get and how to receive posssibly interleaved RTP data. Initial commit. --- lib/version.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 19eb3d4aa..2b9ebf893 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -143,6 +143,9 @@ static const char * const protocols[] = { #ifndef CURL_DISABLE_FILE "file", #endif +#ifndef CURL_DISABLE_RTSP + "rtsp", +#endif #ifdef USE_SSL #ifndef CURL_DISABLE_HTTP -- cgit v1.2.1 From a771fb0d41bf65a52a7e4fb5ca0ab3ca328587dd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 22 Jan 2010 13:06:50 +0000 Subject: alphabetically sort the list of supported protocols --- lib/version.c | 73 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 37 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 2b9ebf893..03131e988 100644 --- a/lib/version.c +++ b/lib/version.c @@ -116,70 +116,69 @@ char *curl_version(void) return version; } -/* data for curl_version_info */ +/* data for curl_version_info + + Keep the list sorted alphabetically. It is also written so that each + protocol line has its own #if line to make things easier on the eye. + */ static const char * const protocols[] = { -#ifndef CURL_DISABLE_TFTP - "tftp", -#endif -#ifndef CURL_DISABLE_FTP - "ftp", -#endif -#ifndef CURL_DISABLE_TELNET - "telnet", -#endif #ifndef CURL_DISABLE_DICT "dict", #endif -#ifndef CURL_DISABLE_LDAP - "ldap", -#ifdef HAVE_LDAP_SSL - "ldaps", -#endif -#endif -#ifndef CURL_DISABLE_HTTP - "http", -#endif #ifndef CURL_DISABLE_FILE "file", #endif -#ifndef CURL_DISABLE_RTSP - "rtsp", -#endif - -#ifdef USE_SSL -#ifndef CURL_DISABLE_HTTP - "https", -#endif #ifndef CURL_DISABLE_FTP + "ftp", +#endif +#if defined(USE_SSL) && !defined(CURL_DISABLE_FTP) "ftps", #endif +#ifndef CURL_DISABLE_HTTP + "http", #endif - -#ifdef USE_LIBSSH2 - "scp", - "sftp", +#if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP) + "https", #endif - #ifndef CURL_DISABLE_IMAP "imap", -#ifdef USE_SSL +#endif +#if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP) "imaps", #endif +#ifndef CURL_DISABLE_LDAP + "ldap", +#endif +#if defined(HAVE_LDAP_SSL) && !defined(CURL_DISABLE_LDAP) + "ldaps", #endif - #ifndef CURL_DISABLE_POP3 "pop3", -#ifdef USE_SSL +#endif +#if defined(USE_SSL) && !defined(CURL_DISABLE_POP3) "pop3s", #endif +#ifndef CURL_DISABLE_RTSP + "rtsp", +#endif +#ifdef USE_LIBSSH2 + "scp", +#endif +#ifdef USE_LIBSSH2 + "sftp", #endif - #ifndef CURL_DISABLE_SMTP "smtp", -#ifdef USE_SSL +#endif +#if defined(USE_SSL) && !defined(CURL_DISABLE_SMTP) "smtps", #endif +#ifndef CURL_DISABLE_TELNET + "telnet", +#endif +#ifndef CURL_DISABLE_TFTP + "tftp", #endif NULL -- cgit v1.2.1 From 597ad5a2ce99b8e74c32f7ead13581d2e9b23155 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 23 Jan 2010 13:53:33 +0000 Subject: adjust preprocessor symbol definition check relative to resolver specialty --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 03131e988..ec57885e9 100644 --- a/lib/version.c +++ b/lib/version.c @@ -217,7 +217,7 @@ static curl_version_info_data version_info = { #ifdef CURLDEBUG | CURL_VERSION_CURLDEBUG #endif -#ifdef USE_ARES +#ifdef CURLRES_ASYNCH | CURL_VERSION_ASYNCHDNS #endif #ifdef HAVE_SPNEGO -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/version.c | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index ec57885e9..aa86e3902 100644 --- a/lib/version.c +++ b/lib/version.c @@ -18,7 +18,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ #include "setup.h" -- cgit v1.2.1 From d841ab82b8cf3b0db5e46c2f8cf943b845ab077f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 16 Apr 2010 23:49:03 +0200 Subject: curl_version: remove superfluous assignments --- lib/version.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index aa86e3902..86cb113d7 100644 --- a/lib/version.c +++ b/lib/version.c @@ -107,9 +107,15 @@ char *curl_version(void) ptr += len; #endif #ifdef USE_LIBSSH2 + (void)snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION); +/* + If another lib version is added below libssh2, this code would instead + have to do: + len = snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION); left -= len; ptr += len; +*/ #endif return version; -- cgit v1.2.1 From 027ceb37a1075bb585c8f5917a26f37cdfa352d6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 15 May 2010 22:13:17 +0200 Subject: RMTP: the version code is now rtmp aware --- lib/version.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 86cb113d7..6144f3268 100644 --- a/lib/version.c +++ b/lib/version.c @@ -44,6 +44,10 @@ #include #endif +#ifdef USE_LIBRTMP +#include +#endif + #ifdef USE_LIBSSH2 #include #endif @@ -107,15 +111,29 @@ char *curl_version(void) ptr += len; #endif #ifdef USE_LIBSSH2 - (void)snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION); -/* - If another lib version is added below libssh2, this code would instead - have to do: - len = snprintf(ptr, left, " libssh2/%s", CURL_LIBSSH2_VERSION); left -= len; ptr += len; +#endif +#ifdef USE_LIBRTMP + { + char suff[2]; + if (RTMP_LIB_VERSION & 0xff) { + suff[0] = (RTMP_LIB_VERSION & 0xff) + 'a' - 1; + suff[1] = '\0'; + } else { + suff[0] = '\0'; + } + len = snprintf(ptr, left, " librtmp/%d.%d%s", + RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, suff); +/* + If another lib version is added below this one, this code would + also have to do: + + left -= len; + ptr += len; */ + } #endif return version; @@ -164,6 +182,9 @@ static const char * const protocols[] = { #if defined(USE_SSL) && !defined(CURL_DISABLE_POP3) "pop3s", #endif +#ifdef USE_LIBRTMP + "rtmp", +#endif #ifndef CURL_DISABLE_RTSP "rtsp", #endif -- cgit v1.2.1 From 2e056353b00d0944bdb2f8e948cc40a4dc0f3dfb Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 25 May 2010 00:44:42 +0200 Subject: LDAP: properly implemented as a curl_handler makes the LDAP code much cleaner, nicer and in general being a better libcurl citizen. If a new enough OpenLDAP version is detect, the new and shiny lib/openldap.c code is then used instead of the old cruft Code by Howard, minor cleanups by Daniel. --- lib/version.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 6144f3268..f9cc1f7d9 100644 --- a/lib/version.c +++ b/lib/version.c @@ -170,12 +170,12 @@ static const char * const protocols[] = { #if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP) "imaps", #endif -#ifndef CURL_DISABLE_LDAP +#if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP) "ldap", -#endif -#if defined(HAVE_LDAP_SSL) && !defined(CURL_DISABLE_LDAP) +#if defined(HAVE_LDAP_SSL) || defined(USE_OPENLDAP) "ldaps", #endif +#endif #ifndef CURL_DISABLE_POP3 "pop3", #endif -- cgit v1.2.1 From b1c1b9bb76e01900de6ffd7e173eec3d2c65a310 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 28 May 2010 12:23:28 +0200 Subject: LDAPS: list availability depending on SSL's presence --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index f9cc1f7d9..d482bff1e 100644 --- a/lib/version.c +++ b/lib/version.c @@ -172,7 +172,7 @@ static const char * const protocols[] = { #endif #if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP) "ldap", -#if defined(HAVE_LDAP_SSL) || defined(USE_OPENLDAP) +#if defined(HAVE_LDAP_SSL) || (defined(USE_OPENLDAP) && defined(USE_SSL)) "ldaps", #endif #endif -- cgit v1.2.1 From 89da5324457070cb4a7391c48c6c4f84ed7fe964 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 1 Jun 2010 17:25:03 +0200 Subject: fix ldap related compilation issues --- lib/version.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index d482bff1e..9a336a32d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -170,9 +170,10 @@ static const char * const protocols[] = { #if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP) "imaps", #endif -#if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP) +#ifndef CURL_DISABLE_LDAP "ldap", -#if defined(HAVE_LDAP_SSL) || (defined(USE_OPENLDAP) && defined(USE_SSL)) +#if (defined(USE_OPENLDAP) && defined(USE_SSL)) || \ + (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)) "ldaps", #endif #endif -- cgit v1.2.1 From 201637d4682973bcc4a1fd0f4e8d4159300bd0b8 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Thu, 12 Aug 2010 07:55:48 -0700 Subject: Gopher protocol support (initial release) --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 9a336a32d..9ba2e33c1 100644 --- a/lib/version.c +++ b/lib/version.c @@ -158,6 +158,9 @@ static const char * const protocols[] = { #if defined(USE_SSL) && !defined(CURL_DISABLE_FTP) "ftps", #endif +#ifndef CURL_DISABLE_GOPHER + "gopher", +#endif #ifndef CURL_DISABLE_HTTP "http", #endif -- cgit v1.2.1 From 420eac5542ebf41a1812ae2250a0bc09517b999d Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 28 Dec 2010 19:55:00 +0100 Subject: IDN: use win32 API if told to The functionality is provided in a new source file: lib/idn_win32.c --- lib/version.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 9ba2e33c1..aab5517d0 100644 --- a/lib/version.c +++ b/lib/version.c @@ -99,6 +99,11 @@ char *curl_version(void) ptr += len; } #endif +#ifdef USE_WIN32_IDN + len = snprintf(ptr, left, " IDN-Windows-native"); + left -= len; + ptr += len; +#endif #if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) #ifdef _LIBICONV_VERSION len = snprintf(ptr, left, " iconv/%d.%d", @@ -301,6 +306,8 @@ curl_version_info_data *curl_version_info(CURLversion stamp) version_info.libidn = stringprep_check_version(LIBIDN_REQUIRED_VERSION); if(version_info.libidn) version_info.features |= CURL_VERSION_IDN; +#elif defined(USE_WIN32_IDN) + version_info.features |= CURL_VERSION_IDN; #endif #if defined(HAVE_ICONV) && defined(CURL_DOES_CONVERSIONS) -- cgit v1.2.1 From 1d28efb9d1759bcbc81d28e462c2e3a5d60a17e4 Mon Sep 17 00:00:00 2001 From: Marcel Roelofs Date: Wed, 5 Jan 2011 17:01:07 +0100 Subject: HTTP: HTTP Negotiate authentication using SSPI Only under Windows --- lib/version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index aab5517d0..5931e7180 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -243,7 +243,7 @@ static curl_version_info_data version_info = { #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ #endif -#ifdef HAVE_GSSAPI +#ifdef USE_HTTP_NEGOTIATE | CURL_VERSION_GSSNEGOTIATE #endif #ifdef DEBUGBUILD -- cgit v1.2.1 From 59cf93ccdbaa5e866f9de6b2d9b1ae5cee84863f Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Wed, 19 Jan 2011 20:35:02 +0100 Subject: TLS-SRP: support added when using GnuTLS --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 5931e7180..52989cdc6 100644 --- a/lib/version.c +++ b/lib/version.c @@ -264,6 +264,9 @@ static curl_version_info_data version_info = { #endif #if defined(CURL_DOES_CONVERSIONS) | CURL_VERSION_CONV +#endif +#if defined(USE_TLS_SRP) + | CURL_VERSION_TLSAUTH_SRP #endif , NULL, /* ssl_version */ -- cgit v1.2.1 From 29f0898525bf48292606f098bee33ce8f1f58781 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 7 Mar 2011 17:45:33 -0800 Subject: Fixed libcurl to honour the --disable-ldaps configure option --- lib/version.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 52989cdc6..97dd16395 100644 --- a/lib/version.c +++ b/lib/version.c @@ -180,8 +180,9 @@ static const char * const protocols[] = { #endif #ifndef CURL_DISABLE_LDAP "ldap", -#if (defined(USE_OPENLDAP) && defined(USE_SSL)) || \ - (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)) +#if !defined(CURL_DISABLE_LDAPS) && \ + ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ + (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) "ldaps", #endif #endif -- cgit v1.2.1 From ca015f1a45c68aa1d641678cfc13ce0df0c58fe0 Mon Sep 17 00:00:00 2001 From: Vsevolod Novikov Date: Sat, 29 Jan 2011 20:12:10 +0100 Subject: asynch resolvers: unified Introducing an internal API for handling of different async resolver backends. --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 97dd16395..7c19c9c80 100644 --- a/lib/version.c +++ b/lib/version.c @@ -33,7 +33,7 @@ #include #ifdef USE_ARES -#include +#include #endif #ifdef USE_LIBIDN -- cgit v1.2.1 From b903186fa0189ff241d756d25d07fdfe9885ae49 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 20 Apr 2011 15:17:42 +0200 Subject: source cleanup: unify look, style and indent levels By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed. --- lib/version.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 7c19c9c80..7d13c3453 100644 --- a/lib/version.c +++ b/lib/version.c @@ -123,12 +123,13 @@ char *curl_version(void) #ifdef USE_LIBRTMP { char suff[2]; - if (RTMP_LIB_VERSION & 0xff) { + if(RTMP_LIB_VERSION & 0xff) { suff[0] = (RTMP_LIB_VERSION & 0xff) + 'a' - 1; suff[1] = '\0'; - } else { - suff[0] = '\0'; } + else + suff[0] = '\0'; + len = snprintf(ptr, left, " librtmp/%d.%d%s", RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, suff); /* -- cgit v1.2.1 From 5db30a1d8c1250a787a65285499b949b92b0325f Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 19 May 2011 11:48:32 +0200 Subject: version: linkage fix Fix linkage on c-ares enabled Windows static builds --- lib/version.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 7d13c3453..c471dc106 100644 --- a/lib/version.c +++ b/lib/version.c @@ -33,7 +33,11 @@ #include #ifdef USE_ARES -#include +# if defined(CURL_STATICLIB) && !defined(CARES_STATICLIB) && \ + (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) +# define CARES_STATICLIB +# endif +# include #endif #ifdef USE_LIBIDN -- cgit v1.2.1 From a6d4807d028eb82f4a99587b0a8851727ca88566 Mon Sep 17 00:00:00 2001 From: Mandy Wu Date: Mon, 18 Jul 2011 23:36:36 +0200 Subject: NTLM single-sign on supported With the use of the 'ntlm_auth' tool from the Samba project --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index c471dc106..6b9ff5070 100644 --- a/lib/version.c +++ b/lib/version.c @@ -243,6 +243,9 @@ static curl_version_info_data version_info = { #ifdef USE_NTLM | CURL_VERSION_NTLM #endif +#ifdef USE_NTLM_SSO + | CURL_VERSION_NTLM_SSO +#endif #ifdef USE_WINDOWS_SSPI | CURL_VERSION_SSPI #endif -- cgit v1.2.1 From f1586cb4775681810afd8e6626e7842d459f3b85 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 26 Jul 2011 17:23:27 +0200 Subject: stdio.h, stdlib.h, string.h, stdarg.h and ctype.h inclusion done in setup_once.h --- lib/version.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 6b9ff5070..f9ee479c8 100644 --- a/lib/version.c +++ b/lib/version.c @@ -22,9 +22,6 @@ #include "setup.h" -#include -#include - #include #include "urldata.h" #include "sslgen.h" -- cgit v1.2.1 From 407e08baad45b060e3fa1387190a8b12aca9ab60 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 26 Aug 2011 18:57:50 +0200 Subject: NTLM single-sign on adjustments (X) Functions renamed: Curl_output_ntlm_sso -> Curl_output_ntlm_wb sso_ntlm_close -> wb_ntlm_close sso_ntlm_response -> wb_ntlm_response sso_ntlm_initiate -> wb_ntlm_initiate Preprocessor symbols renamed: CURLAUTH_NTLM_SSO -> CURLAUTH_NTLM_WB CURL_VERSION_NTLM_SSO -> CURL_VERSION_NTLM_WB --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index f9ee479c8..03a8f875d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -241,7 +241,7 @@ static curl_version_info_data version_info = { | CURL_VERSION_NTLM #endif #ifdef USE_NTLM_SSO - | CURL_VERSION_NTLM_SSO + | CURL_VERSION_NTLM_WB #endif #ifdef USE_WINDOWS_SSPI | CURL_VERSION_SSPI -- cgit v1.2.1 From b4f6319cf77ca2642154bdac76d6729dde56dd8e Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 27 Aug 2011 01:32:49 +0200 Subject: NTLM single-sign on adjustments (XI) Feature string literal NTLM_SSO renamed to NTLM_WB. Preprocessor symbol USE_NTLM_SSO renamed to WINBIND_NTLM_AUTH_ENABLED. curl's 'long' option 'ntlm-sso' renamed to 'ntlm-wb'. Fix some comments to make clear that this is actually a NTLM delegation. --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 03a8f875d..409d5d4c4 100644 --- a/lib/version.c +++ b/lib/version.c @@ -240,7 +240,7 @@ static curl_version_info_data version_info = { #ifdef USE_NTLM | CURL_VERSION_NTLM #endif -#ifdef USE_NTLM_SSO +#ifdef WINBIND_NTLM_AUTH_ENABLED | CURL_VERSION_NTLM_WB #endif #ifdef USE_WINDOWS_SSPI -- cgit v1.2.1 From b976d108f1beecff743f912f190ffc89f1ef9098 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 27 Aug 2011 06:31:18 +0200 Subject: NTLM_WB: final congruency naming adjustments Configure script option --enable-wb-ntlm-auth renamed to --enable-ntlm-wb Configure script option --disable-wb-ntlm-auth renamed to --disable-ntlm-wb Preprocessor symbol WINBIND_NTLM_AUTH_ENABLED renamed to NTLM_WB_ENABLED Preprocessor symbol WINBIND_NTLM_AUTH_FILE renamed to NTLM_WB_FILE Test harness env var CURL_NTLM_AUTH renamed to CURL_NTLM_WB_FILE Static function wb_ntlm_close renamed to ntlm_wb_cleanup Static function wb_ntlm_initiate renamed to ntlm_wb_init Static function wb_ntlm_response renamed to ntlm_wb_response --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 409d5d4c4..fdf758f9a 100644 --- a/lib/version.c +++ b/lib/version.c @@ -240,7 +240,7 @@ static curl_version_info_data version_info = { #ifdef USE_NTLM | CURL_VERSION_NTLM #endif -#ifdef WINBIND_NTLM_AUTH_ENABLED +#ifdef NTLM_WB_ENABLED | CURL_VERSION_NTLM_WB #endif #ifdef USE_WINDOWS_SSPI -- cgit v1.2.1 From 01c172f5e8c78b781397003e22fc462a503d2c24 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 22 Sep 2011 00:24:02 +0200 Subject: NTLM_WB: fix disabling of NTLM_WB when NTLM is disabled --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index fdf758f9a..c56ad3962 100644 --- a/lib/version.c +++ b/lib/version.c @@ -240,7 +240,7 @@ static curl_version_info_data version_info = { #ifdef USE_NTLM | CURL_VERSION_NTLM #endif -#ifdef NTLM_WB_ENABLED +#if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) | CURL_VERSION_NTLM_WB #endif #ifdef USE_WINDOWS_SSPI -- cgit v1.2.1 From 2976de480808119dae08fc6f52c8d75ba1aedb1a Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 22 Apr 2012 18:49:27 +0100 Subject: sspi: Added version information Added version information for Windows SSPI to curl's main version string and removed SSPI from the features string. --- lib/version.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index c56ad3962..38da9f14d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -64,10 +64,16 @@ char *curl_version(void) { static char version[200]; - char *ptr=version; + char *ptr = version; size_t len; size_t left = sizeof(version); - strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); +#ifdef USE_WINDOWS_SSPI + int sspi_major = 0; + int sspi_minor = 0; + int sspi_build = 0; +#endif; + + strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION); len = strlen(ptr); left -= len; ptr += len; @@ -82,6 +88,17 @@ char *curl_version(void) } } +#ifdef USE_WINDOWS_SSPI + if(CURLE_OK == Curl_sspi_version(&sspi_major, &sspi_minor, &sspi_build, + NULL)) + len = snprintf(ptr, left, " sspi/%d.%d.%d", sspi_major, sspi_minor, + sspi_build); + else + len = snprintf(ptr, left, " sspi/unknown"); + + left -= len; + ptr += len; +#endif #ifdef HAVE_LIBZ len = snprintf(ptr, left, " zlib/%s", zlibVersion()); left -= len; @@ -243,9 +260,6 @@ static curl_version_info_data version_info = { #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) | CURL_VERSION_NTLM_WB #endif -#ifdef USE_WINDOWS_SSPI - | CURL_VERSION_SSPI -#endif #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ #endif -- cgit v1.2.1 From 77172a242fc0c820f97eae39d0e3e0f265222fe6 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Sun, 22 Apr 2012 21:10:17 +0200 Subject: Fixed 'extra tokens at end of #endif directive'. --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 38da9f14d..564c35ccd 100644 --- a/lib/version.c +++ b/lib/version.c @@ -71,7 +71,7 @@ char *curl_version(void) int sspi_major = 0; int sspi_minor = 0; int sspi_build = 0; -#endif; +#endif strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION); len = strlen(ptr); -- cgit v1.2.1 From d83233501f4d45d033562411b4e747b9740b7c4b Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 23 Apr 2012 16:27:33 +0200 Subject: Revert "Fixed 'extra tokens at end of #endif directive'." This reverts commit 77172a242fc0c820f97eae39d0e3e0f265222fe6. --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 564c35ccd..38da9f14d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -71,7 +71,7 @@ char *curl_version(void) int sspi_major = 0; int sspi_minor = 0; int sspi_build = 0; -#endif +#endif; strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION); len = strlen(ptr); -- cgit v1.2.1 From d6c449e3b4262aa29c1594d64379a8c26d9a5c38 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 23 Apr 2012 16:28:01 +0200 Subject: Revert "sspi: Added version information" This reverts commit 2976de480808119dae08fc6f52c8d75ba1aedb1a. --- lib/version.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 38da9f14d..c56ad3962 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -64,16 +64,10 @@ char *curl_version(void) { static char version[200]; - char *ptr = version; + char *ptr=version; size_t len; size_t left = sizeof(version); -#ifdef USE_WINDOWS_SSPI - int sspi_major = 0; - int sspi_minor = 0; - int sspi_build = 0; -#endif; - - strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION); + strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); len = strlen(ptr); left -= len; ptr += len; @@ -88,17 +82,6 @@ char *curl_version(void) } } -#ifdef USE_WINDOWS_SSPI - if(CURLE_OK == Curl_sspi_version(&sspi_major, &sspi_minor, &sspi_build, - NULL)) - len = snprintf(ptr, left, " sspi/%d.%d.%d", sspi_major, sspi_minor, - sspi_build); - else - len = snprintf(ptr, left, " sspi/unknown"); - - left -= len; - ptr += len; -#endif #ifdef HAVE_LIBZ len = snprintf(ptr, left, " zlib/%s", zlibVersion()); left -= len; @@ -260,6 +243,9 @@ static curl_version_info_data version_info = { #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) | CURL_VERSION_NTLM_WB #endif +#ifdef USE_WINDOWS_SSPI + | CURL_VERSION_SSPI +#endif #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ #endif -- cgit v1.2.1 From 634f7cfee40d4658bc19dc9f23b5628c644c1848 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Mon, 11 Jun 2012 08:36:48 +0200 Subject: version: Replaced SSPI feature information with version string details Added Windows SSPI version information to the curl version string when SCHANNEL SSL is not enabled, as the version of the library should also be included when SSPI is used to generate security contexts. Removed SSPI from the feature list as the features are GSS-Negotiate, NTLM and SSL depending on the usage of the SSPI library. --- lib/version.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index c56ad3962..2a2c5c0d2 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -64,10 +64,16 @@ char *curl_version(void) { static char version[200]; - char *ptr=version; + char *ptr = version; size_t len; size_t left = sizeof(version); - strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION ); +#ifdef USE_WINDOWS_SSPI +#ifndef USE_SCHANNEL + int sspi_major = 0, sspi_minor = 0, sspi_build = 0; +#endif +#endif + + strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION); len = strlen(ptr); left -= len; ptr += len; @@ -82,6 +88,19 @@ char *curl_version(void) } } +#ifdef USE_WINDOWS_SSPI +#ifndef USE_SCHANNEL + if(CURLE_OK == Curl_sspi_version(&sspi_major, &sspi_minor, &sspi_build, + NULL)) + len = snprintf(ptr, left, " WinSSPI/%d.%d.%d", sspi_major, sspi_minor, + sspi_build); + else + len = snprintf(ptr, left, " WinSSPI/unknown"); + + left -= len; + ptr += len; +#endif +#endif #ifdef HAVE_LIBZ len = snprintf(ptr, left, " zlib/%s", zlibVersion()); left -= len; @@ -243,9 +262,6 @@ static curl_version_info_data version_info = { #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) | CURL_VERSION_NTLM_WB #endif -#ifdef USE_WINDOWS_SSPI - | CURL_VERSION_SSPI -#endif #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ #endif -- cgit v1.2.1 From af0888aaf6b444388d9b2770e310e9ef48354515 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 11 Jun 2012 22:58:39 +0200 Subject: Revert: 634f7cfee40d4658 partially Make sure CURL_VERSION_SSPI is present and works as in previous releases for ABI and API compatibility reasons. --- lib/version.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 2a2c5c0d2..9f9fc78b1 100644 --- a/lib/version.c +++ b/lib/version.c @@ -262,6 +262,9 @@ static curl_version_info_data version_info = { #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) | CURL_VERSION_NTLM_WB #endif +#ifdef USE_WINDOWS_SSPI + | CURL_VERSION_SSPI +#endif #ifdef HAVE_LIBZ | CURL_VERSION_LIBZ #endif -- cgit v1.2.1 From 819afe46eeab2c7fa4738e4d77fa2a79a7bb8ebe Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 13 Jun 2012 15:53:51 +0200 Subject: schannel: remove version number and identify its use with 'schannel' literal Version number is removed in order to make this info consistent with how we do it with other MS and Linux system libraries for which we don't provide this info. Identifier changed from 'WinSSPI' to 'schannel' given that this is the actual provider of the SSL/TLS support. libcurl can still be built with SSPI and without SCHANNEL support. --- lib/version.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 9f9fc78b1..783732403 100644 --- a/lib/version.c +++ b/lib/version.c @@ -67,11 +67,6 @@ char *curl_version(void) char *ptr = version; size_t len; size_t left = sizeof(version); -#ifdef USE_WINDOWS_SSPI -#ifndef USE_SCHANNEL - int sspi_major = 0, sspi_minor = 0, sspi_build = 0; -#endif -#endif strcpy(ptr, LIBCURL_NAME "/" LIBCURL_VERSION); len = strlen(ptr); @@ -88,19 +83,6 @@ char *curl_version(void) } } -#ifdef USE_WINDOWS_SSPI -#ifndef USE_SCHANNEL - if(CURLE_OK == Curl_sspi_version(&sspi_major, &sspi_minor, &sspi_build, - NULL)) - len = snprintf(ptr, left, " WinSSPI/%d.%d.%d", sspi_major, sspi_minor, - sspi_build); - else - len = snprintf(ptr, left, " WinSSPI/unknown"); - - left -= len; - ptr += len; -#endif -#endif #ifdef HAVE_LIBZ len = snprintf(ptr, left, " zlib/%s", zlibVersion()); left -= len; -- cgit v1.2.1 From 33b815e894fb64d94fb8f50b19061ded73996ad4 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Thu, 26 Jul 2012 02:49:39 +0200 Subject: Changed Windows IDN text to 'WinIDN'. Synced the output to the same short form as we now use for Windows SSL (WinSSL). --- lib/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index 783732403..c9175cf62 100644 --- a/lib/version.c +++ b/lib/version.c @@ -102,7 +102,7 @@ char *curl_version(void) } #endif #ifdef USE_WIN32_IDN - len = snprintf(ptr, left, " IDN-Windows-native"); + len = snprintf(ptr, left, " WinIDN"); left -= len; ptr += len; #endif -- cgit v1.2.1 From 31f39120b7803888ac5b5ed4113d112046166fb9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 8 Aug 2012 14:58:09 +0200 Subject: curl_version: fixed Value stored to 'len' is never read Fixed this (harmless) clang-analyzer warning. Also fixed the source indentation level. --- lib/version.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/version.c') diff --git a/lib/version.c b/lib/version.c index c9175cf62..ef8353ae2 100644 --- a/lib/version.c +++ b/lib/version.c @@ -132,12 +132,15 @@ char *curl_version(void) else suff[0] = '\0'; - len = snprintf(ptr, left, " librtmp/%d.%d%s", - RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, suff); + snprintf(ptr, left, " librtmp/%d.%d%s", + RTMP_LIB_VERSION >> 16, (RTMP_LIB_VERSION >> 8) & 0xff, + suff); /* If another lib version is added below this one, this code would also have to do: + len = what snprintf() returned + left -= len; ptr += len; */ -- cgit v1.2.1