Fix 'scons check' build with LibreSSL.
* test/MockHTTPinC/MockHTTP_server.c
(USE_LEGACY_OPENSSL): Remove this definition.
(bio_apr_socket_create, bio_set_data, bio_get_data, bio_apr_socket_method,
bio_meth_apr_socket_new, bio_meth_free): Check SERF_NO_SSL_BIO_WRAPPERS
instead of USE_LEGACY_OPENSSL.
(initSSLCtx): Check SERF_HAVE_OPENSSL_MALLOC_INIT, not USE_LEGACY_OPENSSL.
git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1781658 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/MockHTTPinC/MockHTTP_server.c b/test/MockHTTPinC/MockHTTP_server.c
index 786da88..61fff2d 100644
--- a/test/MockHTTPinC/MockHTTP_server.c
+++ b/test/MockHTTPinC/MockHTTP_server.c
@@ -2239,10 +2239,6 @@
#include <openssl/ssl.h>
#include <openssl/err.h>
-#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
-#define USE_LEGACY_OPENSSL
-#endif
-
struct sslCtx_t {
bool handshake_done;
bool renegotiate;
@@ -2278,7 +2274,7 @@
*/
static int bio_apr_socket_create(BIO *bio)
{
-#ifndef USE_LEGACY_OPENSSL
+#ifndef SERF_NO_SSL_BIO_WRAPPERS
BIO_set_shutdown(bio, 1);
BIO_set_init(bio, 1);
BIO_set_data(bio, NULL);
@@ -2294,7 +2290,7 @@
static void bio_set_data(BIO *bio, void *data)
{
-#ifndef USE_LEGACY_OPENSSL
+#ifndef SERF_NO_SSL_BIO_WRAPPERS
BIO_set_data(bio, data);
#else
bio->ptr = data;
@@ -2303,7 +2299,7 @@
static void *bio_get_data(BIO *bio)
{
-#ifndef USE_LEGACY_OPENSSL
+#ifndef SERF_NO_SSL_BIO_WRAPPERS
return BIO_get_data(bio);
#else
return bio->ptr;
@@ -2404,7 +2400,7 @@
}
-#ifdef USE_LEGACY_OPENSSL
+#ifdef SERF_NO_SSL_BIO_WRAPPERS
static BIO_METHOD bio_apr_socket_method = {
BIO_TYPE_SOCKET,
"APR sockets",
@@ -2425,7 +2421,7 @@
{
BIO_METHOD *biom = NULL;
-#ifndef USE_LEGACY_OPENSSL
+#ifndef SERF_NO_SSL_BIO_WRAPPERS
biom = BIO_meth_new(BIO_TYPE_SOCKET, "APR sockets");
if (biom) {
BIO_meth_set_write(biom, bio_apr_socket_write);
@@ -2443,7 +2439,7 @@
static void bio_meth_free(BIO_METHOD *biom)
{
-#ifndef USE_LEGACY_OPENSSL
+#ifndef SERF_NO_SSL_BIO_WRAPPERS
BIO_meth_free(biom);
#endif
}
@@ -2672,7 +2668,7 @@
/* Init OpenSSL globally */
if (!init_done)
{
-#ifndef USE_LEGACY_OPENSSL
+#ifdef SERF_HAVE_OPENSSL_MALLOC_INIT
OPENSSL_malloc_init();
#else
CRYPTO_malloc_init();