diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2006-02-26 20:55:43 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2006-02-26 20:55:43 +0000 |
commit | 30944474a7d5c5a6629e79939be4875071a0795e (patch) | |
tree | db3ef0202f732e67e411564cd7df01fe1486c63b | |
parent | 7160168c975c03b67f3e1affad601499c1ae103e (diff) | |
download | neon-30944474a7d5c5a6629e79939be4875071a0795e.tar.gz |
* macros/neon.m4 (NEON_SSL): Define a feature macro for thread-safe
SSL support.
* src/ne_utils.h: Add NE_FEATURE_TS_SSL feature code.
* src/ne_utils.c (ne_has_support): Support it (or... not).
* neon-config.in: Add feature code.
* test/util-tests.c (support): Test for it.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@953 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
-rw-r--r-- | macros/neon.m4 | 5 | ||||
-rw-r--r-- | neon-config.in | 11 | ||||
-rw-r--r-- | src/ne_utils.c | 8 | ||||
-rw-r--r-- | src/ne_utils.h | 3 | ||||
-rw-r--r-- | test/util-tests.c | 9 |
5 files changed, 26 insertions, 10 deletions
diff --git a/macros/neon.m4 b/macros/neon.m4 index 6ef38ec..e3d8339 100644 --- a/macros/neon.m4 +++ b/macros/neon.m4 @@ -948,7 +948,10 @@ posix|yes) AC_MSG_ERROR([could not find POSIX mutex interfaces; (try CC="${CC} -pthread"?)]) fi AC_DEFINE([HAVE_PTHREADS], 1, [Define if POSIX threads are supported]) - AC_MSG_NOTICE([Using POSIX threads for SSL library thread-safety]) + NE_ENABLE_SUPPORT(TS_SSL, [Thread-safe SSL supported using POSIX threads]) + ;; +*) + NE_DISABLE_SUPPORT(TS_SSL, [Thread-safe SSL not supported]) ;; esac diff --git a/neon-config.in b/neon-config.in index 83ace56..3475122 100644 --- a/neon-config.in +++ b/neon-config.in @@ -1,15 +1,12 @@ #! /bin/sh # Originally from libxml, Copyright (C) Daniel Veillard -# Modifications for neon Copyright (C) 2000-2005 Joe Orton. +# Modifications for neon Copyright (C) 2000-2006 Joe Orton. prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ -features="dav [@NE_FLAG_DAV@], ssl [@NE_FLAG_SSL@], zlib [@NE_FLAG_ZLIB@], \ -ipv6 [@NE_FLAG_IPV6@], lfs [@NE_FLAG_LFS@], i18n [@NE_FLAG_I18N@]" - usage() { cat <<EOF @@ -24,7 +21,10 @@ Known values for OPTION are: --help display this help and exit --version output version information --support FEATURE exit with success if feature is supported - Known features: $features + + Known features: + dav [@NE_FLAG_DAV@], ssl [@NE_FLAG_SSL@], zlib [@NE_FLAG_ZLIB@], ipv6 [@NE_FLAG_IPV6@], lfs [@NE_FLAG_LFS@], + i18n [@NE_FLAG_I18N@], ts_ssl [@NE_FLAG_TS_SSL@] EOF @@ -95,6 +95,7 @@ while test $# -gt 0; do dav|DAV) support @NE_FLAG_DAV@ ;; lfs|LFS) support @NE_FLAG_LFS@ ;; i18n|I18N) support @NE_FLAG_I18N@ ;; + ts_ssl|TS_SSL) support @NE_FLAG_TS_SSL@ ;; *) support no ;; esac ;; diff --git a/src/ne_utils.c b/src/ne_utils.c index 5b7e82b..21789f8 100644 --- a/src/ne_utils.c +++ b/src/ne_utils.c @@ -1,6 +1,6 @@ /* HTTP utility functions - Copyright (C) 1999-2005, Joe Orton <joe@manyfish.co.uk> + Copyright (C) 1999-2006, Joe Orton <joe@manyfish.co.uk> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -136,7 +136,8 @@ int ne_has_support(int feature) { switch (feature) { #if defined(NE_HAVE_SSL) || defined(NE_HAVE_ZLIB) || defined(NE_HAVE_IPV6) \ - || defined(NE_HAVE_SOCKS) || defined(NE_HAVE_LFS) + || defined(NE_HAVE_SOCKS) || defined(NE_HAVE_LFS) \ + || defined(NE_HAVE_TS_SSL) #ifdef NE_HAVE_SSL case NE_FEATURE_SSL: #endif @@ -152,6 +153,9 @@ int ne_has_support(int feature) #ifdef NE_HAVE_LFS case NE_FEATURE_LFS: #endif +#ifdef NE_HAVE_TS_SSL + case NE_FEATURE_TS_SSL: +#endif return 1; #endif /* NE_HAVE_* */ default: diff --git a/src/ne_utils.h b/src/ne_utils.h index 3a81e9b..c753275 100644 --- a/src/ne_utils.h +++ b/src/ne_utils.h @@ -1,6 +1,6 @@ /* HTTP utility functions - Copyright (C) 1999-2005, Joe Orton <joe@manyfish.co.uk> + Copyright (C) 1999-2006, Joe Orton <joe@manyfish.co.uk> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -52,6 +52,7 @@ int ne_version_match(int major, int minor); #define NE_FEATURE_IPV6 (3) /* IPv6 is supported in resolver */ #define NE_FEATURE_LFS (4) /* large file support */ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ +#define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ /* Returns non-zero if neon has support for given feature code * NE_FEATURE_*. */ diff --git a/test/util-tests.c b/test/util-tests.c index 99ad037..b255b3b 100644 --- a/test/util-tests.c +++ b/test/util-tests.c @@ -1,6 +1,6 @@ /* utils tests - Copyright (C) 2001-2005, Joe Orton <joe@manyfish.co.uk> + Copyright (C) 2001-2006, Joe Orton <joe@manyfish.co.uk> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -278,6 +278,13 @@ static int support(void) #else ONN("LFS support advertised", ne_has_support(NE_FEATURE_LFS)); #endif +#ifdef NE_HAVE_TS_SSL + ONN("Thread-safe SSL support not advertised", + !ne_has_support(NE_FEATURE_TS_SSL)); +#else + ONN("Thread-safe SSL support advertised", + ne_has_support(NE_FEATURE_TS_SSL)); +#endif return OK; } |